mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-03-03 18:30:57 +00:00
Merge remote-tracking branch 'origin/develop' into xap
This commit is contained in:
commit
8588fe79fe
@ -29,6 +29,23 @@ def _resolve_keycode_specs(output_folder):
|
|||||||
output_file = output_folder / f'constants/keycodes_{version}.json'
|
output_file = output_folder / f'constants/keycodes_{version}.json'
|
||||||
output_file.write_text(json.dumps(overall, indent=4), encoding='utf-8')
|
output_file.write_text(json.dumps(overall, indent=4), encoding='utf-8')
|
||||||
|
|
||||||
|
# Purge files consumed by 'load_spec'
|
||||||
|
shutil.rmtree(output_folder / 'constants/keycodes/')
|
||||||
|
|
||||||
|
|
||||||
|
def _filtered_copy(src, dst):
|
||||||
|
src = Path(src)
|
||||||
|
dst = Path(dst)
|
||||||
|
|
||||||
|
if dst.suffix == '.hjson':
|
||||||
|
data = json_load(src)
|
||||||
|
|
||||||
|
dst = dst.with_suffix('.json')
|
||||||
|
dst.write_text(json.dumps(data, indent=4), encoding='utf-8')
|
||||||
|
return dst
|
||||||
|
|
||||||
|
return shutil.copy2(src, dst)
|
||||||
|
|
||||||
|
|
||||||
def _filtered_keyboard_list():
|
def _filtered_keyboard_list():
|
||||||
"""Perform basic filtering of list_keyboards
|
"""Perform basic filtering of list_keyboards
|
||||||
@ -76,7 +93,7 @@ def generate_api(cli):
|
|||||||
shutil.rmtree(BUILD_API_PATH)
|
shutil.rmtree(BUILD_API_PATH)
|
||||||
|
|
||||||
shutil.copytree(TEMPLATE_PATH, BUILD_API_PATH)
|
shutil.copytree(TEMPLATE_PATH, BUILD_API_PATH)
|
||||||
shutil.copytree(DATA_PATH, v1_dir)
|
shutil.copytree(DATA_PATH, v1_dir, copy_function=_filtered_copy)
|
||||||
|
|
||||||
# Filter down when required
|
# Filter down when required
|
||||||
keyboard_list = _filtered_keyboard_list()
|
keyboard_list = _filtered_keyboard_list()
|
||||||
|
Loading…
Reference in New Issue
Block a user