From 751316c34465ea77e066c3052729b207f3d62e0c Mon Sep 17 00:00:00 2001 From: Zach White Date: Tue, 26 May 2020 13:05:41 -0700 Subject: [CLI] Add a subcommand for getting information about a keyboard (#8666) You can now use `qmk info` to get information about keyboards and keymaps. Co-authored-by: Erovia --- lib/python/qmk/decorators.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/python/qmk/decorators.py') diff --git a/lib/python/qmk/decorators.py b/lib/python/qmk/decorators.py index 94e14bf375..f8f2facb1c 100644 --- a/lib/python/qmk/decorators.py +++ b/lib/python/qmk/decorators.py @@ -5,7 +5,8 @@ from pathlib import Path from milc import cli -from qmk.path import is_keyboard, is_keymap_dir, under_qmk_firmware +from qmk.keymap import is_keymap_dir +from qmk.path import is_keyboard, under_qmk_firmware def automagic_keyboard(func): @@ -67,18 +68,18 @@ def automagic_keymap(func): while current_path.parent.name != 'keymaps': current_path = current_path.parent cli.config[cli._entrypoint.__name__]['keymap'] = current_path.name - cli.config_source[cli._entrypoint.__name__]['keyboard'] = 'keymap_directory' + cli.config_source[cli._entrypoint.__name__]['keymap'] = 'keymap_directory' # If we're in `qmk_firmware/layouts` guess the name from the community keymap they're in elif relative_cwd.parts[0] == 'layouts' and is_keymap_dir(relative_cwd): cli.config[cli._entrypoint.__name__]['keymap'] = relative_cwd.name - cli.config_source[cli._entrypoint.__name__]['keyboard'] = 'layouts_directory' + cli.config_source[cli._entrypoint.__name__]['keymap'] = 'layouts_directory' # If we're in `qmk_firmware/users` guess the name from the userspace they're in elif relative_cwd.parts[0] == 'users': # Guess the keymap name based on which userspace they're in cli.config[cli._entrypoint.__name__]['keymap'] = relative_cwd.parts[1] - cli.config_source[cli._entrypoint.__name__]['keyboard'] = 'users_directory' + cli.config_source[cli._entrypoint.__name__]['keymap'] = 'users_directory' return func(*args, **kwargs) -- cgit v1.2.3