edtlib: add 'labels' attribute to Node class

This corresponds to the attribute by the same name in dtlib.Node.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Martí Bolívar 2020-02-12 22:18:39 -08:00 committed by Kumar Gala
commit 7846fd103d

View file

@ -712,6 +712,14 @@ class Node:
The text from the 'label' property on the node, or None if the node has
no 'label'
labels:
A list of all of the devicetree labels for the node, in the same order
as the labels appear, but with duplicates removed.
This corresponds to the actual devicetree source labels, unlike the
"label" attribute, which is the value of a devicetree property named
"label".
parent:
The Node instance for the devicetree parent of the Node, or None if the
node is the root node
@ -844,6 +852,11 @@ class Node:
return self._node.props["label"].to_string()
return None
@property
def labels(self):
"See the class docstring"
return self._node.labels
@property
def parent(self):
"See the class docstring"