mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Micro-optimization
This commit is contained in:
parent
7b936ee3ea
commit
efd5eefa0f
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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
|
||||
|
@ -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):
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user