diff --git a/recipes/la_nacion_cr.recipe b/recipes/la_nacion_cr.recipe new file mode 100644 index 0000000000..ae320064d6 --- /dev/null +++ b/recipes/la_nacion_cr.recipe @@ -0,0 +1,40 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class crnews(BasicNewsRecipe): + __author__ = 'Douglas Delgado' + title = u'La Nacion' + publisher = 'GRUPO NACION GN, S. A.' + description = 'Diario de circulacion nacional de Costa Rica. Recipe creado por Douglas Delgado (doudelgado@gmail.com) para su uso con Calibre por Kovid Goyal' + category = 'Spanish, Entertainment' + masthead_url = 'http://www.nacion.com/App_Themes/nacioncom/Images/logo_nacioncom.png' + + oldest_article = 7 + delay = 1 + max_articles_per_feed = 100 + auto_cleanup = True + encoding = 'utf-8' + language = 'es_CR' + use_embedded_content = False + remove_empty_feeds = True + remove_javascript = True + no_stylesheets = True + + + feeds = [(u'Portada', u'http://www.nacion.com/Generales/RSS/EdicionRss.aspx?section=portada'), (u'Ultima Hora', u'http://www.nacion.com/Generales/RSS/UltimaHoraRss.aspx'), (u'Nacionales', u'http://www.nacion.com/Generales/RSS/EdicionRss.aspx?section=elpais'), (u'Entretenimiento', u'http://www.nacion.com/Generales/RSS/EdicionRss.aspx?section=entretenimiento'), (u'Sucesos', u'http://www.nacion.com/Generales/RSS/EdicionRss.aspx?section=sucesos'), (u'Deportes', u'http://www.nacion.com/Generales/RSS/EdicionRss.aspx?section=deportes'), (u'Internacionales', u'http://www.nacion.com/Generales/RSS/EdicionRss.aspx?section=mundo'), (u'Economia', u'http://www.nacion.com/Generales/RSS/EdicionRss.aspx?section=economia'), (u'Aldea Global', u'http://www.nacion.com/Generales/RSS/EdicionRss.aspx?section=aldeaglobal'), (u'Tecnologia', u'http://www.nacion.com/Generales/RSS/EdicionRss.aspx?section=tecnologia'), (u'Opinion', u'http://www.nacion.com/Generales/RSS/EdicionRss.aspx?section=opinion')] + + def get_cover_url(self): + index = 'http://kiosko.net/cr/np/cr_nacion.html' + soup = self.index_to_soup(index) + for image in soup.findAll('img',src=True): + if image['src'].endswith('cr_nacion.750.jpg'): + return image['src'] + return None + + def get_article_url(self, article): + url = article.get('guid', None) + return url + + extra_css = ''' + h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:30px;} + h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal; font-style:italic; font-size:18px;} + ''' diff --git a/src/calibre/devices/android/driver.py b/src/calibre/devices/android/driver.py index 91ebc3980c..c66cb1c996 100644 --- a/src/calibre/devices/android/driver.py +++ b/src/calibre/devices/android/driver.py @@ -191,7 +191,7 @@ class ANDROID(USBMS): # Pantech 0x10a9 : { 0x6050 : [0x227] }, - # Prestigio + # Prestigio and Teclast 0x2207 : { 0 : [0x222], 0x10 : [0x222] }, } @@ -215,7 +215,7 @@ class ANDROID(USBMS): 'POCKET', 'ONDA_MID', 'ZENITHIN', 'INGENIC', 'PMID701C', 'PD', 'PMP5097C', 'MASS', 'NOVO7', 'ZEKI', 'COBY', 'SXZ', 'USB_2.0', 'COBY_MID', 'VS', 'AINOL', 'TOPWISE', 'PAD703', 'NEXT8D12', - 'MEDIATEK', 'KEENHI'] + 'MEDIATEK', 'KEENHI', 'TECLAST'] WINDOWS_MAIN_MEM = ['ANDROID_PHONE', 'A855', 'A853', 'INC.NEXUS_ONE', '__UMS_COMPOSITE', '_MB200', 'MASS_STORAGE', '_-_CARD', 'SGH-I897', 'GT-I9000', 'FILE-STOR_GADGET', 'SGH-T959_CARD', 'SGH-T959', 'SAMSUNG_ANDROID', diff --git a/src/calibre/ebooks/mobi/reader/mobi8.py b/src/calibre/ebooks/mobi/reader/mobi8.py index b6fe7d9aa0..8938b103d3 100644 --- a/src/calibre/ebooks/mobi/reader/mobi8.py +++ b/src/calibre/ebooks/mobi/reader/mobi8.py @@ -464,7 +464,7 @@ class Mobi8Reader(object): start = None reached = True if frag: - elems = XPath('//*[@id="%s"]'%frag) + elems = XPath('//*[@id="%s"]'%frag)(root) if elems: start = elems[0] diff --git a/src/calibre/ebooks/pdf/render/engine.py b/src/calibre/ebooks/pdf/render/engine.py index 1be8613cea..3e9497a3d3 100644 --- a/src/calibre/ebooks/pdf/render/engine.py +++ b/src/calibre/ebooks/pdf/render/engine.py @@ -108,6 +108,7 @@ class PdfEngine(QPaintEngine): def init_page(self): self.pdf.transform(self.pdf_system) + self.pdf.apply_fill(color=(1, 1, 1)) # QPainter has a default background brush of white self.graphics.reset() self.pdf.save_stack() self.current_page_inited = True diff --git a/src/calibre/ebooks/pdf/render/graphics.py b/src/calibre/ebooks/pdf/render/graphics.py index 25e23fcd0b..f24b698350 100644 --- a/src/calibre/ebooks/pdf/render/graphics.py +++ b/src/calibre/ebooks/pdf/render/graphics.py @@ -252,7 +252,7 @@ class GraphicsState(object): 'clip_updated', 'do_fill', 'do_stroke') def __init__(self): - self.fill = QBrush() + self.fill = QBrush(Qt.white) self.stroke = QPen() self.opacity = 1.0 self.transform = QTransform() diff --git a/src/calibre/ebooks/pdf/render/test.py b/src/calibre/ebooks/pdf/render/test.py index a68daea97b..dcd90fa8b6 100644 --- a/src/calibre/ebooks/pdf/render/test.py +++ b/src/calibre/ebooks/pdf/render/test.py @@ -113,7 +113,7 @@ def main(): app tdir = os.path.abspath('.') pdf = os.path.join(tdir, 'painter.pdf') - func = brush + func = full dpi = 100 with open(pdf, 'wb') as f: dev = PdfDevice(f, xdpi=dpi, ydpi=dpi, compress=False) diff --git a/src/calibre/gui2/store/stores/beam_ebooks_de_plugin.py b/src/calibre/gui2/store/stores/beam_ebooks_de_plugin.py index 7a35b91fc3..e8e320a88e 100644 --- a/src/calibre/gui2/store/stores/beam_ebooks_de_plugin.py +++ b/src/calibre/gui2/store/stores/beam_ebooks_de_plugin.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import (unicode_literals, division, absolute_import, print_function) -store_version = 1 # Needed for dynamic plugin loading +store_version = 2 # Needed for dynamic plugin loading __license__ = 'GPL 3' __copyright__ = '2011, John Schember ' @@ -26,7 +26,8 @@ class BeamEBooksDEStore(BasicStoreConfig, StorePlugin): def open(self, parent=None, detail_item=None, external=False): url = 'http://klick.affiliwelt.net/klick.php?bannerid=10072&pid=32307&prid=908' url_details = ('http://klick.affiliwelt.net/klick.php?' - 'bannerid=66820&pid=32307&prid=908&feedid=27&prdid={0}') + 'bannerid=66830&pid=32307&prid=908&' + 'url=http://www.beam-ebooks.de/ebook/{0}') if external or self.config.get('open_external', False): if detail_item: @@ -43,7 +44,8 @@ class BeamEBooksDEStore(BasicStoreConfig, StorePlugin): d.exec_() def search(self, query, max_results=10, timeout=60): - url = 'http://www.beam-ebooks.de/suchergebnis.php?Type=&sw=' + urllib2.quote(query) + url = 'http://www.beam-ebooks.de/suchergebnis.php?Type=&limit={0}&sw={1}'.format( + max_results, urllib2.quote(query)) br = browser() counter = max_results diff --git a/src/calibre/utils/localization.py b/src/calibre/utils/localization.py index 82385ee271..9b49bf687e 100644 --- a/src/calibre/utils/localization.py +++ b/src/calibre/utils/localization.py @@ -173,6 +173,7 @@ _extra_lang_codes = { 'es_PY' : _('Spanish (Paraguay)'), 'es_UY' : _('Spanish (Uruguay)'), 'es_AR' : _('Spanish (Argentina)'), + 'es_CR' : _('Spanish (Costa Rica)'), 'es_MX' : _('Spanish (Mexico)'), 'es_CU' : _('Spanish (Cuba)'), 'es_CL' : _('Spanish (Chile)'),