dts: edtlib: Add an EDT.dts_source attribute that holds the source code
EDT.dts_source is the source code of the loaded .dts file, after merging nodes. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
parent
08d2cd304a
commit
a758af4988
1 changed files with 8 additions and 0 deletions
|
@ -118,6 +118,10 @@ class EDT:
|
|||
dts_path:
|
||||
The .dts path passed to __init__()
|
||||
|
||||
dts_source:
|
||||
The final DTS source code of the loaded devicetree after merging nodes
|
||||
and processing /delete-node/ and /delete-property/, as a string
|
||||
|
||||
bindings_dirs:
|
||||
The bindings directory paths passed to __init__()
|
||||
"""
|
||||
|
@ -178,6 +182,10 @@ class EDT:
|
|||
# to_path() checks that the node exists
|
||||
return self._node2enode[chosen.props[name].to_path()]
|
||||
|
||||
@property
|
||||
def dts_source(self):
|
||||
return f"{self._dt}"
|
||||
|
||||
def __repr__(self):
|
||||
return "<EDT for '{}', binding directories '{}'>".format(
|
||||
self.dts_path, self.bindings_dirs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue