mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
f755746194
commit
743ce97c9f
@ -260,8 +260,8 @@ class EditMetadataAction(InterfaceAction):
|
|||||||
from calibre.utils.icu import lower
|
from calibre.utils.icu import lower
|
||||||
|
|
||||||
modified = sorted(modified, key=lower)
|
modified = sorted(modified, key=lower)
|
||||||
if not question_dialog(self.gui, _('Some books changed'), '<p>'+
|
if not question_dialog(self.gui, _('Some books changed'), '<p>' + _(
|
||||||
_('The metadata for some books in your library has'
|
'The metadata for some books in your library has'
|
||||||
' changed since you started the download. If you'
|
' changed since you started the download. If you'
|
||||||
' proceed, some of those changes may be overwritten. '
|
' proceed, some of those changes may be overwritten. '
|
||||||
'Click "Show details" to see the list of changed books. '
|
'Click "Show details" to see the list of changed books. '
|
||||||
@ -496,9 +496,10 @@ class EditMetadataAction(InterfaceAction):
|
|||||||
_('At least two books must be selected for merging'),
|
_('At least two books must be selected for merging'),
|
||||||
show=True)
|
show=True)
|
||||||
if len(rows) > 5:
|
if len(rows) > 5:
|
||||||
if not confirm('<p>'+_('You are about to merge more than 5 books. '
|
if not confirm('<p>'+_(
|
||||||
'Are you <b>sure</b> you want to proceed?') +
|
'You are about to merge more than 5 books. '
|
||||||
'</p>', 'merge_too_many_books', self.gui):
|
'Are you <b>sure</b> you want to proceed?') + '</p>',
|
||||||
|
'merge_too_many_books', self.gui):
|
||||||
return
|
return
|
||||||
|
|
||||||
dest_id, src_ids = self.books_to_merge(rows)
|
dest_id, src_ids = self.books_to_merge(rows)
|
||||||
@ -511,8 +512,8 @@ class EditMetadataAction(InterfaceAction):
|
|||||||
'will be added to the <b>first selected book</b> (%s).<br> '
|
'will be added to the <b>first selected book</b> (%s).<br> '
|
||||||
'The second and subsequently selected books will not '
|
'The second and subsequently selected books will not '
|
||||||
'be deleted or changed.<br><br>'
|
'be deleted or changed.<br><br>'
|
||||||
'Please confirm you want to proceed.')%title +
|
'Please confirm you want to proceed.')%title + '</p>',
|
||||||
'</p>', 'merge_books_safe', self.gui, mi):
|
'merge_books_safe', self.gui, mi):
|
||||||
return
|
return
|
||||||
self.add_formats(dest_id, self.formats_for_books(rows))
|
self.add_formats(dest_id, self.formats_for_books(rows))
|
||||||
self.merge_metadata(dest_id, src_ids)
|
self.merge_metadata(dest_id, src_ids)
|
||||||
@ -527,8 +528,8 @@ class EditMetadataAction(InterfaceAction):
|
|||||||
'All book formats of the first selected book will be kept '
|
'All book formats of the first selected book will be kept '
|
||||||
'and any duplicate formats in the second and subsequently selected books '
|
'and any duplicate formats in the second and subsequently selected books '
|
||||||
'will be permanently <b>deleted</b> from your calibre library.<br><br> '
|
'will be permanently <b>deleted</b> from your calibre library.<br><br> '
|
||||||
'Are you <b>sure</b> you want to proceed?')%title +
|
'Are you <b>sure</b> you want to proceed?')%title + '</p>',
|
||||||
'</p>', 'merge_only_formats', self.gui, mi):
|
'merge_only_formats', self.gui, mi):
|
||||||
return
|
return
|
||||||
self.add_formats(dest_id, self.formats_for_books(rows))
|
self.add_formats(dest_id, self.formats_for_books(rows))
|
||||||
self.delete_books_after_merge(src_ids)
|
self.delete_books_after_merge(src_ids)
|
||||||
@ -541,8 +542,8 @@ class EditMetadataAction(InterfaceAction):
|
|||||||
'All book formats of the first selected book will be kept '
|
'All book formats of the first selected book will be kept '
|
||||||
'and any duplicate formats in the second and subsequently selected books '
|
'and any duplicate formats in the second and subsequently selected books '
|
||||||
'will be permanently <b>deleted</b> from your calibre library.<br><br> '
|
'will be permanently <b>deleted</b> from your calibre library.<br><br> '
|
||||||
'Are you <b>sure</b> you want to proceed?')%title +
|
'Are you <b>sure</b> you want to proceed?')%title + '</p>',
|
||||||
'</p>', 'merge_books', self.gui, mi):
|
'merge_books', self.gui, mi):
|
||||||
return
|
return
|
||||||
self.add_formats(dest_id, self.formats_for_books(rows))
|
self.add_formats(dest_id, self.formats_for_books(rows))
|
||||||
self.merge_metadata(dest_id, src_ids)
|
self.merge_metadata(dest_id, src_ids)
|
||||||
@ -613,11 +614,9 @@ class EditMetadataAction(InterfaceAction):
|
|||||||
dest_mi.comments = src_mi.comments
|
dest_mi.comments = src_mi.comments
|
||||||
else:
|
else:
|
||||||
dest_mi.comments = unicode(dest_mi.comments) + u'\n\n' + unicode(src_mi.comments)
|
dest_mi.comments = unicode(dest_mi.comments) + u'\n\n' + unicode(src_mi.comments)
|
||||||
if src_mi.title and (not dest_mi.title or
|
if src_mi.title and (not dest_mi.title or dest_mi.title == _('Unknown')):
|
||||||
dest_mi.title == _('Unknown')):
|
|
||||||
dest_mi.title = src_mi.title
|
dest_mi.title = src_mi.title
|
||||||
if src_mi.title and (not dest_mi.authors or dest_mi.authors[0] ==
|
if src_mi.title and (not dest_mi.authors or dest_mi.authors[0] == _('Unknown')):
|
||||||
_('Unknown')):
|
|
||||||
dest_mi.authors = src_mi.authors
|
dest_mi.authors = src_mi.authors
|
||||||
dest_mi.author_sort = src_mi.author_sort
|
dest_mi.author_sort = src_mi.author_sort
|
||||||
if src_mi.tags:
|
if src_mi.tags:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user