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