aboutsummaryrefslogtreecommitdiff
path: root/lib/python/qmk/json_schema.py
diff options
context:
space:
mode:
authorJoel Challis <[email protected]>2023-02-22 22:50:09 +0000
committerGitHub <[email protected]>2023-02-23 09:50:09 +1100
commit9f2cd9119f18deb824ef7840c69f97c635b485cd (patch)
tree1d4a3dbf4f5584cc2ada10bee7ff5857e3b916d1 /lib/python/qmk/json_schema.py
parent961f0b7b2de54f988daf4ce7b791f91a33e55612 (diff)
downloadqmk_firmware-9f2cd9119f18deb824ef7840c69f97c635b485cd.tar.gz
qmk_firmware-9f2cd9119f18deb824ef7840c69f97c635b485cd.zip
Reallocate user/kb keycode ranges (#19907)
Diffstat (limited to 'lib/python/qmk/json_schema.py')
-rw-r--r--lib/python/qmk/json_schema.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/python/qmk/json_schema.py b/lib/python/qmk/json_schema.py
index c886a0d868..b00df749cc 100644
--- a/lib/python/qmk/json_schema.py
+++ b/lib/python/qmk/json_schema.py
@@ -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