Merge from trunk

This commit is contained in:
Charles Haley 2013-01-27 09:25:30 +01:00
commit d7bb9fa6ff
8 changed files with 52 additions and 8 deletions

View File

@ -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;}
'''

View File

@ -191,7 +191,7 @@ class ANDROID(USBMS):
# Pantech # Pantech
0x10a9 : { 0x6050 : [0x227] }, 0x10a9 : { 0x6050 : [0x227] },
# Prestigio # Prestigio and Teclast
0x2207 : { 0 : [0x222], 0x10 : [0x222] }, 0x2207 : { 0 : [0x222], 0x10 : [0x222] },
} }
@ -215,7 +215,7 @@ class ANDROID(USBMS):
'POCKET', 'ONDA_MID', 'ZENITHIN', 'INGENIC', 'PMID701C', 'PD', 'POCKET', 'ONDA_MID', 'ZENITHIN', 'INGENIC', 'PMID701C', 'PD',
'PMP5097C', 'MASS', 'NOVO7', 'ZEKI', 'COBY', 'SXZ', 'USB_2.0', 'PMP5097C', 'MASS', 'NOVO7', 'ZEKI', 'COBY', 'SXZ', 'USB_2.0',
'COBY_MID', 'VS', 'AINOL', 'TOPWISE', 'PAD703', 'NEXT8D12', 'COBY_MID', 'VS', 'AINOL', 'TOPWISE', 'PAD703', 'NEXT8D12',
'MEDIATEK', 'KEENHI'] 'MEDIATEK', 'KEENHI', 'TECLAST']
WINDOWS_MAIN_MEM = ['ANDROID_PHONE', 'A855', 'A853', 'INC.NEXUS_ONE', WINDOWS_MAIN_MEM = ['ANDROID_PHONE', 'A855', 'A853', 'INC.NEXUS_ONE',
'__UMS_COMPOSITE', '_MB200', 'MASS_STORAGE', '_-_CARD', 'SGH-I897', '__UMS_COMPOSITE', '_MB200', 'MASS_STORAGE', '_-_CARD', 'SGH-I897',
'GT-I9000', 'FILE-STOR_GADGET', 'SGH-T959_CARD', 'SGH-T959', 'SAMSUNG_ANDROID', 'GT-I9000', 'FILE-STOR_GADGET', 'SGH-T959_CARD', 'SGH-T959', 'SAMSUNG_ANDROID',

View File

@ -464,7 +464,7 @@ class Mobi8Reader(object):
start = None start = None
reached = True reached = True
if frag: if frag:
elems = XPath('//*[@id="%s"]'%frag) elems = XPath('//*[@id="%s"]'%frag)(root)
if elems: if elems:
start = elems[0] start = elems[0]

View File

@ -108,6 +108,7 @@ class PdfEngine(QPaintEngine):
def init_page(self): def init_page(self):
self.pdf.transform(self.pdf_system) 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.graphics.reset()
self.pdf.save_stack() self.pdf.save_stack()
self.current_page_inited = True self.current_page_inited = True

View File

@ -252,7 +252,7 @@ class GraphicsState(object):
'clip_updated', 'do_fill', 'do_stroke') 'clip_updated', 'do_fill', 'do_stroke')
def __init__(self): def __init__(self):
self.fill = QBrush() self.fill = QBrush(Qt.white)
self.stroke = QPen() self.stroke = QPen()
self.opacity = 1.0 self.opacity = 1.0
self.transform = QTransform() self.transform = QTransform()

View File

@ -113,7 +113,7 @@ def main():
app app
tdir = os.path.abspath('.') tdir = os.path.abspath('.')
pdf = os.path.join(tdir, 'painter.pdf') pdf = os.path.join(tdir, 'painter.pdf')
func = brush func = full
dpi = 100 dpi = 100
with open(pdf, 'wb') as f: with open(pdf, 'wb') as f:
dev = PdfDevice(f, xdpi=dpi, ydpi=dpi, compress=False) dev = PdfDevice(f, xdpi=dpi, ydpi=dpi, compress=False)

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function) 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' __license__ = 'GPL 3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>' __copyright__ = '2011, John Schember <john@nachtimwald.com>'
@ -26,7 +26,8 @@ class BeamEBooksDEStore(BasicStoreConfig, StorePlugin):
def open(self, parent=None, detail_item=None, external=False): def open(self, parent=None, detail_item=None, external=False):
url = 'http://klick.affiliwelt.net/klick.php?bannerid=10072&pid=32307&prid=908' url = 'http://klick.affiliwelt.net/klick.php?bannerid=10072&pid=32307&prid=908'
url_details = ('http://klick.affiliwelt.net/klick.php?' 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 external or self.config.get('open_external', False):
if detail_item: if detail_item:
@ -43,7 +44,8 @@ class BeamEBooksDEStore(BasicStoreConfig, StorePlugin):
d.exec_() d.exec_()
def search(self, query, max_results=10, timeout=60): 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() br = browser()
counter = max_results counter = max_results

View File

@ -173,6 +173,7 @@ _extra_lang_codes = {
'es_PY' : _('Spanish (Paraguay)'), 'es_PY' : _('Spanish (Paraguay)'),
'es_UY' : _('Spanish (Uruguay)'), 'es_UY' : _('Spanish (Uruguay)'),
'es_AR' : _('Spanish (Argentina)'), 'es_AR' : _('Spanish (Argentina)'),
'es_CR' : _('Spanish (Costa Rica)'),
'es_MX' : _('Spanish (Mexico)'), 'es_MX' : _('Spanish (Mexico)'),
'es_CU' : _('Spanish (Cuba)'), 'es_CU' : _('Spanish (Cuba)'),
'es_CL' : _('Spanish (Chile)'), 'es_CL' : _('Spanish (Chile)'),