diff --git a/tools/python/jwutils/stree/serdes.py b/tools/python/jwutils/stree/serdes.py index 508b671..241e1b6 100644 --- a/tools/python/jwutils/stree/serdes.py +++ b/tools/python/jwutils/stree/serdes.py @@ -20,9 +20,9 @@ def _cleanup_line(line): return r[1:-1] return r -def parse(s, allow_full_lines=True): # export +def parse(s, allow_full_lines=True, root_content='root'): # export slog(DEBUG, "parsing", s) - root = StringTree('', content='root') + root = StringTree('', content=root_content) sec = '' for line in s.splitlines(): slog(DEBUG, "line=", line) @@ -66,7 +66,7 @@ def parse(s, allow_full_lines=True): # export root.add(sec + '.' + cleanup_string(lhs), cleanup_string(rhs), split=split) return root -def read(path): # export +def read(path, root_content='root'): # export with open(path, 'r') as infile: s = infile.read() - return parse(s) + return parse(s, root_content=root_content)