mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Fix #2972 (Problem with Accented characters in recipe_publico.py)
This commit is contained in:
parent
4def7e4f9b
commit
c129efbb00
@ -418,8 +418,10 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
|
||||
try:
|
||||
db = LibraryDatabase2(self.library_path)
|
||||
except Exception, err:
|
||||
import traceback
|
||||
error_dialog(self, _('Bad database location'),
|
||||
unicode(err)).exec_()
|
||||
_('Bad database location')+':'+self.library_path,
|
||||
det_msg=traceback.format_exc()).exec_()
|
||||
dir = unicode(QFileDialog.getExistingDirectory(self,
|
||||
_('Choose a location for your ebook library.'),
|
||||
os.path.expanduser('~')))
|
||||
|
@ -91,6 +91,10 @@ sudo python -c "import urllib2; exec urllib2.urlopen('http://calibre.kovidgoyal.
|
||||
You must have xdg-utils installed
|
||||
on your system before running the installer.
|
||||
</li>
|
||||
<li>
|
||||
For device automounting to work, you must have the pmount
|
||||
package installed on your system.
|
||||
</li>
|
||||
<li>
|
||||
On a 64bit machine, you must have 32-bit versions
|
||||
of common libraries like X11, freetype, fontconfig,
|
||||
|
@ -1,62 +1,62 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
estadao.com.br
|
||||
'''
|
||||
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
estadao.com.br
|
||||
'''
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class Estadao(BasicNewsRecipe):
|
||||
title = 'O Estado de S. Paulo'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'News from Brasil in Portugese'
|
||||
publisher = 'O Estado de S. Paulo'
|
||||
category = 'news, politics, Brasil'
|
||||
oldest_article = 2
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
encoding = 'utf8'
|
||||
cover_url = 'http://www.estadao.com.br/img/logo_estadao.png'
|
||||
remove_javascript = True
|
||||
|
||||
html2lrf_options = [
|
||||
class Estadao(BasicNewsRecipe):
|
||||
title = 'O Estado de S. Paulo'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'News from Brasil in Portuguese'
|
||||
publisher = 'O Estado de S. Paulo'
|
||||
category = 'news, politics, Brasil'
|
||||
oldest_article = 2
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
encoding = 'utf8'
|
||||
cover_url = 'http://www.estadao.com.br/img/logo_estadao.png'
|
||||
remove_javascript = True
|
||||
|
||||
html2lrf_options = [
|
||||
'--comment', description
|
||||
, '--category', category
|
||||
, '--publisher', publisher
|
||||
]
|
||||
|
||||
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
|
||||
|
||||
keep_only_tags = [dict(name='div', attrs={'id':'c1'})]
|
||||
|
||||
remove_tags = [
|
||||
dict(name=['script','object','form','ul'])
|
||||
,dict(name='div', attrs={'id':['votacao','estadaohoje']})
|
||||
,dict(name='p', attrs={'id':'ctrl_texto'})
|
||||
,dict(name='p', attrs={'class':'texto'})
|
||||
]
|
||||
|
||||
feeds = [
|
||||
(u'Manchetes Estadao', u'http://www.estadao.com.br/rss/manchetes.xml')
|
||||
,(u'Ultimas noticias', u'http://www.estadao.com.br/rss/ultimas.xml')
|
||||
,(u'Nacional', u'http://www.estadao.com.br/rss/nacional.xml')
|
||||
,(u'Internacional', u'http://www.estadao.com.br/rss/internacional.xml')
|
||||
,(u'Cidades', u'http://www.estadao.com.br/rss/cidades.xml')
|
||||
,(u'Esportes', u'http://www.estadao.com.br/rss/esportes.xml')
|
||||
,(u'Arte & Lazer', u'http://www.estadao.com.br/rss/arteelazer.xml')
|
||||
,(u'Economia', u'http://www.estadao.com.br/rss/economia.xml')
|
||||
,(u'Vida &', u'http://www.estadao.com.br/rss/vidae.xml')
|
||||
]
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
ifr = soup.find('iframe')
|
||||
if ifr:
|
||||
ifr.extract()
|
||||
for item in soup.findAll(style=True):
|
||||
del item['style']
|
||||
return soup
|
||||
|
||||
language = _('Portugese')
|
||||
, '--category', category
|
||||
, '--publisher', publisher
|
||||
]
|
||||
|
||||
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
|
||||
|
||||
keep_only_tags = [dict(name='div', attrs={'id':'c1'})]
|
||||
|
||||
remove_tags = [
|
||||
dict(name=['script','object','form','ul'])
|
||||
,dict(name='div', attrs={'id':['votacao','estadaohoje']})
|
||||
,dict(name='p', attrs={'id':'ctrl_texto'})
|
||||
,dict(name='p', attrs={'class':'texto'})
|
||||
]
|
||||
|
||||
feeds = [
|
||||
(u'Manchetes Estadao', u'http://www.estadao.com.br/rss/manchetes.xml')
|
||||
,(u'Ultimas noticias', u'http://www.estadao.com.br/rss/ultimas.xml')
|
||||
,(u'Nacional', u'http://www.estadao.com.br/rss/nacional.xml')
|
||||
,(u'Internacional', u'http://www.estadao.com.br/rss/internacional.xml')
|
||||
,(u'Cidades', u'http://www.estadao.com.br/rss/cidades.xml')
|
||||
,(u'Esportes', u'http://www.estadao.com.br/rss/esportes.xml')
|
||||
,(u'Arte & Lazer', u'http://www.estadao.com.br/rss/arteelazer.xml')
|
||||
,(u'Economia', u'http://www.estadao.com.br/rss/economia.xml')
|
||||
,(u'Vida &', u'http://www.estadao.com.br/rss/vidae.xml')
|
||||
]
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
ifr = soup.find('iframe')
|
||||
if ifr:
|
||||
ifr.extract()
|
||||
for item in soup.findAll(style=True):
|
||||
del item['style']
|
||||
return soup
|
||||
|
||||
language = _('Portuguese')
|
||||
|
@ -1,47 +1,47 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
jbonline.terra.com.br
|
||||
'''
|
||||
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
jbonline.terra.com.br
|
||||
'''
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class JBOnline(BasicNewsRecipe):
|
||||
title = 'Jornal Brasileiro Online'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'News from Brasil'
|
||||
publisher = 'Jornal Brasileiro'
|
||||
category = 'news, politics, Brasil'
|
||||
oldest_article = 2
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
encoding = 'cp1252'
|
||||
cover_url = 'http://jbonline.terra.com.br/img/logo_01.gif'
|
||||
remove_javascript = True
|
||||
|
||||
html2lrf_options = [
|
||||
class JBOnline(BasicNewsRecipe):
|
||||
title = 'Jornal Brasileiro Online'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'News from Brasil'
|
||||
publisher = 'Jornal Brasileiro'
|
||||
category = 'news, politics, Brasil'
|
||||
oldest_article = 2
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
encoding = 'cp1252'
|
||||
cover_url = 'http://jbonline.terra.com.br/img/logo_01.gif'
|
||||
remove_javascript = True
|
||||
|
||||
html2lrf_options = [
|
||||
'--comment', description
|
||||
, '--category', category
|
||||
, '--publisher', publisher
|
||||
]
|
||||
|
||||
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
|
||||
|
||||
keep_only_tags = [dict(name='div', attrs={'id':'corpoNoticia'})]
|
||||
|
||||
remove_tags = [dict(name=['script','object','form'])]
|
||||
|
||||
feeds = [(u'Todos as editorias', u'http://jbonline.terra.com.br/extra/rsstrjb.xml')]
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
ifr = soup.find('iframe')
|
||||
if ifr:
|
||||
ifr.extract()
|
||||
for item in soup.findAll(style=True):
|
||||
del item['style']
|
||||
return soup
|
||||
|
||||
language = _('Portugese')
|
||||
, '--category', category
|
||||
, '--publisher', publisher
|
||||
]
|
||||
|
||||
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
|
||||
|
||||
keep_only_tags = [dict(name='div', attrs={'id':'corpoNoticia'})]
|
||||
|
||||
remove_tags = [dict(name=['script','object','form'])]
|
||||
|
||||
feeds = [(u'Todos as editorias', u'http://jbonline.terra.com.br/extra/rsstrjb.xml')]
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
ifr = soup.find('iframe')
|
||||
if ifr:
|
||||
ifr.extract()
|
||||
for item in soup.findAll(style=True):
|
||||
del item['style']
|
||||
return soup
|
||||
|
||||
language = _('Portuguese')
|
||||
|
@ -1,69 +1,69 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
oglobo.globo.com
|
||||
'''
|
||||
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
oglobo.globo.com
|
||||
'''
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class OGlobo(BasicNewsRecipe):
|
||||
title = 'O Globo'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'News from Brasil'
|
||||
publisher = 'O Globo'
|
||||
category = 'news, politics, Brasil'
|
||||
oldest_article = 2
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
encoding = 'cp1252'
|
||||
cover_url = 'http://oglobo.globo.com/_img/o-globo.png'
|
||||
remove_javascript = True
|
||||
|
||||
html2lrf_options = [
|
||||
class OGlobo(BasicNewsRecipe):
|
||||
title = 'O Globo'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'News from Brasil'
|
||||
publisher = 'O Globo'
|
||||
category = 'news, politics, Brasil'
|
||||
oldest_article = 2
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
encoding = 'cp1252'
|
||||
cover_url = 'http://oglobo.globo.com/_img/o-globo.png'
|
||||
remove_javascript = True
|
||||
|
||||
html2lrf_options = [
|
||||
'--comment', description
|
||||
, '--category', category
|
||||
, '--publisher', publisher
|
||||
]
|
||||
|
||||
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
|
||||
|
||||
keep_only_tags = [dict(name='div', attrs={'id':'ltintb'})]
|
||||
|
||||
remove_tags = [
|
||||
dict(name='script')
|
||||
,dict(name='object')
|
||||
,dict(name='form')
|
||||
,dict(name='div', attrs={'id':['linksPatGoogle','rdpm','cor','com','env','rcm_st']})
|
||||
,dict(name='div', attrs={'class':'box-zap-anu2'})
|
||||
,dict(name='a')
|
||||
,dict(name='link')
|
||||
]
|
||||
|
||||
|
||||
feeds = [
|
||||
(u'Todos os canais', u'http://oglobo.globo.com/rss/plantao.xml')
|
||||
,(u'Ciencia', u'http://oglobo.globo.com/rss/plantaociencia.xml')
|
||||
,(u'Educacao', u'http://oglobo.globo.com/rss/plantaoeducacao.xml')
|
||||
,(u'Opiniao', u'http://oglobo.globo.com/rss/plantaoopiniao.xml')
|
||||
,(u'Sao Paulo', u'http://oglobo.globo.com/rss/plantaosaopaulo.xml')
|
||||
,(u'Viagem', u'http://oglobo.globo.com/rss/plantaoviagem.xml')
|
||||
,(u'Cultura', u'http://oglobo.globo.com/rss/plantaocultura.xml')
|
||||
,(u'Esportes', u'http://oglobo.globo.com/rss/plantaoesportes.xml')
|
||||
,(u'Mundo', u'http://oglobo.globo.com/rss/plantaomundo.xml')
|
||||
,(u'Pais', u'http://oglobo.globo.com/rss/plantaopais.xml')
|
||||
,(u'Rio', u'http://oglobo.globo.com/rss/plantaorio.xml')
|
||||
,(u'Saude', u'http://oglobo.globo.com/rss/plantaosaude.xml')
|
||||
,(u'Viver Melhor', u'http://oglobo.globo.com/rss/plantaovivermelhor.xml')
|
||||
,(u'Economia', u'http://oglobo.globo.com/rss/plantaoeconomia.xml')
|
||||
,(u'Tecnologia', u'http://oglobo.globo.com/rss/plantaotecnologia.xml')
|
||||
]
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for item in soup.findAll(style=True):
|
||||
del item['style']
|
||||
return soup
|
||||
|
||||
language = _('Portugese')
|
||||
, '--category', category
|
||||
, '--publisher', publisher
|
||||
]
|
||||
|
||||
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
|
||||
|
||||
keep_only_tags = [dict(name='div', attrs={'id':'ltintb'})]
|
||||
|
||||
remove_tags = [
|
||||
dict(name='script')
|
||||
,dict(name='object')
|
||||
,dict(name='form')
|
||||
,dict(name='div', attrs={'id':['linksPatGoogle','rdpm','cor','com','env','rcm_st']})
|
||||
,dict(name='div', attrs={'class':'box-zap-anu2'})
|
||||
,dict(name='a')
|
||||
,dict(name='link')
|
||||
]
|
||||
|
||||
|
||||
feeds = [
|
||||
(u'Todos os canais', u'http://oglobo.globo.com/rss/plantao.xml')
|
||||
,(u'Ciencia', u'http://oglobo.globo.com/rss/plantaociencia.xml')
|
||||
,(u'Educacao', u'http://oglobo.globo.com/rss/plantaoeducacao.xml')
|
||||
,(u'Opiniao', u'http://oglobo.globo.com/rss/plantaoopiniao.xml')
|
||||
,(u'Sao Paulo', u'http://oglobo.globo.com/rss/plantaosaopaulo.xml')
|
||||
,(u'Viagem', u'http://oglobo.globo.com/rss/plantaoviagem.xml')
|
||||
,(u'Cultura', u'http://oglobo.globo.com/rss/plantaocultura.xml')
|
||||
,(u'Esportes', u'http://oglobo.globo.com/rss/plantaoesportes.xml')
|
||||
,(u'Mundo', u'http://oglobo.globo.com/rss/plantaomundo.xml')
|
||||
,(u'Pais', u'http://oglobo.globo.com/rss/plantaopais.xml')
|
||||
,(u'Rio', u'http://oglobo.globo.com/rss/plantaorio.xml')
|
||||
,(u'Saude', u'http://oglobo.globo.com/rss/plantaosaude.xml')
|
||||
,(u'Viver Melhor', u'http://oglobo.globo.com/rss/plantaovivermelhor.xml')
|
||||
,(u'Economia', u'http://oglobo.globo.com/rss/plantaoeconomia.xml')
|
||||
,(u'Tecnologia', u'http://oglobo.globo.com/rss/plantaotecnologia.xml')
|
||||
]
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for item in soup.findAll(style=True):
|
||||
del item['style']
|
||||
return soup
|
||||
|
||||
language = _('Portuguese')
|
||||
|
@ -11,23 +11,23 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
import re
|
||||
|
||||
class Publico(BasicNewsRecipe):
|
||||
title = u'P\xc3\xbablico'
|
||||
title = u'P\xfablico'
|
||||
__author__ = 'David Rodrigues'
|
||||
oldest_article = 1
|
||||
max_articles_per_feed = 30
|
||||
encoding='utf-8'
|
||||
no_stylesheets = True
|
||||
language = _('Portugese')
|
||||
language = _('Portuguese')
|
||||
preprocess_regexps = [(re.compile(u"\uFFFD", re.DOTALL|re.IGNORECASE), lambda match: ''),]
|
||||
|
||||
feeds = [
|
||||
(u'Geral', u'http://feeds.feedburner.com/PublicoUltimaHora'),
|
||||
(u'Internacional', u'http://www.publico.clix.pt/rss.ashx?idCanal=11'),
|
||||
(u'Pol\xc3\xadtica', u'http://www.publico.clix.pt/rss.ashx?idCanal=12'),
|
||||
(u'Ci\xc3\xaancias', u'http://www.publico.clix.pt/rss.ashx?idCanal=13'),
|
||||
(u'Pol\xedtica', u'http://www.publico.clix.pt/rss.ashx?idCanal=12'),
|
||||
(u'Ci\xcencias', u'http://www.publico.clix.pt/rss.ashx?idCanal=13'),
|
||||
(u'Desporto', u'http://desporto.publico.pt/rss.ashx'),
|
||||
(u'Economia', u'http://www.publico.clix.pt/rss.ashx?idCanal=57'),
|
||||
(u'Educa\xc3\xa7\xc3\xa3o', u'http://www.publico.clix.pt/rss.ashx?idCanal=58'),
|
||||
(u'Educa\xe7\xe3o', u'http://www.publico.clix.pt/rss.ashx?idCanal=58'),
|
||||
(u'Local', u'http://www.publico.clix.pt/rss.ashx?idCanal=59'),
|
||||
(u'Media e Tecnologia', u'http://www.publico.clix.pt/rss.ashx?idCanal=61'),
|
||||
(u'Sociedade', u'http://www.publico.clix.pt/rss.ashx?idCanal=62')
|
||||
|
Loading…
x
Reference in New Issue
Block a user