Class defining a dict-branch object.
More...
Class defining a dict-branch object.
CMLDictBranch are nodes which can hold several CMLNodes as children.
◆ __init__()
def carputils.cml.cmltree.CMLDictBranch.__init__ |
( |
|
self, |
|
|
|
parent, |
|
|
|
key |
|
) |
| |
Method to initialize a CMLDictBranch object.
- Parameters
-
parent | Parent node |
key | Key string or None |
◆ add_child()
def carputils.cml.cmltree.CMLDictBranch.add_child |
( |
|
self, |
|
|
|
node |
|
) |
| |
Add child node.
- Parameters
-
- Exceptions
-
AttributeError | if node is not an instance of CMLNode |
AttributeError | |
◆ from_node()
def carputils.cml.cmltree.CMLDictBranch.from_node |
( |
|
node | ) |
|
|
static |
◆ objectify()
def carputils.cml.cmltree.CMLDictBranch.objectify |
( |
|
self | ) |
|
Objectify node and all child nodes.
- Returns
- If the key of the node is None, a CMLNamespace with all child nodes as attributes is returned, else a list containing the key and the CMLNamespace with all child nodes as attributes is returned
◆ serialize()
def carputils.cml.cmltree.CMLDictBranch.serialize |
( |
|
self | ) |
|
Serialize node and all child nodes.
- Returns
- If the key of the node is None, a dictionary of all serialized child nodes as value is returned, else a list containing the key and the dictionary of all serialized child nodes as value is returned
◆ children
carputils.cml.cmltree.CMLDictBranch.children |
list to hold the children
The documentation for this class was generated from the following file: