diff options
author | Zach White <skullydazed@gmail.com> | 2020-12-30 10:27:37 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-30 10:27:37 -0800 |
commit | 47b9b110097a864d6ab76516b2213afd59948527 (patch) | |
tree | 44c4e034c71b361af0cf865b735e09162bbc9656 /lib/python/qmk/cli/info.py | |
parent | f231f24ddaac9781201a4ec9d0171c65af788839 (diff) | |
download | qmk_firmware-47b9b110097a864d6ab76516b2213afd59948527.tar.gz qmk_firmware-47b9b110097a864d6ab76516b2213afd59948527.zip |
Configure keyboard matrix from info.json (#10817)
* Make parameters from info.json available to the build system
* move all clueboard settings to info.json
* code formatting
* make flake8 happy
* make flake8 happy
* make qmk lint happy
* Add support for specifying led indicators in json
* move led indicators to the clueboard info.json
* Apply suggestions from code review
Co-authored-by: Erovia <Erovia@users.noreply.github.com>
* add missing docstring
Co-authored-by: Erovia <Erovia@users.noreply.github.com>
Diffstat (limited to 'lib/python/qmk/cli/info.py')
-rwxr-xr-x | lib/python/qmk/cli/info.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/python/qmk/cli/info.py b/lib/python/qmk/cli/info.py index 9ab299a21..87d7253d4 100755 --- a/lib/python/qmk/cli/info.py +++ b/lib/python/qmk/cli/info.py | |||
@@ -7,6 +7,8 @@ import platform | |||
7 | 7 | ||
8 | from milc import cli | 8 | from milc import cli |
9 | 9 | ||
10 | from qmk.info_json_encoder import InfoJSONEncoder | ||
11 | from qmk.constants import COL_LETTERS, ROW_LETTERS | ||
10 | from qmk.decorators import automagic_keyboard, automagic_keymap | 12 | from qmk.decorators import automagic_keyboard, automagic_keymap |
11 | from qmk.keyboard import render_layouts, render_layout | 13 | from qmk.keyboard import render_layouts, render_layout |
12 | from qmk.keymap import locate_keymap | 14 | from qmk.keymap import locate_keymap |
@@ -15,9 +17,6 @@ from qmk.path import is_keyboard | |||
15 | 17 | ||
16 | platform_id = platform.platform().lower() | 18 | platform_id = platform.platform().lower() |
17 | 19 | ||
18 | ROW_LETTERS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnop' | ||
19 | COL_LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijilmnopqrstuvwxyz' | ||
20 | |||
21 | 20 | ||
22 | def show_keymap(kb_info_json, title_caps=True): | 21 | def show_keymap(kb_info_json, title_caps=True): |
23 | """Render the keymap in ascii art. | 22 | """Render the keymap in ascii art. |
@@ -149,7 +148,7 @@ def info(cli): | |||
149 | 148 | ||
150 | # Output in the requested format | 149 | # Output in the requested format |
151 | if cli.args.format == 'json': | 150 | if cli.args.format == 'json': |
152 | print(json.dumps(kb_info_json)) | 151 | print(json.dumps(kb_info_json, cls=InfoJSONEncoder)) |
153 | elif cli.args.format == 'text': | 152 | elif cli.args.format == 'text': |
154 | print_text_output(kb_info_json) | 153 | print_text_output(kb_info_json) |
155 | elif cli.args.format == 'friendly': | 154 | elif cli.args.format == 'friendly': |