diff --git a/src/calibre/customize/__init__.py b/src/calibre/customize/__init__.py index 8f8c6ccf9c..3da9230dff 100644 --- a/src/calibre/customize/__init__.py +++ b/src/calibre/customize/__init__.py @@ -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. diff --git a/src/calibre/customize/ui.py b/src/calibre/customize/ui.py index c4f6d1995b..57d064f8f4 100644 --- a/src/calibre/customize/ui.py +++ b/src/calibre/customize/ui.py @@ -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() # }}}