mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 03:35:17 +02:00
GwR fix for progress bar overrun
This commit is contained in:
parent
99af4d355c
commit
bce755020b
1 changed files with 12 additions and 7 deletions
|
|
@ -349,7 +349,7 @@ def add_books_to_metadata(self, locations, metadata, booklists):
|
|||
break
|
||||
break
|
||||
if self.report_progress is not None:
|
||||
self.report_progress(j+1/task_count, _('Updating device metadata listing...'))
|
||||
self.report_progress((j+1)/task_count, _('Updating device metadata listing...'))
|
||||
|
||||
if self.report_progress is not None:
|
||||
self.report_progress(1.0, _('Updating device metadata listing...'))
|
||||
|
|
@ -428,7 +428,7 @@ def books(self, oncard=None, end_session=True):
|
|||
}
|
||||
|
||||
if self.report_progress is not None:
|
||||
self.report_progress(i+1/book_count, _('%d of %d') % (i+1, book_count))
|
||||
self.report_progress((i+1)/book_count, _('%d of %d') % (i+1, book_count))
|
||||
self._purge_orphans(library_books, cached_books)
|
||||
|
||||
elif iswindows:
|
||||
|
|
@ -466,7 +466,7 @@ def books(self, oncard=None, end_session=True):
|
|||
}
|
||||
|
||||
if self.report_progress is not None:
|
||||
self.report_progress(i+1/book_count,
|
||||
self.report_progress((i+1)/book_count,
|
||||
_('%d of %d') % (i+1, book_count))
|
||||
self._purge_orphans(library_books, cached_books)
|
||||
|
||||
|
|
@ -916,6 +916,8 @@ def reset(self, key='-1', log_packets=False, report_progress=None,
|
|||
"""
|
||||
if DEBUG:
|
||||
self.log.info("ITUNES.reset()")
|
||||
if report_progress:
|
||||
self.set_progress_reporter(report_progress)
|
||||
|
||||
def set_progress_reporter(self, report_progress):
|
||||
'''
|
||||
|
|
@ -924,6 +926,9 @@ def set_progress_reporter(self, report_progress):
|
|||
If it is called with -1 that means that the
|
||||
task does not have any progress information
|
||||
'''
|
||||
if DEBUG:
|
||||
self.log.info("ITUNES.set_progress_reporter()")
|
||||
|
||||
self.report_progress = report_progress
|
||||
|
||||
def set_plugboards(self, plugboards, pb_func):
|
||||
|
|
@ -1041,7 +1046,7 @@ def upload_books(self, files, names, on_card=None, end_session=True,
|
|||
|
||||
# Report progress
|
||||
if self.report_progress is not None:
|
||||
self.report_progress(i+1/file_count, _('%d of %d') % (i+1, file_count))
|
||||
self.report_progress((i+1)/file_count, _('%d of %d') % (i+1, file_count))
|
||||
|
||||
elif iswindows:
|
||||
try:
|
||||
|
|
@ -1081,7 +1086,7 @@ def upload_books(self, files, names, on_card=None, end_session=True,
|
|||
|
||||
# Report progress
|
||||
if self.report_progress is not None:
|
||||
self.report_progress(i+1/file_count, _('%d of %d') % (i+1, file_count))
|
||||
self.report_progress((i+1)/file_count, _('%d of %d') % (i+1, file_count))
|
||||
finally:
|
||||
pythoncom.CoUninitialize()
|
||||
|
||||
|
|
@ -3065,7 +3070,7 @@ def books(self, oncard=None, end_session=True):
|
|||
}
|
||||
|
||||
if self.report_progress is not None:
|
||||
self.report_progress(i+1/book_count, _('%d of %d') % (i+1, book_count))
|
||||
self.report_progress((i+1)/book_count, _('%d of %d') % (i+1, book_count))
|
||||
|
||||
elif iswindows:
|
||||
try:
|
||||
|
|
@ -3104,7 +3109,7 @@ def books(self, oncard=None, end_session=True):
|
|||
}
|
||||
|
||||
if self.report_progress is not None:
|
||||
self.report_progress(i+1/book_count,
|
||||
self.report_progress((i+1)/book_count,
|
||||
_('%d of %d') % (i+1, book_count))
|
||||
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Reference in a new issue