1
0
Fork 0

Initial DD keycode migration (#18643)

* Initial DD keycode migration

* Sort magic keycodes
This commit is contained in:
Joel Challis 2022-11-05 10:30:09 +00:00 committed by GitHub
parent a070c4c501
commit a69ab05dd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 5471 additions and 1878 deletions

View file

@ -11,12 +11,23 @@ from qmk.info import info_json
from qmk.json_encoders import InfoJSONEncoder
from qmk.json_schema import json_load
from qmk.keyboard import find_readme, list_keyboards
from qmk.keycodes import load_spec, list_versions
DATA_PATH = Path('data')
TEMPLATE_PATH = DATA_PATH / 'templates/api/'
BUILD_API_PATH = Path('.build/api_data/')
def _resolve_keycode_specs(output_folder):
"""To make it easier for consumers, publish pre-merged spec files
"""
for version in list_versions():
overall = load_spec(version)
output_file = output_folder / f'constants/keycodes_{version}.json'
output_file.write_text(json.dumps(overall, indent=4), encoding='utf-8')
def _filtered_keyboard_list():
"""Perform basic filtering of list_keyboards
"""
@ -95,6 +106,9 @@ def generate_api(cli):
'usb': usb_list,
}
# Feature specific handling
_resolve_keycode_specs(v1_dir)
# Write the global JSON files
keyboard_all_json = json.dumps({'last_updated': current_datetime(), 'keyboards': kb_all}, cls=InfoJSONEncoder)
usb_json = json.dumps({'last_updated': current_datetime(), 'usb': usb_list}, cls=InfoJSONEncoder)