From 7846fd103df085b9a6f5c5e62a27b6e44457b1da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bol=C3=ADvar?= Date: Wed, 12 Feb 2020 22:18:39 -0800 Subject: [PATCH] edtlib: add 'labels' attribute to Node class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This corresponds to the attribute by the same name in dtlib.Node. Signed-off-by: Martí Bolívar --- scripts/dts/edtlib.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/dts/edtlib.py b/scripts/dts/edtlib.py index d0841b65dd8..fd943b7a2c7 100644 --- a/scripts/dts/edtlib.py +++ b/scripts/dts/edtlib.py @@ -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"