diff options
| author | skullydazed <skullydazed@users.noreply.github.com> | 2020-03-13 15:47:04 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-13 15:47:04 -0700 |
| commit | f81b0e35a6a25a9a6e633dc65a4900bed2458cfb (patch) | |
| tree | 707e06f6cd2caeda4278cfd9751ee77bf15aa055 /lib/python/qmk/cli/list | |
| parent | 5e98eaaaff8fde1ce25b9bad6c00a982718cb467 (diff) | |
| download | qmk_firmware-f81b0e35a6a25a9a6e633dc65a4900bed2458cfb.tar.gz qmk_firmware-f81b0e35a6a25a9a6e633dc65a4900bed2458cfb.zip | |
Add decorators for determining keyboard and keymap based on current directory (#8191)
* Use pathlib everywhere we can
* Improvements based on @erovia's feedback
* rework qmk compile and qmk flash to use pathlib
* style
* Remove the subcommand_name argument from find_keyboard_keymap()
* add experimental decorators
* Create decorators for finding keyboard and keymap based on current directory.
Decorators were inspired by @Erovia's brilliant work on the proof of concept.
Diffstat (limited to 'lib/python/qmk/cli/list')
| -rw-r--r-- | lib/python/qmk/cli/list/keymaps.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/python/qmk/cli/list/keymaps.py b/lib/python/qmk/cli/list/keymaps.py index d199d29bc..cec9ca022 100644 --- a/lib/python/qmk/cli/list/keymaps.py +++ b/lib/python/qmk/cli/list/keymaps.py | |||
| @@ -1,12 +1,15 @@ | |||
| 1 | """List the keymaps for a specific keyboard | 1 | """List the keymaps for a specific keyboard |
| 2 | """ | 2 | """ |
| 3 | from milc import cli | 3 | from milc import cli |
| 4 | |||
| 4 | import qmk.keymap | 5 | import qmk.keymap |
| 6 | from qmk.decorators import automagic_keyboard | ||
| 5 | from qmk.errors import NoSuchKeyboardError | 7 | from qmk.errors import NoSuchKeyboardError |
| 6 | 8 | ||
| 7 | 9 | ||
| 8 | @cli.argument("-kb", "--keyboard", help="Specify keyboard name. Example: 1upkeyboards/1up60hse") | 10 | @cli.argument("-kb", "--keyboard", help="Specify keyboard name. Example: 1upkeyboards/1up60hse") |
| 9 | @cli.subcommand("List the keymaps for a specific keyboard") | 11 | @cli.subcommand("List the keymaps for a specific keyboard") |
| 12 | @automagic_keyboard | ||
| 10 | def list_keymaps(cli): | 13 | def list_keymaps(cli): |
| 11 | """List the keymaps for a specific keyboard | 14 | """List the keymaps for a specific keyboard |
| 12 | """ | 15 | """ |
