diff options
author | Zach White <skullydazed@gmail.com> | 2021-10-04 09:26:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-04 09:26:19 -0700 |
commit | 20f81af98af26d3e15277e402a364a513f986aa6 (patch) | |
tree | ea48273f683e1c429d234864c359c635c9fbc02d /lib/python/qmk/cli/list/layouts.py | |
parent | f72b2ad720b5b61a6e49b12a9375b97046ed5d8e (diff) | |
download | qmk_firmware-20f81af98af26d3e15277e402a364a513f986aa6.tar.gz qmk_firmware-20f81af98af26d3e15277e402a364a513f986aa6.zip |
Allow community layouts to be specified in info.json (#14682)
* move the community layout detection to python
* fixup tests
Diffstat (limited to 'lib/python/qmk/cli/list/layouts.py')
-rw-r--r-- | lib/python/qmk/cli/list/layouts.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/python/qmk/cli/list/layouts.py b/lib/python/qmk/cli/list/layouts.py new file mode 100644 index 000000000..8e07afeec --- /dev/null +++ b/lib/python/qmk/cli/list/layouts.py | |||
@@ -0,0 +1,18 @@ | |||
1 | """List the keymaps for a specific keyboard | ||
2 | """ | ||
3 | from milc import cli | ||
4 | |||
5 | from qmk.decorators import automagic_keyboard | ||
6 | from qmk.keyboard import keyboard_completer, keyboard_folder | ||
7 | from qmk.info import info_json | ||
8 | |||
9 | |||
10 | @cli.argument("-kb", "--keyboard", type=keyboard_folder, completer=keyboard_completer, help="Specify keyboard name. Example: monarch") | ||
11 | @cli.subcommand("List the layouts for a specific keyboard") | ||
12 | @automagic_keyboard | ||
13 | def list_layouts(cli): | ||
14 | """List the layouts for a specific keyboard | ||
15 | """ | ||
16 | info_data = info_json(cli.config.list_layouts.keyboard) | ||
17 | for name in sorted(info_data.get('community_layouts', [])): | ||
18 | print(name) | ||