Merge remote-tracking branch 'origin/develop' into xap

This commit is contained in:
QMK Bot
2023-02-22 22:50:46 +00:00
5 changed files with 82 additions and 69 deletions
+3
View File
@@ -107,6 +107,7 @@ def deep_update(origdict, newdict):
def merge_ordered_dicts(dicts):
"""Merges nested OrderedDict objects resulting from reading a hjson file.
Later input dicts overrides earlier dicts for plain values.
If any value is "!delete!", the existing value will be removed from its parent.
Arrays will be appended. If the first entry of an array is "!reset!", the contents of the array will be cleared and replaced with RHS.
Dictionaries will be recursively merged. If any entry is "!reset!", the contents of the dictionary will be cleared and replaced with RHS.
"""
@@ -125,6 +126,8 @@ def merge_ordered_dicts(dicts):
target[k] = v[1:]
else:
target[k] = target[k] + v
elif v == "!delete!" and isinstance(target, (OrderedDict, dict)):
del target[k]
else:
target[k] = v
+1
View File
@@ -90,6 +90,7 @@ def load_spec(version, lang=None):
# Sort?
spec['keycodes'] = dict(sorted(spec.get('keycodes', {}).items()))
spec['ranges'] = dict(sorted(spec.get('ranges', {}).items()))
# Validate?
_validate(spec)