Don't fail on downloading all remaining covers if there is an error downloading a single cover in the list

This commit is contained in:
Kovid Goyal 2009-11-12 09:26:19 -07:00
parent cf096585e6
commit de6541ebe3
3 changed files with 10 additions and 5 deletions

View File

@ -15,7 +15,7 @@ class weltDe(BasicNewsRecipe):
__author__ = 'Oliver Niesner' __author__ = 'Oliver Niesner'
use_embedded_content = False use_embedded_content = False
timefmt = ' [%d %b %Y]' timefmt = ' [%d %b %Y]'
max_articles_per_feed = 25 # reduced to this value to prevent to many articles (suggested by Gregory Riker max_articles_per_feed = 15 # reduced to this value to prevent too many articles (suggested by Gregory Riker
no_stylesheets = True no_stylesheets = True
remove_stylesheets = True remove_stylesheets = True
remove_javascript = True remove_javascript = True

View File

@ -1046,7 +1046,8 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
_('Downloading %s for %d book(s)')%(x, len(ids))) _('Downloading %s for %d book(s)')%(x, len(ids)))
self._book_metadata_download_check = QTimer(self) self._book_metadata_download_check = QTimer(self)
self.connect(self._book_metadata_download_check, self.connect(self._book_metadata_download_check,
SIGNAL('timeout()'), self.book_metadata_download_check) SIGNAL('timeout()'), self.book_metadata_download_check,
Qt.QueuedConnection)
self._book_metadata_download_check.start(100) self._book_metadata_download_check.start(100)
def book_metadata_download_check(self): def book_metadata_download_check(self):

View File

@ -6,6 +6,7 @@ __license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en' __docformat__ = 'restructuredtext en'
import traceback
from threading import Thread from threading import Thread
from Queue import Queue, Empty from Queue import Queue, Empty
@ -27,9 +28,12 @@ class Worker(Thread):
isbn = self.jobs.get() isbn = self.jobs.get()
if not isbn: if not isbn:
break break
cdata, _ = cover_from_isbn(isbn) try:
if cdata: cdata, _ = cover_from_isbn(isbn)
self.results.put((isbn, cdata)) if cdata:
self.results.put((isbn, cdata))
except:
traceback.print_exc()
def __enter__(self): def __enter__(self):
self.start() self.start()