Improve gracefulness when invoking wireviz.parse() without file_out
This happened to be a regression for WireViz-Web [1], which aims to do as much in memory as possible. [1] https://github.com/daq-tools/wireviz-web.
This commit is contained in:
parent
be1ecd4f63
commit
80b7a5407b
@ -40,7 +40,12 @@ def parse(yaml_input: str, file_out: (str, Path) = None, return_types: (None, st
|
|||||||
options = Options(**yaml_data.get('options', {})),
|
options = Options(**yaml_data.get('options', {})),
|
||||||
tweak = Tweak(**yaml_data.get('tweak', {})),
|
tweak = Tweak(**yaml_data.get('tweak', {})),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# When title is not given, either deduce it from filename, or use default text.
|
||||||
if 'title' not in harness.metadata:
|
if 'title' not in harness.metadata:
|
||||||
|
if file_out is None:
|
||||||
|
harness.metadata['title'] = "WireViz diagram and BOM"
|
||||||
|
else:
|
||||||
harness.metadata['title'] = Path(file_out).stem
|
harness.metadata['title'] = Path(file_out).stem
|
||||||
|
|
||||||
# add items
|
# add items
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user