This commit is contained in:
Kovid Goyal 2014-11-28 23:35:34 +05:30
parent b6d78b69c7
commit bd7bba7fae

View File

@ -54,11 +54,6 @@ def finalize(shortcuts, custom_keys_map={}): # {{{
''' '''
seen, keys_map = {}, {} seen, keys_map = {}, {}
for unique_name, shortcut in shortcuts.iteritems(): for unique_name, shortcut in shortcuts.iteritems():
ac = shortcut['action']
if ac is None or sip.isdeleted(ac):
if ac is not None and DEBUG:
prints('Shortcut %r has a deleted action' % unique_name)
continue
custom_keys = custom_keys_map.get(unique_name, None) custom_keys = custom_keys_map.get(unique_name, None)
if custom_keys is None: if custom_keys is None:
candidates = shortcut['default_keys'] candidates = shortcut['default_keys']
@ -81,6 +76,11 @@ def finalize(shortcuts, custom_keys_map={}): # {{{
keys = tuple(keys) keys = tuple(keys)
keys_map[unique_name] = keys keys_map[unique_name] = keys
ac = shortcut['action']
if ac is None or sip.isdeleted(ac):
if ac is not None and DEBUG:
prints('Shortcut %r has a deleted action' % unique_name)
continue
ac.setShortcuts(list(keys)) ac.setShortcuts(list(keys))
return keys_map return keys_map