stree.StringTree.find(): Add method

StringTree.find(key, val) (and Config.find(), for that matter)
returns a list of paths with sections containing children matching
key / val pairs. One of them can be None, which acts as a wildcard.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-05-29 12:05:10 +02:00
commit b464f20e6c
2 changed files with 78 additions and 1 deletions

View file

@ -158,3 +158,9 @@ class Config(): # export
@property
def name(self):
return self.__conf.content
def find(self, key: str|None, val: str|None, match:StringTree.Match=StringTree.Match.Equal) -> list[str]:
return self.__conf.find(key, val, match=match)
#def __getattr__(self, name: str):
# return getattr(self.__conf, name)