diff options
author | Joel Challis <git@zvecr.com> | 2022-10-21 02:21:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-20 18:21:17 -0700 |
commit | 345f19a5d763053cd9cea6698656d4a2a1000b23 (patch) | |
tree | ff22042d4af5e75f4daeb2272eed65da6d7f1394 /lib/python/qmk | |
parent | 6e55aa42faf19f59fd62923859b320b39dc370a4 (diff) |
Add converter support to keymap.json (#18776)
Diffstat (limited to 'lib/python/qmk')
-rwxr-xr-x | lib/python/qmk/cli/generate/config_h.py | 2 | ||||
-rwxr-xr-x | lib/python/qmk/cli/generate/rules_mk.py | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/python/qmk/cli/generate/config_h.py b/lib/python/qmk/cli/generate/config_h.py index fa7c43788d..f64daba134 100755 --- a/lib/python/qmk/cli/generate/config_h.py +++ b/lib/python/qmk/cli/generate/config_h.py @@ -174,7 +174,7 @@ def generate_config_h(cli): # Determine our keyboard/keymap if cli.args.filename: user_keymap = parse_configurator_json(cli.args.filename) - kb_info_json = user_keymap.get('config', {}) + kb_info_json = dotty(user_keymap.get('config', {})) elif cli.args.keyboard: kb_info_json = dotty(info_json(cli.args.keyboard)) else: diff --git a/lib/python/qmk/cli/generate/rules_mk.py b/lib/python/qmk/cli/generate/rules_mk.py index 361d3c758a..1d708f371e 100755 --- a/lib/python/qmk/cli/generate/rules_mk.py +++ b/lib/python/qmk/cli/generate/rules_mk.py @@ -49,10 +49,12 @@ def process_mapping_rule(kb_info_json, rules_key, info_dict): def generate_rules_mk(cli): """Generates a rules.mk file from info.json. """ + converter = None # Determine our keyboard/keymap if cli.args.filename: user_keymap = parse_configurator_json(cli.args.filename) - kb_info_json = user_keymap.get('config', {}) + kb_info_json = dotty(user_keymap.get('config', {})) + converter = user_keymap.get('converter', None) elif cli.args.keyboard: kb_info_json = dotty(info_json(cli.args.keyboard)) else: @@ -88,6 +90,9 @@ def generate_rules_mk(cli): else: rules_mk_lines.append('CUSTOM_MATRIX ?= yes') + if converter: + rules_mk_lines.append(f'CONVERT_TO ?= {converter}') + # Show the results dump_lines(cli.args.output, rules_mk_lines) |