This commit is contained in:
Kovid Goyal 2021-05-16 21:25:27 +05:30
commit 7ec12f17a3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -457,7 +457,9 @@ class MyBlockingBusy(QDialog): # {{{
if self.do_sr: if self.do_sr:
self.progress_next_step_range.emit(len(self.ids)) self.progress_next_step_range.emit(len(self.ids))
for book_id in self.ids: for book_id in self.ids:
self.s_r_func(book_id) ans = self.s_r_func(book_id)
if isinstance(ans, bool) and not ans:
break
self.progress_update.emit(1) self.progress_update.emit(1)
if self.sr_calls: if self.sr_calls:
self.progress_next_step_range.emit(len(self.sr_calls)) self.progress_next_step_range.emit(len(self.sr_calls))
@ -1066,11 +1068,18 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
val = ids val = ids
else: else:
try: try:
val = dict(t.split(':', 1) for t in val) val = dict([(t.split(':', maxsplit=1)) for t in val])
except Exception: except:
raise Exception(_('Invalid identifier string. It must be a ' import traceback
'comma-separated list of pairs of ' ans = question_dialog(self, _('Invalid identifier string'),
'strings separated by a colon')) _('The identifier string for book "{0}" (id {1}) is '
'invalid. It must be a comma-separated list of '
'pairs of strings separated by a colon.\n\n'
'Do you want to continue processing books?').format(mi.title, mi.id),
det_msg='\n'.join([_('Result identifier string: '),
', '.join(val), '-----', traceback.format_exc()]),
show_copy_button=True)
return ans
else: else:
val = self.s_r_replace_mode_separator().join(val) val = self.s_r_replace_mode_separator().join(val)
if dest == 'title' and len(val) == 0: if dest == 'title' and len(val) == 0: