MCPcopy
hub / github.com/epinna/tplmap / _recursive_update

Function _recursive_update

core/plugin.py:14–27  ·  view source on GitHub ↗
(d, u)

Source from the content-addressed store, hash-verified

12import utils.config
13
14def _recursive_update(d, u):
15 # Update value of a nested dictionary of varying depth
16
17 for k, v in u.iteritems():
18 if isinstance(d, collections.Mapping):
19 if isinstance(v, collections.Mapping):
20 r = _recursive_update(d.get(k, {}), v)
21 d[k] = r
22 else:
23 d[k] = u[k]
24 else:
25 d = {k: u[k]}
26
27 return d
28
29class Plugin(object):
30

Callers 1

update_actionsMethod · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected