mirror of
https://github.com/qmk/qmk_firmware
synced 2024-11-17 17:35:30 +00:00
Merge remote-tracking branch 'origin/master' into develop
Resolved Conflicts: lib/python/qmk/info.py
This commit is contained in:
commit
1ec6ce8c37
1 changed files with 6 additions and 35 deletions
|
@ -551,39 +551,6 @@ def _check_matrix(info_data):
|
||||||
_log_error(info_data, f'MATRIX_ROWS is inconsistent with the size of MATRIX_ROW_PINS: {row_count} != {actual_row_count}')
|
_log_error(info_data, f'MATRIX_ROWS is inconsistent with the size of MATRIX_ROW_PINS: {row_count} != {actual_row_count}')
|
||||||
|
|
||||||
|
|
||||||
def _merge_layouts(info_data, new_info_data):
|
|
||||||
"""Merge new_info_data into info_data in an intelligent way.
|
|
||||||
"""
|
|
||||||
for layout_name, layout_json in new_info_data['layouts'].items():
|
|
||||||
if layout_name in info_data['layouts']:
|
|
||||||
# Pull in layouts we have a macro for
|
|
||||||
if len(info_data['layouts'][layout_name]['layout']) != len(layout_json['layout']):
|
|
||||||
msg = '%s: %s: Number of elements in info.json does not match! info.json:%s != %s:%s'
|
|
||||||
_log_error(info_data, msg % (info_data['keyboard_folder'], layout_name, len(layout_json['layout']), layout_name, len(info_data['layouts'][layout_name]['layout'])))
|
|
||||||
else:
|
|
||||||
for i, key in enumerate(info_data['layouts'][layout_name]['layout']):
|
|
||||||
key.update(layout_json['layout'][i])
|
|
||||||
else:
|
|
||||||
# Pull in layouts that have matrix data
|
|
||||||
missing_matrix = False
|
|
||||||
for key in layout_json.get('layout', {}):
|
|
||||||
if 'matrix' not in key:
|
|
||||||
missing_matrix = True
|
|
||||||
|
|
||||||
if not missing_matrix:
|
|
||||||
if layout_name in info_data['layouts']:
|
|
||||||
# Update an existing layout with new data
|
|
||||||
for i, key in enumerate(info_data['layouts'][layout_name]['layout']):
|
|
||||||
key.update(layout_json['layout'][i])
|
|
||||||
|
|
||||||
else:
|
|
||||||
# Copy in the new layout wholesale
|
|
||||||
layout_json['c_macro'] = False
|
|
||||||
info_data['layouts'][layout_name] = layout_json
|
|
||||||
|
|
||||||
return info_data
|
|
||||||
|
|
||||||
|
|
||||||
def _search_keyboard_h(keyboard):
|
def _search_keyboard_h(keyboard):
|
||||||
keyboard = Path(keyboard)
|
keyboard = Path(keyboard)
|
||||||
current_path = Path('keyboards/')
|
current_path = Path('keyboards/')
|
||||||
|
@ -723,8 +690,12 @@ def merge_info_jsons(keyboard, info_data):
|
||||||
layout_name = info_data['layout_aliases'][layout_name]
|
layout_name = info_data['layout_aliases'][layout_name]
|
||||||
|
|
||||||
if layout_name in info_data['layouts']:
|
if layout_name in info_data['layouts']:
|
||||||
for new_key, existing_key in zip(layout['layout'], info_data['layouts'][layout_name]['layout']):
|
if len(info_data['layouts'][layout_name]['layout']) != len(layout['layout']):
|
||||||
existing_key.update(new_key)
|
msg = '%s: %s: Number of elements in info.json does not match! info.json:%s != %s:%s'
|
||||||
|
_log_error(info_data, msg % (info_data['keyboard_folder'], layout_name, len(layout['layout']), layout_name, len(info_data['layouts'][layout_name]['layout'])))
|
||||||
|
else:
|
||||||
|
for new_key, existing_key in zip(layout['layout'], info_data['layouts'][layout_name]['layout']):
|
||||||
|
existing_key.update(new_key)
|
||||||
else:
|
else:
|
||||||
layout['c_macro'] = False
|
layout['c_macro'] = False
|
||||||
info_data['layouts'][layout_name] = layout
|
info_data['layouts'][layout_name] = layout
|
||||||
|
|
Loading…
Reference in a new issue