Skip to content

Commit

Permalink
Update 'qmk import-kbfirmware' to use 'keyboard.json' (qmk#23960)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored Jun 20, 2024
1 parent dafc46f commit 4fdde75
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 4fdde75

Please sign in to comment.