Cleanup previous PR

This commit is contained in:
Kovid Goyal 2023-02-19 19:08:48 +05:30
parent 916ec43250
commit 1ef455148a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 11 additions and 16 deletions

View File

@ -334,9 +334,8 @@ class FileTypePlugin(Plugin): # {{{
#: methods of the plugin are called.
on_postimport = False
#: If True, this plugin is run after a book file is added
#: to the database. In this case the postconvert method of
#: the plugin is called.
#: If True, this plugin is run after a book is converted.
#: In this case the postconvert method of the plugin is called.
on_postconvert = False
#: If True, this plugin is run after a book file is deleted
@ -390,8 +389,8 @@ class FileTypePlugin(Plugin): # {{{
def postconvert(self, book_id, book_format, db):
'''
Called post conversion, i.e., after the book file has been added to the database. Note that
it is run after a conversion only, not after a book is added. It is useful for modifying
Called post conversion, i.e., after the conversion output book file has been added to the database.
Note that it is run after a conversion only, not after a book is added. It is useful for modifying
the book record based on the contents of the newly added file.
:param book_id: Database id of the added book.

View File

@ -210,9 +210,8 @@ def run_plugins_on_postimport(db, book_id, fmt):
with plugin:
try:
plugin.postimport(book_id, fmt, db)
except:
print('Running file type plugin %s failed with traceback:'%
plugin.name)
except Exception:
print(f'Running file type plugin {plugin.name} failed with traceback:', file=sys.stderr)
traceback.print_exc()
@ -224,9 +223,8 @@ def run_plugins_on_postconvert(db, book_id, fmt):
with plugin:
try:
plugin.postconvert(book_id, fmt, db)
except:
print('Running file type plugin %s failed with traceback:'%
plugin.name)
except Exception:
print(f'Running file type plugin {plugin.name} failed with traceback:', file=sys.stderr)
traceback.print_exc()
@ -238,9 +236,8 @@ def run_plugins_on_postdelete(db, book_id, fmt):
with plugin:
try:
plugin.postdelete(book_id, fmt, db)
except:
print('Running file type plugin %s failed with traceback:'%
plugin.name)
except Exception:
print(f'Running file type plugin {plugin.name} failed with traceback:', file=sys.stderr)
traceback.print_exc()
@ -254,8 +251,7 @@ def run_plugins_on_postadd(db, book_id, fmt_map):
try:
plugin.postadd(book_id, fmt_map, db)
except Exception:
print('Running file type plugin %s failed with traceback:'%
plugin.name)
print(f'Running file type plugin {plugin.name} failed with traceback:', file=sys.stderr)
traceback.print_exc()
# }}}