From de6541ebe3ea80af59f1878a65d9b771959d2ccd Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 12 Nov 2009 09:26:19 -0700 Subject: [PATCH] Don't fail on downloading all remaining covers if there is an error downloading a single cover in the list --- resources/recipes/welt.recipe | 2 +- src/calibre/gui2/main.py | 3 ++- src/calibre/gui2/metadata.py | 10 +++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/resources/recipes/welt.recipe b/resources/recipes/welt.recipe index 6b3051bd32..b1bf20235d 100644 --- a/resources/recipes/welt.recipe +++ b/resources/recipes/welt.recipe @@ -15,7 +15,7 @@ class weltDe(BasicNewsRecipe): __author__ = 'Oliver Niesner' use_embedded_content = False 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 remove_stylesheets = True remove_javascript = True diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index 6b27140c76..78469905a8 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -1046,7 +1046,8 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI): _('Downloading %s for %d book(s)')%(x, len(ids))) self._book_metadata_download_check = QTimer(self) 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) def book_metadata_download_check(self): diff --git a/src/calibre/gui2/metadata.py b/src/calibre/gui2/metadata.py index adbc2bfb9a..106a42956b 100644 --- a/src/calibre/gui2/metadata.py +++ b/src/calibre/gui2/metadata.py @@ -6,6 +6,7 @@ __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal ' __docformat__ = 'restructuredtext en' +import traceback from threading import Thread from Queue import Queue, Empty @@ -27,9 +28,12 @@ class Worker(Thread): isbn = self.jobs.get() if not isbn: break - cdata, _ = cover_from_isbn(isbn) - if cdata: - self.results.put((isbn, cdata)) + try: + cdata, _ = cover_from_isbn(isbn) + if cdata: + self.results.put((isbn, cdata)) + except: + traceback.print_exc() def __enter__(self): self.start()