From a47915d2d264ac78ae3c694b56aa00650ce12859 Mon Sep 17 00:00:00 2001 From: Keenan Brock Date: Sun, 26 Apr 2020 11:32:20 -0400 Subject: [PATCH 1/2] kle2json: fix invocation error resolves an issue while finding the file path TypeError: unsupported operand type(s) for +: 'PosixPath' and 'str' --- lib/python/qmk/cli/kle2json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/qmk/cli/kle2json.py b/lib/python/qmk/cli/kle2json.py index 5268462f92..798f95fd19 100755 --- a/lib/python/qmk/cli/kle2json.py +++ b/lib/python/qmk/cli/kle2json.py @@ -69,7 +69,7 @@ def kle2json(cli): # Replace layout in keyboard json keyboard = keyboard.replace('"LAYOUT_JSON_HERE"', layout) # Write our info.json - file = open(out_path + "/info.json", "w") + file = open(out_path / "info.json", "w") file.write(keyboard) file.close() cli.log.info('Wrote out {fg_cyan}%s/info.json', out_path) From 5c666398d55708915091a08299dc7d493b37db3c Mon Sep 17 00:00:00 2001 From: Keenan Brock Date: Sun, 26 Apr 2020 11:34:07 -0400 Subject: [PATCH 2/2] kle2info: trim down x and y output fixes quirks with float implementation. before: {"label":"Esc", "x":0.66, "y":1.45}, {"label":"!", "x":1.6600000000000001, "y":1.45} after: {"label":"Esc", "x":0.66, "y":1.45}, {"label":"!", "x":1.66, "y":1.45} --- lib/python/kle2xy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/kle2xy.py b/lib/python/kle2xy.py index bff1d025b7..003476f92e 100644 --- a/lib/python/kle2xy.py +++ b/lib/python/kle2xy.py @@ -110,8 +110,8 @@ class KLE2xy(list): else: current_key['name'] = key - current_key['row'] = current_row - current_key['column'] = current_col + current_key['row'] = round(current_row, 2) + current_key['column'] = round(current_col, 2) # Determine the X center x_center = (current_key['width'] * self.key_width) / 2