diff options
author | Zach White <skullydazed@users.noreply.github.com> | 2020-05-26 13:05:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-26 13:05:41 -0700 |
commit | 751316c34465ea77e066c3052729b207f3d62e0c (patch) | |
tree | cb99656b93c156757e2fd7c84fe716f9c300ca89 /lib/python/qmk/decorators.py | |
parent | 5d3bf8a050f3c0beb1f91147dc1ab54de36cbb05 (diff) | |
download | qmk_firmware-751316c34465ea77e066c3052729b207f3d62e0c.tar.gz |
[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 <Erovia@users.noreply.github.com>
Diffstat (limited to 'lib/python/qmk/decorators.py')
-rw-r--r-- | lib/python/qmk/decorators.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/python/qmk/decorators.py b/lib/python/qmk/decorators.py index 94e14bf37..f8f2facb1 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) |