Merge pull request #8931 from kbrock/kle2info_2

[kle2json] fix rounding in output
This commit is contained in:
Joel Challis 2020-04-26 22:23:54 +01:00 committed by GitHub
commit 3cb6fb2935
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -110,8 +110,8 @@ class KLE2xy(list):
else: else:
current_key['name'] = key current_key['name'] = key
current_key['row'] = current_row current_key['row'] = round(current_row, 2)
current_key['column'] = current_col current_key['column'] = round(current_col, 2)
# Determine the X center # Determine the X center
x_center = (current_key['width'] * self.key_width) / 2 x_center = (current_key['width'] * self.key_width) / 2

View File

@ -69,7 +69,7 @@ def kle2json(cli):
# Replace layout in keyboard json # Replace layout in keyboard json
keyboard = keyboard.replace('"LAYOUT_JSON_HERE"', layout) keyboard = keyboard.replace('"LAYOUT_JSON_HERE"', layout)
# Write our info.json # Write our info.json
file = open(out_path + "/info.json", "w") file = open(out_path / "info.json", "w")
file.write(keyboard) file.write(keyboard)
file.close() file.close()
cli.log.info('Wrote out {fg_cyan}%s/info.json', out_path) cli.log.info('Wrote out {fg_cyan}%s/info.json', out_path)