Merge from trunk

This commit is contained in:
Charles Haley 2010-09-29 19:02:42 +01:00
commit fa79c23cd1
6 changed files with 16 additions and 18 deletions

View File

@ -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:

View File

@ -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()

View File

@ -19,7 +19,7 @@
<property name="text">
<string>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.

View File

@ -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:
try:
traceback.print_exc()
except:
# happens during shutdown
break
continue
try:
with self.lock:

View File

@ -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:

View File

@ -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