Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 'qmk import-kbfirmware' to use 'keyboard.json' #23960

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/python/qmk/importers.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def import_keyboard(info_data, keymap_data=None):

# And validate some more as everything is optional
if not all(key in info_data for key in ['keyboard_name', 'layouts']):
raise ValueError('invalid info.json')
raise ValueError('invalid json config')

kb_name = info_data['keyboard_name']

Expand All @@ -115,7 +115,7 @@ def import_keyboard(info_data, keymap_data=None):
# TODO: if supports community then grab that instead
keymap_data = _gen_dummy_keymap(kb_name, info_data)

keyboard_info = kb_folder / 'info.json'
keyboard_json = kb_folder / 'keyboard.json'
keyboard_keymap = kb_folder / 'keymaps' / 'default' / 'keymap.json'

# begin with making the deepest folder in the tree
Expand All @@ -136,10 +136,10 @@ def import_keyboard(info_data, keymap_data=None):
for file in list(TEMPLATE.iterdir()):
replace_placeholders(file, kb_folder / file.name, tokens)

temp = json_load(keyboard_info)
temp = json_load(keyboard_json)
deep_update(temp, info_data)

keyboard_info.write_text(json.dumps(temp, cls=InfoJSONEncoder, sort_keys=True))
keyboard_json.write_text(json.dumps(temp, cls=InfoJSONEncoder, sort_keys=True))
keyboard_keymap.write_text(json.dumps(keymap_data, cls=KeymapJSONEncoder, sort_keys=True))

return kb_name
Expand Down
Loading