Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# FIXME: This should be better
return cli.log.error('Could not parse KLE raw data.')
keyboard = OrderedDict(
keyboard_name=kle.name,
url='',
maintainer='qmk',
width=kle.columns,
height=kle.rows,
layouts={'LAYOUT': {
'layout': 'LAYOUT_JSON_HERE'
}},
)
# Initialize keyboard with json encoded from ordered dict
keyboard = json.dumps(keyboard, indent=4, separators=(', ', ': '), sort_keys=False, cls=CustomJSONEncoder)
# Initialize layout with kle2qmk from converter module
layout = json.dumps(kle2qmk(kle), separators=(', ', ':'), cls=CustomJSONEncoder)
# Replace layout in keyboard json
keyboard = keyboard.replace('"LAYOUT_JSON_HERE"', layout)
# Write our info.json
file = open(str(out_path) + "/info.json", "w")
file.write(keyboard)
file.close()
cli.log.info('Wrote out {fg_cyan}%s/info.json', str(out_path))