diff --git a/src/packages/menuhook/menuhook/__init__.py b/src/packages/menuhook/menuhook/__init__.py index a59ff0e..e9eaee3 100644 --- a/src/packages/menuhook/menuhook/__init__.py +++ b/src/packages/menuhook/menuhook/__init__.py @@ -111,7 +111,7 @@ def add_menu_item(menu, action, category): OTHER_SAMPLES = "CBB6F619-57B9-4C81-8135-41958BEF5BED" registered_items = [] -#pylint: disable=too-many-arguments +#pylint: disable=too-many-arguments, line-too-long def register(action, category, fcn, menu=None, text=None, tooltip=None, in2025_menuid=None, id_2025=None): """ Appends a menu item to one of the menus of the main menubar. @@ -135,7 +135,7 @@ def register(action, category, fcn, menu=None, text=None, tooltip=None, in2025_m add_macro(action, category, text or action, tooltip or action, fcn) if not defined and not menu is None: add_menu_item(menu, action, category) -#pylint: enable=too-many-arguments, line-too-long, broad-exception-caught +#pylint: enable=too-many-arguments, line-too-long # for 2025, pre-can a menu for the howtos def register_howtos_menu_2025(menumgr): @@ -157,7 +157,7 @@ def register_howtos_menu_2025(menumgr): python_development.createsubmenu( OTHER_SAMPLES, "Other Samples") - + # hook the registered items for reg in registered_items: (in2025_menuid, id_2025, category, action) = reg @@ -165,7 +165,9 @@ def register_howtos_menu_2025(menumgr): if scriptmenu is not None: try: scriptmenu.createaction(id_2025, 647394, f"{action}`{category}") + #pylint: disable=line-too-long, broad-exception-caught except Exception as e: print(f"Could not create item {category}, {action} in menu {in2025_menuid} because {e}") + #pylint: enable=line-too-long, broad-exception-caught else: print(f"Could not create item {category}, {action}, in missing menu {in2025_menuid}")