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
2e8b8237e1
@ -565,9 +565,6 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, # {{{
|
|||||||
mb = self.library_view.model().metadata_backup
|
mb = self.library_view.model().metadata_backup
|
||||||
if mb is not None:
|
if mb is not None:
|
||||||
mb.stop()
|
mb.stop()
|
||||||
# give the thread time to stop so all operations complete
|
|
||||||
# otherwise the exit could kill the thread mid-write
|
|
||||||
time.sleep(2)
|
|
||||||
|
|
||||||
self.hide_windows()
|
self.hide_windows()
|
||||||
self.emailer.stop()
|
self.emailer.stop()
|
||||||
@ -579,9 +576,9 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, # {{{
|
|||||||
s.exit()
|
s.exit()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
time.sleep(2)
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
pass
|
||||||
|
time.sleep(2)
|
||||||
self.hide_windows()
|
self.hide_windows()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -573,8 +573,6 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
|||||||
The last step is clearing the indicator
|
The last step is clearing the indicator
|
||||||
'''
|
'''
|
||||||
for book_id in book_ids:
|
for book_id in book_ids:
|
||||||
if not self.data.has_id(book_id):
|
|
||||||
continue
|
|
||||||
self.conn.execute('DELETE FROM metadata_dirtied WHERE book=?',
|
self.conn.execute('DELETE FROM metadata_dirtied WHERE book=?',
|
||||||
(book_id,))
|
(book_id,))
|
||||||
# if a later exception prevents the commit, then the dirtied
|
# if a later exception prevents the commit, then the dirtied
|
||||||
@ -588,9 +586,6 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
|||||||
commit=True):
|
commit=True):
|
||||||
'''
|
'''
|
||||||
Write metadata for each record to an individual OPF file
|
Write metadata for each record to an individual OPF file
|
||||||
|
|
||||||
:param dump_to: None or list. If list then instead of writing to file,
|
|
||||||
data is append to list
|
|
||||||
'''
|
'''
|
||||||
if book_ids is None:
|
if book_ids is None:
|
||||||
book_ids = [x[0] for x in self.conn.get(
|
book_ids = [x[0] for x in self.conn.get(
|
||||||
@ -611,7 +606,6 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
|||||||
self.dirtied([book_id])
|
self.dirtied([book_id])
|
||||||
if commit:
|
if commit:
|
||||||
self.conn.commit()
|
self.conn.commit()
|
||||||
return True
|
|
||||||
|
|
||||||
def dirtied(self, book_ids, commit=True):
|
def dirtied(self, book_ids, commit=True):
|
||||||
for book in book_ids:
|
for book in book_ids:
|
||||||
@ -657,7 +651,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
|||||||
except:
|
except:
|
||||||
# This almost certainly means that the book has been deleted while
|
# This almost certainly means that the book has been deleted while
|
||||||
# the backup operation sat in the queue.
|
# the backup operation sat in the queue.
|
||||||
path,mi = (None, None)
|
path, mi = (None, None)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# clear the dirtied indicator. The user must put it back if
|
# clear the dirtied indicator. The user must put it back if
|
||||||
|
Loading…
x
Reference in New Issue
Block a user