diff options
| author | Joel Challis <git@zvecr.com> | 2022-12-09 00:54:52 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-09 00:54:52 +0000 |
| commit | 9bc7e9afbd32e3ed34580f1be9a79e6040158de5 (patch) | |
| tree | b165d318a88cc85950df4d247a9698a4bfa5adc8 /lib/python/qmk/cli/generate/api.py | |
| parent | 6133b08e73813c19bca8934a44c41c7c2d297a71 (diff) | |
Initial uk+us DD keymap_extras migration (#19031)
Diffstat (limited to 'lib/python/qmk/cli/generate/api.py')
| -rwxr-xr-x | lib/python/qmk/cli/generate/api.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/python/qmk/cli/generate/api.py b/lib/python/qmk/cli/generate/api.py index 8650a36b84..dd4830f543 100755 --- a/lib/python/qmk/cli/generate/api.py +++ b/lib/python/qmk/cli/generate/api.py | |||
| @@ -11,7 +11,7 @@ from qmk.info import info_json | |||
| 11 | from qmk.json_encoders import InfoJSONEncoder | 11 | from qmk.json_encoders import InfoJSONEncoder |
| 12 | from qmk.json_schema import json_load | 12 | from qmk.json_schema import json_load |
| 13 | from qmk.keyboard import find_readme, list_keyboards | 13 | from qmk.keyboard import find_readme, list_keyboards |
| 14 | from qmk.keycodes import load_spec, list_versions | 14 | from qmk.keycodes import load_spec, list_versions, list_languages |
| 15 | 15 | ||
| 16 | DATA_PATH = Path('data') | 16 | DATA_PATH = Path('data') |
| 17 | TEMPLATE_PATH = DATA_PATH / 'templates/api/' | 17 | TEMPLATE_PATH = DATA_PATH / 'templates/api/' |
| @@ -44,6 +44,13 @@ def _resolve_keycode_specs(output_folder): | |||
| 44 | output_file = output_folder / f'constants/keycodes_{version}.json' | 44 | output_file = output_folder / f'constants/keycodes_{version}.json' |
| 45 | output_file.write_text(json.dumps(overall, indent=4), encoding='utf-8') | 45 | output_file.write_text(json.dumps(overall, indent=4), encoding='utf-8') |
| 46 | 46 | ||
| 47 | for lang in list_languages(): | ||
| 48 | for version in list_versions(lang): | ||
| 49 | overall = load_spec(version, lang) | ||
| 50 | |||
| 51 | output_file = output_folder / f'constants/keycodes_{lang}_{version}.json' | ||
| 52 | output_file.write_text(json.dumps(overall, indent=4), encoding='utf-8') | ||
| 53 | |||
| 47 | # Purge files consumed by 'load_spec' | 54 | # Purge files consumed by 'load_spec' |
| 48 | shutil.rmtree(output_folder / 'constants/keycodes/') | 55 | shutil.rmtree(output_folder / 'constants/keycodes/') |
| 49 | 56 | ||
