diff options
| author | Zach White <skullydazed@gmail.com> | 2021-03-07 20:29:23 -0800 |
|---|---|---|
| committer | Zach White <skullydazed@drpepper.org> | 2021-03-09 08:04:07 -0800 |
| commit | 6d8d20774ff57ea19743d2c9afc209a68c51e361 (patch) | |
| tree | 04219aaa7b6edca674424f4a8f4672e1dd5af536 | |
| parent | 2aa38f5bd339b206b01963110d4c068bbe0f64bf (diff) | |
| download | qmk_firmware-6d8d20774ff57ea19743d2c9afc209a68c51e361.tar.gz qmk_firmware-6d8d20774ff57ea19743d2c9afc209a68c51e361.zip | |
improve detection of community layout support
| -rw-r--r-- | lib/python/qmk/info.py | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index 051459698..96e4399c3 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py | |||
| @@ -74,19 +74,10 @@ def info_json(keyboard): | |||
| 74 | _log_error(info_data, 'No LAYOUTs defined! Need at least one layout defined in the keyboard.h or info.json.') | 74 | _log_error(info_data, 'No LAYOUTs defined! Need at least one layout defined in the keyboard.h or info.json.') |
| 75 | 75 | ||
| 76 | # Make sure we supply layout macros for the community layouts we claim to support | 76 | # Make sure we supply layout macros for the community layouts we claim to support |
| 77 | # FIXME(skullydazed): This should be populated into info.json and read from there instead | 77 | for layout in info_data.get('community_layouts', []): |
| 78 | if 'LAYOUTS' in rules and info_data.get('layouts'): | 78 | layout_name = 'LAYOUT_' + layout |
| 79 | # Match these up against the supplied layouts | 79 | if layout_name not in info_data.get('layouts', {}) and layout_name not in info_data.get('layout_aliases', {}): |
| 80 | supported_layouts = rules['LAYOUTS'].strip().split() | 80 | _log_error(info_data, 'Claims to support community layout %s but no %s() macro found' % (layout, layout_name)) |
| 81 | for layout_name in sorted(info_data['layouts']): | ||
| 82 | layout_name = layout_name[7:] | ||
| 83 | |||
| 84 | if layout_name in supported_layouts: | ||
| 85 | supported_layouts.remove(layout_name) | ||
| 86 | |||
| 87 | if supported_layouts: | ||
| 88 | for supported_layout in supported_layouts: | ||
| 89 | _log_error(info_data, 'Claims to support community layout %s but no LAYOUT_%s() macro found' % (supported_layout, supported_layout)) | ||
| 90 | 81 | ||
| 91 | return info_data | 82 | return info_data |
| 92 | 83 | ||
