import merge_dicts from yagicard
This commit is contained in:
1 parent
e239215895
commit
719d1ee6e3
1 file changed
+12
@@ -13,3 +13,15 @@ def find_nearest(path, test):
|
||||
return None
|
||||
|
||||
path = parent_path
|
||||
|
||||
def merge_dicts (dicts):
|
||||
fusion = {}
|
||||
for source in dicts:
|
||||
if not source:
|
||||
continue
|
||||
|
||||
for key, value in source.items():
|
||||
if isinstance(value, dict):
|
||||
value = merge_dicts([fusion.get(key, None), value])
|
||||
fusion[key] = value
|
||||
return fusion
|
||||
Reference in new issue
Block a user