diff options
author | QMK Bot <hello@qmk.fm> | 2019-11-13 05:24:56 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2019-11-13 05:24:56 +0000 |
commit | a4c2a9b083d82d9e7d7fe3a68c0d51ae2280495f (patch) | |
tree | a1b6edbeb75442ab50b68283bea5af72b09ceccf /lib/python/qmk | |
parent | 7329c2d02d38f40a23d38f789de34057fd2acd42 (diff) | |
download | qmk_firmware-a4c2a9b083d82d9e7d7fe3a68c0d51ae2280495f.tar.gz qmk_firmware-a4c2a9b083d82d9e7d7fe3a68c0d51ae2280495f.zip |
format code according to conventions [skip ci]
Diffstat (limited to 'lib/python/qmk')
-rwxr-xr-x | lib/python/qmk/cli/kle2json.py | 10 | ||||
-rw-r--r-- | lib/python/qmk/tests/test_cli_commands.py | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/python/qmk/cli/kle2json.py b/lib/python/qmk/cli/kle2json.py index 22eb515dff..5a4e97e3ab 100755 --- a/lib/python/qmk/cli/kle2json.py +++ b/lib/python/qmk/cli/kle2json.py @@ -31,7 +31,7 @@ class CustomJSONEncoder(json.JSONEncoder): @cli.subcommand('Convert a KLE layout to a Configurator JSON') def kle2json(cli): """Convert a KLE layout to QMK's layout format. - """ # If filename is a path + """ # If filename is a path if cli.args.filename.startswith("/") or cli.args.filename.startswith("./"): file_path = Path(cli.args.filename) # Otherwise assume it is a file name @@ -45,7 +45,7 @@ def kle2json(cli): # Check if info.json exists, allow overwrite with force if Path(out_path, "info.json").exists() and not cli.args.force: cli.log.error('File {fg_cyan}%s/info.json{style_reset_all} already exists, use -f or --force to overwrite.', str(out_path)) - return False; + return False try: # Convert KLE raw to x/y coordinates (using kle2xy package from skullydazed) kle = KLE2xy(raw_code) @@ -65,11 +65,9 @@ def kle2json(cli): }}, ) # Initialize keyboard with json encoded from ordered dict - keyboard = json.dumps(keyboard, indent=4, separators=( - ', ', ': '), sort_keys=False, cls=CustomJSONEncoder) + 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) + layout = json.dumps(kle2qmk(kle), separators=(', ', ':'), cls=CustomJSONEncoder) # Replace layout in keyboard json keyboard = keyboard.replace('"LAYOUT_JSON_HERE"', layout) # Write our info.json diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py index d91af992a8..85d4d91af1 100644 --- a/lib/python/qmk/tests/test_cli_commands.py +++ b/lib/python/qmk/tests/test_cli_commands.py @@ -19,9 +19,11 @@ def test_config(): assert result.returncode == 0 assert 'general.color' in result.stdout + def test_kle2json(): assert check_subcommand('kle2json', 'kle.txt', '-f').returncode == 0 + def test_doctor(): result = check_subcommand('doctor') assert result.returncode == 0 |