diff --git a/tools/python/jwutils/stree/StringTree.py b/tools/python/jwutils/stree/StringTree.py index 72a9da4..afb391d 100644 --- a/tools/python/jwutils/stree/StringTree.py +++ b/tools/python/jwutils/stree/StringTree.py @@ -149,6 +149,14 @@ class StringTree: # export return None return self.children[next(reversed(self.children))].content + def child_list(self, depth_first=True): + if depth_first == False: + raise Exception("tried to retrieve child list with breadth-first search, not yet implemented") + r = [] + for c in self.children: + r.append(c) + r.extend(c.to_list()) + def dump(self, prio, *args, **kwargs): caller = kwargs['caller'] if 'caller' in kwargs.keys() else get_caller_pos(1) msg = ''