mirror of
https://github.com/qmk/qmk_firmware
synced 2024-11-18 09:55:48 +00:00
make LAYOUT parsing more robust
This commit is contained in:
parent
ba0b965c42
commit
23ef327e11
1 changed files with 4 additions and 2 deletions
|
@ -67,8 +67,10 @@ def find_layouts(file):
|
|||
layout = layout.strip()
|
||||
parsed_layout = [_default_key(key) for key in layout.split(',')]
|
||||
|
||||
for key in parsed_layout:
|
||||
if key['label'] in matrix_locations:
|
||||
for i, key in enumerate(parsed_layout):
|
||||
if 'label' not in key:
|
||||
cli.log.error('Invalid LAYOUT macro in %s: Empty parameter name in macro %s at pos %s.', file, macro_name, i)
|
||||
elif key['label'] in matrix_locations:
|
||||
key['matrix'] = matrix_locations[key['label']]
|
||||
|
||||
parsed_layouts[macro_name] = {
|
||||
|
|
Loading…
Reference in a new issue