Forgot to stub out one method for the test

This commit is contained in:
Kovid Goyal 2024-01-25 14:18:09 +05:30
parent cd30de3727
commit d6e55f72c0
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 8 additions and 5 deletions

View file

@ -69,11 +69,7 @@ def __init__(self, global_shortcuts:Optional[Dict[str, SingleKey]] = None) -> No
def update_keymap(self, global_shortcuts:Optional[Dict[str, SingleKey]] = None) -> None:
if global_shortcuts is None:
if is_macos:
from .main import set_cocoa_global_shortcuts
global_shortcuts = set_cocoa_global_shortcuts(self.get_options())
else:
global_shortcuts = {}
global_shortcuts = self.set_cocoa_global_shortcuts(self.get_options()) if is_macos else {}
self.global_shortcuts_map: KeyMap = {v: [KeyDefinition(definition=k)] for k, v in global_shortcuts.items()}
self.global_shortcuts = global_shortcuts
self.keyboard_modes = self.get_options().keyboard_modes.copy()
@ -224,4 +220,8 @@ def debug_print(self, *args: Any, end: str = '\n') -> None:
b = get_boss()
if b.args.debug_keyboard:
print(*args, end=end, flush=True)
def set_cocoa_global_shortcuts(self, opts: Options) -> Dict[str, SingleKey]:
from .main import set_cocoa_global_shortcuts
return set_cocoa_global_shortcuts(opts)
# }}}

View file

@ -553,6 +553,9 @@ def combine(self, action_definition: str) -> bool:
def set_ignore_os_keyboard_processing(self, on: bool) -> None:
pass
def set_cocoa_global_shortcuts(self, opts):
return {}
def get_options(self):
return self.options