mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-python
synced 2026-01-15 09:53:32 +01:00
stree.StringTree: Add property path
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
9c13381e7a
commit
a9fa274bb1
1 changed files with 9 additions and 0 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue