stree.StringTree: Add property path

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-05-29 12:04:52 +02:00
commit a9fa274bb1

View file

@ -135,6 +135,15 @@ class StringTree: # export
for name, child in self.children.items():
child.__dump(prio, indent=indent, caller=caller)
@property
def path(self):
if self.__parent is None:
return ''
prefix = self.__parent.path
if len(prefix):
prefix += '.'
return prefix + self.content
def keys(self):
return self.children.keys()