Fix #1241 (Could not convert Books)

This commit is contained in:
Kovid Goyal 2008-11-09 15:32:27 -08:00
parent f9c2956ada
commit 76eca156c6
3 changed files with 32 additions and 3 deletions

View File

@ -861,7 +861,10 @@ class Main(MainWindow, Ui_MainWindow):
return
comics, others = r
jobs, changed = convert_bulk_ebooks(self, self.library_view.model().db, comics, others)
res = convert_bulk_ebooks(self, self.library_view.model().db, comics, others)
if res is None:
return
jobs, changed = res
for func, args, desc, fmt, id, temp_files in jobs:
job = self.job_manager.run_job(Dispatcher(self.book_converted),
func, args=args, description=desc)

View File

@ -167,7 +167,8 @@ def convert_bulk_epub(parent, db, comics, others):
for fmt in EPUB_PREFERRED_SOURCE_FORMATS:
try:
data = db.format(row, fmt.upper())
break
if data is not None:
break
except:
continue
if data is None:
@ -269,7 +270,8 @@ def convert_bulk_lrf(parent, db, comics, others):
for fmt in LRF_PREFERRED_SOURCE_FORMATS:
try:
data = db.format(row, fmt.upper())
break
if data is not None:
break
except:
continue
if data is None:

View File

@ -0,0 +1,24 @@
#!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
'''
elpais.es
'''
from calibre.web.feeds.news import BasicNewsRecipe
class ElPais(BasicNewsRecipe):
title = u'EL PAIS'
oldest_article = 7
max_articles_per_feed = 100
remove_tags = [dict(name='div', attrs={'class':'zona_superior'}), dict(name='div', attrs={'class':'limpiar'}), dict(name='div', attrs={'id':'pie'})]
extra_css = 'h1 {font: sans-serif large;} \n h2 {font: sans-serif medium;} \n h3 {font: sans-serif small;} \n h4 {font: sans-serif bold small;} \n p{ font:10pt serif}'
feeds = [(u'Internacional', u'http://www.elpais.es/rss/rss_section.html?anchor=elpporint'), (u'Espana', u'http://www.elpais.es/rss/rss_section.html?anchor=elppornac'), (u'Deportes', u'http://www.elpais.es/rss/rss_section.html?anchor=elppordep'), (u'Economia', u'http://www.elpais.es/rss/rss_section.html?anchor=elpporeco'), (u'Tecnologia', u'http://www.elpais.es/rss/rss_section.html?anchor=elpportec'), (u'Cultura', u'http://www.elpais.es/rss/rss_section.html?anchor=elpporcul'), (u'Gente', u'http://www.elpais.es/rss/rss_section.html?anchor=elpporgen'), (u'Sociedad', u'http://www.elpais.es/rss/rss_section.html?anchor=elpporsoc'), (u'Opinion', u'http://www.elpais.es/rss/rss_section.html?anchor=elpporopi')]
def print_version(self, url):
url = url+'?print=1'
return url