augur.util_support.node_data module

exception augur.util_support.node_data.DuplicatedNonDictAttributeError(key)

Bases: Exception

class augur.util_support.node_data.NodeData

Bases: object

Data structure representing a set of Augur nodes

deep_add_or_update(d, key, value)

Recursively merge in new attributes using the following rules:

if key is new:

add it

if key is old, but the old value is not a dict:
if new value is also not a dict:

overwrite it

if trying to overwrite a non-dict with a dict:

raise exception

if key old and the old value is a dict:
if new value is also a dict:

recursively merge

if trying to overwrite a dict with a non-dict:

raise exception

update(new_attrs)