From 543e663c68544941c34f1e087a3074192c9ad93a Mon Sep 17 00:00:00 2001 From: Zach White Date: Thu, 7 Jan 2021 21:11:57 -0800 Subject: [PATCH] more robust key label parsing --- lib/python/qmk/converter.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/python/qmk/converter.py b/lib/python/qmk/converter.py index 068de21071..de2c1b459a 100644 --- a/lib/python/qmk/converter.py +++ b/lib/python/qmk/converter.py @@ -16,7 +16,15 @@ def kle2qmk(kle): continue if key['label_style'] in [0, 4]: - matrix, _, _, alt_layout, layout_name, _, keycode = key['name'].split('\n') + key_name = key['name'].split('\n') + if len(key_name) == 7: + matrix, _, _, alt_layout, layout_name, _, keycode = key_name + elif len(key_name) == 5: + matrix, _, _, alt_layout, layout_name = key_name + cli.log.warning('Missing Keycode for key at matrix %s layout %s.', matrix, alt_layout) + else: + cli.log.error('Unknown label format: %s', repr(key['name'])) + continue else: cli.log.error('Unknown label style: %s', key['label_style']) continue