1
0
Fork 0

Add support for qmk_configurator style aliases (#11954)

* Add support for qmk_configurator style aliases

* add the keyboard aliases to the api data

* add support for a keyboard metadata file

* make flake8 happy
This commit is contained in:
Zach White 2021-03-24 09:26:38 -07:00 committed by GitHub
parent 723d9af04d
commit 299008be36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 614 additions and 106 deletions

View file

@ -8,8 +8,10 @@ from jsonschema import Draft7Validator, validators
from milc import cli
from qmk.decorators import automagic_keyboard, automagic_keymap
from qmk.info import info_json, _jsonschema
from qmk.info import info_json
from qmk.info_json_encoder import InfoJSONEncoder
from qmk.json_schema import load_jsonschema
from qmk.keyboard import keyboard_folder
from qmk.path import is_keyboard
@ -33,13 +35,13 @@ def strip_info_json(kb_info_json):
"""Remove the API-only properties from the info.json.
"""
pruning_draft_7_validator = pruning_validator(Draft7Validator)
schema = _jsonschema('keyboard')
schema = load_jsonschema('keyboard')
validator = pruning_draft_7_validator(schema).validate
return validator(kb_info_json)
@cli.argument('-kb', '--keyboard', help='Keyboard to show info for.')
@cli.argument('-kb', '--keyboard', type=keyboard_folder, help='Keyboard to show info for.')
@cli.argument('-km', '--keymap', help='Show the layers for a JSON keymap too.')
@cli.subcommand('Generate an info.json file for a keyboard.', hidden=False if cli.config.user.developer else True)
@automagic_keyboard