mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from trunk
This commit is contained in:
commit
6f92a4c31d
@ -315,3 +315,11 @@ locale_for_sorting = ''
|
|||||||
# metadata one book at a time. If True, then the fields are laid out using two
|
# metadata one book at a time. If True, then the fields are laid out using two
|
||||||
# columns. If False, one column is used.
|
# columns. If False, one column is used.
|
||||||
metadata_single_use_2_cols_for_custom_fields = True
|
metadata_single_use_2_cols_for_custom_fields = True
|
||||||
|
|
||||||
|
# The number of seconds to wait before sending emails when using a
|
||||||
|
# public email server like gmail or hotmail. Default is: 5 minutes
|
||||||
|
# Setting it to lower may cause the server's SPAM controls to kick in,
|
||||||
|
# making email sending fail. Changes will take effect only after a restart of
|
||||||
|
# calibre.
|
||||||
|
public_smtp_relay_delay = 301
|
||||||
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
eluniversal.com.mx
|
eluniversal.com.mx
|
||||||
'''
|
'''
|
||||||
@ -18,75 +16,25 @@ class ElUniversal(BasicNewsRecipe):
|
|||||||
category = 'news, politics, Mexico'
|
category = 'news, politics, Mexico'
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
encoding = 'cp1252'
|
encoding = 'utf8'
|
||||||
remove_javascript = True
|
remove_javascript = True
|
||||||
language = 'es'
|
remove_empty_feeds = True
|
||||||
|
publication_type = 'newspaper'
|
||||||
|
language = 'es'
|
||||||
|
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
body{font-family:Arial,Helvetica,sans-serif; font-size:x-small;}
|
body{font-family:Arial,Helvetica,sans-serif}
|
||||||
.geoGris30{font-family:Georgia,"Times New Roman",Times,serif; font-size:large; color:#003366; font-weight:bold;}
|
.noteTitle{font-family: Georgia,"Times New Roman",Times,serif; color: #336699; font-size: xx-large; font-weight: bold}
|
||||||
.arnegro16{font-family:Georgia,"Times New Roman",Times,serif; font-weight:bold; font-size:small;}
|
.noteInfo{display: block; color: gray}
|
||||||
.tbazull2{font-family:"trebuchet ms",Arial,Helvetica,sans-serif; color:#336699; font-size:xx-small;}
|
|
||||||
.tbgrisf11{font-family:"trebuchet ms",Arial,Helvetica,sans-serif; color: #666666; font-size:xx-small;}
|
|
||||||
.verrojo13{font-family:"trebuchet ms",Arial,Helvetica,sans-serif; color: #CC0033; font-size:xx-small;}
|
|
||||||
.trnegro13{font-family:"trebuchet ms",Arial,Helvetica,sans-serif; font-size:xx-small;}
|
|
||||||
.txt-fotogaleria{font-family:"trebuchet ms",Arial,Helvetica,sans-serif; font-size:xx-small;}
|
|
||||||
'''
|
'''
|
||||||
keep_only_tags = [ dict(name='table', attrs={'width':"633"}),dict(name='table', attrs={'width':"629"}),]
|
keep_only_tags = [ dict(name='div', attrs={'id':'noteContent'})]
|
||||||
|
remove_tags_after = dict(attrs={'class':'noteText'})
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(name='table', attrs={'bgcolor':"#f5f5f5"}),
|
dict(attrs={'class':'noteExtras'}),
|
||||||
dict(name='td', attrs={'bgcolor':"#f7f8f9"}),
|
dict(name=['meta','iframe','base','embed','object']),
|
||||||
dict(name='td', attrs={'bgcolor':"#f5f5f5"}),
|
dict(attrs={'id':'tm_box'})
|
||||||
dict(name='table', attrs={'width':"302"}),
|
]
|
||||||
dict(name='table', attrs={'width':"214"}),
|
remove_attributes=['lang','onclick']
|
||||||
dict(name='table', attrs={'width':"112"}),
|
|
||||||
dict(name='table', attrs={'width':"980"}),
|
|
||||||
dict(name='td', attrs={'height':"1"}),
|
|
||||||
dict(name='td', attrs={'height':"4"}),
|
|
||||||
dict(name='td', attrs={'height':"20"}),
|
|
||||||
dict(name='td', attrs={'height':"10"}),
|
|
||||||
dict(name='td', attrs={'class':["trrojo11","trbris11","trrojo12","arrojo12s","tbazul13"]}),
|
|
||||||
dict(name='div', attrs={'id':["mapg","ver_off_todosloscom","todosloscom"]}),
|
|
||||||
dict(name='span', attrs={'class':["trazul18b","trrojo11","trnaranja11","trbris11","georojo18b","geogris18"]}),
|
|
||||||
dict(name='span', attrs={'class':["detalles-opinion"]}),
|
|
||||||
dict(name='a', attrs={'class':["arnaranja12b","trbris11","arazul12rel","trrojo10"]}),
|
|
||||||
dict(name='img', src = "/img/icono_imprimir.gif"),
|
|
||||||
dict(name='img', src = "/img/icono_enviar_mail.gif"),
|
|
||||||
dict(name='img', src = "/img/icono_fuente_g.gif"),
|
|
||||||
dict(name='img', src = "/img/icono_fuente_m.gif"),
|
|
||||||
dict(name='img', src = "/img/icono_fuente_c.gif"),
|
|
||||||
dict(name='img', src = "/img/icono_compartir.gif"),
|
|
||||||
dict(name='img', src = "/img/icono_enviar_coment.gif"),
|
|
||||||
dict(name='img', src = "http://www.eluniversal.com.mx/n_img/bot-notasrel.gif"),
|
|
||||||
dict(name='img', src = "http://www.eluniversal.com.mx/n_img/fr.gif"),
|
|
||||||
dict(name='img', src = "/img/espiral2.gif"),
|
|
||||||
dict(name='img', src = "http://www.eluniversal.com.mx/n_img/b"),
|
|
||||||
dict(name='img', src = "/img/icono_enviar_coment.gifot-notasrel.gif"),
|
|
||||||
dict(name='img', src = "/n_img/icono_tipo3.gif"),
|
|
||||||
dict(name='img', src = "/n_img/icono_tipo2.gif"),
|
|
||||||
dict(name='img', src = "/n_img/icono_print.gif"),
|
|
||||||
dict(name='img', src = "/n_img/icono_mail2.gif"),
|
|
||||||
dict(name='img', src = "/n_img/im-comentarios-2a.gif"),
|
|
||||||
dict(name='img', src = "/n_img/im-comentarios-1a.gif"),
|
|
||||||
dict(name='img', src = "/img/icono_coment.gif"),
|
|
||||||
dict(name='img', src = "http://www.eluniversal.com.mx/n_img/bot-sitiosrel.gif"),
|
|
||||||
dict(name='img', src = "/n_img/icono_tipomenos.gif"),
|
|
||||||
dict(name='img', src = "/img/futbol/19.jpg"),
|
|
||||||
dict(name='img', alt = "Facebook"),
|
|
||||||
dict(name='img', alt = "Twitter"),
|
|
||||||
dict(name='img', alt = "Google"),
|
|
||||||
dict(name='img', alt = "LinkedIn"),
|
|
||||||
dict(name='img', alt = "Viadeo"),
|
|
||||||
dict(name='img', alt = "Digg"),
|
|
||||||
dict(name='img', alt = "Delicious"),
|
|
||||||
dict(name='img', alt = "Meneame"),
|
|
||||||
dict(name='img', alt = "Yahoo"),
|
|
||||||
dict(name='img', alt = "Technorati"),
|
|
||||||
dict(name='a',text =["Compartir","Facebook","Twitter","Google","LinkedIn","Viadeo","Digg","Delicious","Meneame","Yahoo","Technorati"]),
|
|
||||||
dict(name='select'),
|
|
||||||
dict(name='a', attrs={'class':"tbgriscompartir"}),
|
|
||||||
]
|
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
(u'Minuto por Minuto', u'http://www.eluniversal.com.mx/rss/universalmxm.xml' )
|
(u'Minuto por Minuto', u'http://www.eluniversal.com.mx/rss/universalmxm.xml' )
|
||||||
@ -101,25 +49,3 @@ class ElUniversal(BasicNewsRecipe):
|
|||||||
,(u'Computacion' , u'http://www.eluniversal.com.mx/rss/computo.xml' )
|
,(u'Computacion' , u'http://www.eluniversal.com.mx/rss/computo.xml' )
|
||||||
,(u'Sociedad' , u'http://www.eluniversal.com.mx/rss/sociedad.xml' )
|
,(u'Sociedad' , u'http://www.eluniversal.com.mx/rss/sociedad.xml' )
|
||||||
]
|
]
|
||||||
|
|
||||||
# def print_version(self, url):
|
|
||||||
# return url.replace('/notas/','/notas/vi_')
|
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
|
||||||
mtag = '<meta http-equiv="Content-Language" content="es-MX"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8">'
|
|
||||||
soup.head.insert(0,mtag)
|
|
||||||
for tag in soup.findAll(name='td',attrs={'class': 'arazul50'}):
|
|
||||||
tag.insert(0,"<h1>")
|
|
||||||
tag.insert(2,"</h1>")
|
|
||||||
|
|
||||||
return soup
|
|
||||||
|
|
||||||
def postprocess_html(self, soup,first):
|
|
||||||
|
|
||||||
for tag in soup.findAll(name=['table', 'span','i']):
|
|
||||||
tag.name = 'div'
|
|
||||||
for item in soup.findAll(align = "right"):
|
|
||||||
del item['align']
|
|
||||||
|
|
||||||
return soup
|
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ from calibre.customize.ui import available_input_formats, available_output_forma
|
|||||||
from calibre.ebooks.metadata import authors_to_string
|
from calibre.ebooks.metadata import authors_to_string
|
||||||
from calibre.constants import preferred_encoding
|
from calibre.constants import preferred_encoding
|
||||||
from calibre.gui2 import config, Dispatcher, warning_dialog
|
from calibre.gui2 import config, Dispatcher, warning_dialog
|
||||||
|
from calibre.utils.config import tweaks
|
||||||
|
|
||||||
class EmailJob(BaseJob): # {{{
|
class EmailJob(BaseJob): # {{{
|
||||||
|
|
||||||
@ -83,7 +84,7 @@ class Emailer(Thread): # {{{
|
|||||||
rh = opts.relay_host
|
rh = opts.relay_host
|
||||||
if rh and (
|
if rh and (
|
||||||
'gmail.com' in rh or 'live.com' in rh):
|
'gmail.com' in rh or 'live.com' in rh):
|
||||||
self.rate_limit = 301
|
self.rate_limit = tweaks['public_smtp_relay_delay']
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
self._run = False
|
self._run = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user