diff options
author | QMK Bot <hello@qmk.fm> | 2022-02-27 12:40:01 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2022-02-27 12:40:01 +0000 |
commit | 3c7c9bdd8614cd332b4db7ab6d05429d513ba11d (patch) | |
tree | 81ca3c2dc35766e7f456e607a0caeb279a3ca695 /lib/python/qmk/cli/generate/layouts.py | |
parent | 48f06ae6463f1199c059c05f617304952f6dd110 (diff) | |
parent | 779c7debcfff1a4a3ad578a0c12bdd50cba11039 (diff) |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'lib/python/qmk/cli/generate/layouts.py')
-rwxr-xr-x | lib/python/qmk/cli/generate/layouts.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/python/qmk/cli/generate/layouts.py b/lib/python/qmk/cli/generate/layouts.py index e44266e1c8..a21311bd49 100755 --- a/lib/python/qmk/cli/generate/layouts.py +++ b/lib/python/qmk/cli/generate/layouts.py @@ -40,16 +40,12 @@ def generate_layouts(cli): # Build the layouts.h file. layouts_h_lines = ['/* This file was generated by `qmk generate-layouts`. Do not edit or copy.', ' */', '', '#pragma once'] - if 'matrix_pins' in kb_info_json: - if 'direct' in kb_info_json['matrix_pins']: - col_num = len(kb_info_json['matrix_pins']['direct'][0]) - row_num = len(kb_info_json['matrix_pins']['direct']) - elif 'cols' in kb_info_json['matrix_pins'] and 'rows' in kb_info_json['matrix_pins']: - col_num = len(kb_info_json['matrix_pins']['cols']) - row_num = len(kb_info_json['matrix_pins']['rows']) - else: - cli.log.error('%s: Invalid matrix config.', cli.config.generate_layouts.keyboard) - return False + if 'matrix_size' not in kb_info_json: + cli.log.error('%s: Invalid matrix config.', cli.config.generate_layouts.keyboard) + return False + + col_num = kb_info_json['matrix_size']['cols'] + row_num = kb_info_json['matrix_size']['rows'] for layout_name in kb_info_json['layouts']: if kb_info_json['layouts'][layout_name]['c_macro']: |