From efd5eefa0f96b94f05bc140219e980908b6f7a9e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 21 Aug 2019 19:45:27 +0530 Subject: [PATCH] Micro-optimization --- src/calibre/gui2/actions/add_to_library.py | 2 +- src/calibre/gui2/actions/annotate.py | 2 +- src/calibre/gui2/actions/catalog.py | 2 +- src/calibre/gui2/actions/choose_library.py | 2 +- src/calibre/gui2/actions/convert.py | 2 +- src/calibre/gui2/actions/device.py | 4 ++-- src/calibre/gui2/actions/edit_collections.py | 2 +- src/calibre/gui2/actions/next_match.py | 2 +- src/calibre/gui2/actions/open.py | 2 +- src/calibre/gui2/actions/show_book_details.py | 2 +- src/calibre/gui2/actions/show_quickview.py | 2 +- src/calibre/gui2/actions/show_template_tester.py | 2 +- src/calibre/gui2/actions/tweak_epub.py | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/calibre/gui2/actions/add_to_library.py b/src/calibre/gui2/actions/add_to_library.py index 21e984b89f..038c503bfb 100644 --- a/src/calibre/gui2/actions/add_to_library.py +++ b/src/calibre/gui2/actions/add_to_library.py @@ -15,7 +15,7 @@ class AddToLibraryAction(InterfaceAction): action_spec = (_('Add books to library'), 'add_book.png', _('Add books to your calibre library from the connected device'), ()) - dont_add_to = frozenset(['menubar', 'toolbar', 'context-menu', 'toolbar-child']) + dont_add_to = frozenset(('menubar', 'toolbar', 'context-menu', 'toolbar-child')) action_type = 'current' def genesis(self): diff --git a/src/calibre/gui2/actions/annotate.py b/src/calibre/gui2/actions/annotate.py index 224de0ced9..c1c38097a2 100644 --- a/src/calibre/gui2/actions/annotate.py +++ b/src/calibre/gui2/actions/annotate.py @@ -65,7 +65,7 @@ class FetchAnnotationsAction(InterfaceAction): name = 'Fetch Annotations' action_spec = (_('Fetch annotations (experimental)'), None, None, ()) - dont_add_to = frozenset(['menubar', 'toolbar', 'context-menu', 'toolbar-child']) + dont_add_to = frozenset(('menubar', 'toolbar', 'context-menu', 'toolbar-child')) action_type = 'current' def genesis(self): diff --git a/src/calibre/gui2/actions/catalog.py b/src/calibre/gui2/actions/catalog.py index 0c6144e645..5165ab7800 100644 --- a/src/calibre/gui2/actions/catalog.py +++ b/src/calibre/gui2/actions/catalog.py @@ -23,7 +23,7 @@ class GenerateCatalogAction(InterfaceAction): name = 'Generate Catalog' action_spec = (_('Create catalog'), 'catalog.png', _('Create a catalog of the books in your calibre library in different formats'), ()) - dont_add_to = frozenset(['context-menu-device']) + dont_add_to = frozenset(('context-menu-device',)) def genesis(self): self.qaction.triggered.connect(self.generate_catalog) diff --git a/src/calibre/gui2/actions/choose_library.py b/src/calibre/gui2/actions/choose_library.py index cbf2410e79..098c5d2b64 100644 --- a/src/calibre/gui2/actions/choose_library.py +++ b/src/calibre/gui2/actions/choose_library.py @@ -206,7 +206,7 @@ class ChooseLibraryAction(InterfaceAction): name = 'Choose Library' action_spec = (_('Choose Library'), 'lt.png', _('Choose calibre library to work with'), None) - dont_add_to = frozenset(['context-menu-device']) + dont_add_to = frozenset(('context-menu-device',)) action_add_menu = True action_menu_clone_qaction = _('Switch/create library...') restore_view_state = pyqtSignal(object) diff --git a/src/calibre/gui2/actions/convert.py b/src/calibre/gui2/actions/convert.py index d464bdb679..f801b5c0fd 100644 --- a/src/calibre/gui2/actions/convert.py +++ b/src/calibre/gui2/actions/convert.py @@ -22,7 +22,7 @@ class ConvertAction(InterfaceAction): name = 'Convert Books' action_spec = (_('Convert books'), 'convert.png', _('Convert books between different e-book formats'), _('C')) - dont_add_to = frozenset(['context-menu-device']) + dont_add_to = frozenset(('context-menu-device',)) action_type = 'current' action_add_menu = True diff --git a/src/calibre/gui2/actions/device.py b/src/calibre/gui2/actions/device.py index 0898dc3f56..bb5cb73581 100644 --- a/src/calibre/gui2/actions/device.py +++ b/src/calibre/gui2/actions/device.py @@ -24,7 +24,7 @@ class ShareConnMenu(QMenu): # {{{ toggle_server = pyqtSignal() control_smartdevice = pyqtSignal() server_state_changed_signal = pyqtSignal(object, object) - dont_add_to = frozenset(['context-menu-device']) + dont_add_to = frozenset(('context-menu-device',)) DEVICE_MSGS = [_('Start wireless device connection'), _('Stop wireless device connection')] @@ -159,7 +159,7 @@ class SendToDeviceAction(InterfaceAction): name = 'Send To Device' action_spec = (_('Send to device'), 'sync.png', None, _('D')) - dont_add_to = frozenset(['menubar', 'toolbar', 'context-menu', 'toolbar-child']) + dont_add_to = frozenset(('menubar', 'toolbar', 'context-menu', 'toolbar-child')) def genesis(self): self.qaction.triggered.connect(self.do_sync) diff --git a/src/calibre/gui2/actions/edit_collections.py b/src/calibre/gui2/actions/edit_collections.py index eda832f8fa..9c84de395c 100644 --- a/src/calibre/gui2/actions/edit_collections.py +++ b/src/calibre/gui2/actions/edit_collections.py @@ -15,7 +15,7 @@ class EditCollectionsAction(InterfaceAction): name = 'Edit Collections' action_spec = (_('Manage collections'), None, _('Manage the collections on this device'), ()) - dont_add_to = frozenset(['menubar', 'toolbar', 'context-menu', 'toolbar-child']) + dont_add_to = frozenset(('menubar', 'toolbar', 'context-menu', 'toolbar-child')) action_type = 'current' def genesis(self): diff --git a/src/calibre/gui2/actions/next_match.py b/src/calibre/gui2/actions/next_match.py index 4e00dd2dbe..a47844a075 100644 --- a/src/calibre/gui2/actions/next_match.py +++ b/src/calibre/gui2/actions/next_match.py @@ -13,7 +13,7 @@ class NextMatchAction(InterfaceAction): name = 'Move to next highlighted book' action_spec = (_('Move to next match'), 'arrow-down.png', _('Move to next highlighted match'), [_('N'), _('F3')]) - dont_add_to = frozenset(['context-menu-device']) + dont_add_to = frozenset(('context-menu-device',)) action_type = 'current' def genesis(self): diff --git a/src/calibre/gui2/actions/open.py b/src/calibre/gui2/actions/open.py index 122c0eedce..4cb27c6711 100644 --- a/src/calibre/gui2/actions/open.py +++ b/src/calibre/gui2/actions/open.py @@ -15,7 +15,7 @@ class OpenFolderAction(InterfaceAction): name = 'Open Folder' action_spec = (_('Open containing folder'), 'document_open.png', _('Open the folder containing the current book\'s files'), _('O')) - dont_add_to = frozenset(['context-menu-device']) + dont_add_to = frozenset(('context-menu-device',)) action_type = 'current' def genesis(self): diff --git a/src/calibre/gui2/actions/show_book_details.py b/src/calibre/gui2/actions/show_book_details.py index 4d3c2d164c..1736a6fc9d 100644 --- a/src/calibre/gui2/actions/show_book_details.py +++ b/src/calibre/gui2/actions/show_book_details.py @@ -22,7 +22,7 @@ class ShowBookDetailsAction(InterfaceAction): name = 'Show Book Details' action_spec = (_('Show Book details'), 'dialog_information.png', _('Show the detailed metadata for the current book in a separate window'), _('I')) - dont_add_to = frozenset(['context-menu-device']) + dont_add_to = frozenset(('context-menu-device',)) action_type = 'current' def genesis(self): diff --git a/src/calibre/gui2/actions/show_quickview.py b/src/calibre/gui2/actions/show_quickview.py index 28ce9aaf52..8dc8d1ef36 100644 --- a/src/calibre/gui2/actions/show_quickview.py +++ b/src/calibre/gui2/actions/show_quickview.py @@ -61,7 +61,7 @@ class ShowQuickviewAction(InterfaceAction): name = 'Quickview' action_spec = (_('Quickview'), 'quickview.png', None, None) - dont_add_to = frozenset(['context-menu-device']) + dont_add_to = frozenset(('context-menu-device',)) action_type = 'current' current_instance = None diff --git a/src/calibre/gui2/actions/show_template_tester.py b/src/calibre/gui2/actions/show_template_tester.py index 08fc12c654..5e2d5382c5 100644 --- a/src/calibre/gui2/actions/show_template_tester.py +++ b/src/calibre/gui2/actions/show_template_tester.py @@ -16,7 +16,7 @@ class ShowTemplateTesterAction(InterfaceAction): name = 'Template tester' action_spec = (_('Template tester'), 'debug.png', None, ()) - dont_add_to = frozenset(['context-menu-device']) + dont_add_to = frozenset(('context-menu-device',)) action_type = 'current' def genesis(self): diff --git a/src/calibre/gui2/actions/tweak_epub.py b/src/calibre/gui2/actions/tweak_epub.py index 970e0551f9..b8cfd8b1ce 100644 --- a/src/calibre/gui2/actions/tweak_epub.py +++ b/src/calibre/gui2/actions/tweak_epub.py @@ -57,7 +57,7 @@ class TweakEpubAction(InterfaceAction): name = 'Tweak ePub' action_spec = (_('Edit book'), 'edit_book.png', _('Edit books in the EPUB or AZW formats'), _('T')) - dont_add_to = frozenset(['context-menu-device']) + dont_add_to = frozenset(('context-menu-device',)) action_type = 'current' accepts_drops = True