diff --git a/src/calibre/gui2/actions/choose_library.py b/src/calibre/gui2/actions/choose_library.py index d3045fecf4..2f8beab976 100644 --- a/src/calibre/gui2/actions/choose_library.py +++ b/src/calibre/gui2/actions/choose_library.py @@ -217,7 +217,6 @@ class ChooseLibraryAction(InterfaceAction): def backup_status(self, location): dirty_text = 'no' try: - print 'here' dirty_text = \ unicode(self.gui.library_view.model().db.dirty_queue_length()) except: diff --git a/src/calibre/gui2/dialogs/metadata_bulk.py b/src/calibre/gui2/dialogs/metadata_bulk.py index 4fc85f2b30..347ed36d7c 100644 --- a/src/calibre/gui2/dialogs/metadata_bulk.py +++ b/src/calibre/gui2/dialogs/metadata_bulk.py @@ -82,8 +82,9 @@ class MyBlockingBusy(QDialog): self.db.commit() return self.accept() id = self.ids[self.current_index] + percent = int((self.current_index*100)/float(len(self.ids))) self.msg.setText(self.msg_text.format(self.phases[self.current_phase], - (self.current_index*100)/len(self.ids))) + percent)) self.do_one(id) except Exception, err: import traceback @@ -168,6 +169,7 @@ class MyBlockingBusy(QDialog): self.current_index = len(self.ids) elif self.current_phase == 4: self.s_r_func(id) + self.current_index = len(self.ids) # do the next one self.current_index += 1 self.do_one_signal.emit() @@ -658,12 +660,6 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog): do_remove_conv, do_auto_author, series, do_series_restart, series_start_value, do_title_case, clear_series) -# bb = BlockingBusy(_('Applying changes to %d books. This may take a while.') -# %len(self.ids), parent=self) -# self.worker = Worker(args, self.db, self.ids, -# getattr(self, 'custom_column_widgets', []), -# Dispatcher(bb.accept, parent=bb)) - bb = MyBlockingBusy(_('Applying changes to %d books.\nPhase {0} {1}%%.') %len(self.ids), args, self.db, self.ids, getattr(self, 'custom_column_widgets', []), @@ -673,7 +669,6 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog): # which can slow down bulk editing of large numbers of books self.model.stop_metadata_backup() try: -# self.worker.start() bb.exec_() finally: self.model.start_metadata_backup() diff --git a/src/calibre/gui2/preferences/plugboard.ui b/src/calibre/gui2/preferences/plugboard.ui index efe500aebd..6329a78ce1 100644 --- a/src/calibre/gui2/preferences/plugboard.ui +++ b/src/calibre/gui2/preferences/plugboard.ui @@ -19,7 +19,7 @@ Here you can change the metadata calibre uses to update a book when saving to disk or sending to device. -Use this dialog to define a 'plugboard' for for a format (or all formats) and a device (or all devices). The plugboard spefies what template is connected to what field. The template is used to find compute a value, and that value is assigned to the connected field. +Use this dialog to define a 'plugboard' for for a format (or all formats) and a device (or all devices). The plugboard spefies what template is connected to what field. The template is used to compute a value, and that value is assigned to the connected field. Often templates will contain simple references to composite columns, but this is not necessary. You can use any template in a source box that you can use elsewhere in calibre. diff --git a/src/calibre/library/caches.py b/src/calibre/library/caches.py index 42720c5e83..0c3904532e 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -151,17 +151,26 @@ class CoverCache(Thread): # {{{ ids.add(id_) except Empty: pass + except: + # Happens during shutdown + break except Empty: continue except: #Happens during interpreter shutdown break + if not self.keep_running: + break for id_ in ids: time.sleep(0.050) # Limit 20/second to not overwhelm the GUI try: img = self._image_for_id(id_) except: - traceback.print_exc() + try: + traceback.print_exc() + except: + # happens during shutdown + break continue try: with self.lock: diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index 85fb955448..08dd74af29 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -528,11 +528,6 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns): try: f = open(path, 'rb') except (IOError, OSError): - try: - f.close() - print 'cover exception left file open!', path - except: - pass time.sleep(0.2) f = open(path, 'rb') if as_image: diff --git a/src/calibre/library/save_to_disk.py b/src/calibre/library/save_to_disk.py index 113ebf823a..afeb5ee0b9 100644 --- a/src/calibre/library/save_to_disk.py +++ b/src/calibre/library/save_to_disk.py @@ -17,7 +17,7 @@ from calibre.ebooks.metadata.meta import set_metadata from calibre.constants import preferred_encoding, filesystem_encoding from calibre.ebooks.metadata import fmt_sidx from calibre.ebooks.metadata import title_sort -from calibre import strftime, prints +from calibre import strftime plugboard_any_device_value = 'any device' plugboard_any_format_value = 'any format' @@ -259,7 +259,7 @@ def save_book_to_disk(id, db, root, opts, length): cpb = cpb[dev_name] else: cpb = None - prints('Using plugboard:', fmt, cpb) + #prints('Using plugboard:', fmt, cpb) data = db.format(id, fmt, index_is_id=True) if data is None: continue