diff options
author | Zach White <skullydazed@gmail.com> | 2019-12-08 16:16:01 -0800 |
---|---|---|
committer | skullydazed <skullydazed@users.noreply.github.com> | 2019-12-08 16:40:03 -0800 |
commit | 033c7af292730fab4a4b147de0fc5b33460379e1 (patch) | |
tree | 3b001187153ce7489899d8100670468f736aaf3d /lib/python/qmk/commands.py | |
parent | 15e5f57952a985d910a9b66a738ee1f71dbfa5c2 (diff) |
Fix compiling json files
Diffstat (limited to 'lib/python/qmk/commands.py')
-rw-r--r-- | lib/python/qmk/commands.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/python/qmk/commands.py b/lib/python/qmk/commands.py index f83a89578e..6067d49ae7 100644 --- a/lib/python/qmk/commands.py +++ b/lib/python/qmk/commands.py @@ -25,16 +25,14 @@ def create_make_command(keyboard, keymap, target=None): return ['make', ':'.join((keyboard, keymap, target))] -def parse_configurator_json(configurator_filename): +def parse_configurator_json(configurator_file): """Open and parse a configurator json export """ - file = open(configurator_filename) - user_keymap = json.load(file) - file.close() + user_keymap = json.load(configurator_file) return user_keymap -def compile_configurator_json(configurator_filename, bootloader=None): +def compile_configurator_json(user_keymap, bootloader=None): """Convert a configurator export JSON file into a C file Args: @@ -47,9 +45,6 @@ def compile_configurator_json(configurator_filename, bootloader=None): Returns: A command to run to compile and flash the C file. """ - # Parse the configurator json - user_keymap = parse_configurator_json(configurator_filename) - # Write the keymap C file qmk.keymap.write(user_keymap['keyboard'], user_keymap['keymap'], user_keymap['layout'], user_keymap['layers']) |