mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from trunk
This commit is contained in:
commit
fa79c23cd1
@ -217,7 +217,6 @@ class ChooseLibraryAction(InterfaceAction):
|
|||||||
def backup_status(self, location):
|
def backup_status(self, location):
|
||||||
dirty_text = 'no'
|
dirty_text = 'no'
|
||||||
try:
|
try:
|
||||||
print 'here'
|
|
||||||
dirty_text = \
|
dirty_text = \
|
||||||
unicode(self.gui.library_view.model().db.dirty_queue_length())
|
unicode(self.gui.library_view.model().db.dirty_queue_length())
|
||||||
except:
|
except:
|
||||||
|
@ -82,8 +82,9 @@ class MyBlockingBusy(QDialog):
|
|||||||
self.db.commit()
|
self.db.commit()
|
||||||
return self.accept()
|
return self.accept()
|
||||||
id = self.ids[self.current_index]
|
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.msg.setText(self.msg_text.format(self.phases[self.current_phase],
|
||||||
(self.current_index*100)/len(self.ids)))
|
percent))
|
||||||
self.do_one(id)
|
self.do_one(id)
|
||||||
except Exception, err:
|
except Exception, err:
|
||||||
import traceback
|
import traceback
|
||||||
@ -168,6 +169,7 @@ class MyBlockingBusy(QDialog):
|
|||||||
self.current_index = len(self.ids)
|
self.current_index = len(self.ids)
|
||||||
elif self.current_phase == 4:
|
elif self.current_phase == 4:
|
||||||
self.s_r_func(id)
|
self.s_r_func(id)
|
||||||
|
self.current_index = len(self.ids)
|
||||||
# do the next one
|
# do the next one
|
||||||
self.current_index += 1
|
self.current_index += 1
|
||||||
self.do_one_signal.emit()
|
self.do_one_signal.emit()
|
||||||
@ -658,12 +660,6 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
|
|||||||
do_remove_conv, do_auto_author, series, do_series_restart,
|
do_remove_conv, do_auto_author, series, do_series_restart,
|
||||||
series_start_value, do_title_case, clear_series)
|
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}%%.')
|
bb = MyBlockingBusy(_('Applying changes to %d books.\nPhase {0} {1}%%.')
|
||||||
%len(self.ids), args, self.db, self.ids,
|
%len(self.ids), args, self.db, self.ids,
|
||||||
getattr(self, 'custom_column_widgets', []),
|
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
|
# which can slow down bulk editing of large numbers of books
|
||||||
self.model.stop_metadata_backup()
|
self.model.stop_metadata_backup()
|
||||||
try:
|
try:
|
||||||
# self.worker.start()
|
|
||||||
bb.exec_()
|
bb.exec_()
|
||||||
finally:
|
finally:
|
||||||
self.model.start_metadata_backup()
|
self.model.start_metadata_backup()
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Here you can change the metadata calibre uses to update a book when saving to disk or sending to device.
|
<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.
|
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.
|
||||||
|
|
||||||
|
@ -151,17 +151,26 @@ class CoverCache(Thread): # {{{
|
|||||||
ids.add(id_)
|
ids.add(id_)
|
||||||
except Empty:
|
except Empty:
|
||||||
pass
|
pass
|
||||||
|
except:
|
||||||
|
# Happens during shutdown
|
||||||
|
break
|
||||||
except Empty:
|
except Empty:
|
||||||
continue
|
continue
|
||||||
except:
|
except:
|
||||||
#Happens during interpreter shutdown
|
#Happens during interpreter shutdown
|
||||||
break
|
break
|
||||||
|
if not self.keep_running:
|
||||||
|
break
|
||||||
for id_ in ids:
|
for id_ in ids:
|
||||||
time.sleep(0.050) # Limit 20/second to not overwhelm the GUI
|
time.sleep(0.050) # Limit 20/second to not overwhelm the GUI
|
||||||
try:
|
try:
|
||||||
img = self._image_for_id(id_)
|
img = self._image_for_id(id_)
|
||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
try:
|
||||||
|
traceback.print_exc()
|
||||||
|
except:
|
||||||
|
# happens during shutdown
|
||||||
|
break
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
with self.lock:
|
with self.lock:
|
||||||
|
@ -528,11 +528,6 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
|||||||
try:
|
try:
|
||||||
f = open(path, 'rb')
|
f = open(path, 'rb')
|
||||||
except (IOError, OSError):
|
except (IOError, OSError):
|
||||||
try:
|
|
||||||
f.close()
|
|
||||||
print 'cover exception left file open!', path
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
f = open(path, 'rb')
|
f = open(path, 'rb')
|
||||||
if as_image:
|
if as_image:
|
||||||
|
@ -17,7 +17,7 @@ from calibre.ebooks.metadata.meta import set_metadata
|
|||||||
from calibre.constants import preferred_encoding, filesystem_encoding
|
from calibre.constants import preferred_encoding, filesystem_encoding
|
||||||
from calibre.ebooks.metadata import fmt_sidx
|
from calibre.ebooks.metadata import fmt_sidx
|
||||||
from calibre.ebooks.metadata import title_sort
|
from calibre.ebooks.metadata import title_sort
|
||||||
from calibre import strftime, prints
|
from calibre import strftime
|
||||||
|
|
||||||
plugboard_any_device_value = 'any device'
|
plugboard_any_device_value = 'any device'
|
||||||
plugboard_any_format_value = 'any format'
|
plugboard_any_format_value = 'any format'
|
||||||
@ -259,7 +259,7 @@ def save_book_to_disk(id, db, root, opts, length):
|
|||||||
cpb = cpb[dev_name]
|
cpb = cpb[dev_name]
|
||||||
else:
|
else:
|
||||||
cpb = None
|
cpb = None
|
||||||
prints('Using plugboard:', fmt, cpb)
|
#prints('Using plugboard:', fmt, cpb)
|
||||||
data = db.format(id, fmt, index_is_id=True)
|
data = db.format(id, fmt, index_is_id=True)
|
||||||
if data is None:
|
if data is None:
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user