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,8 +40,13 @@ def parse(yaml_input: str, file_out: (str, Path) = None, return_types: (None, st
|
||||
options = Options(**yaml_data.get('options', {})),
|
||||
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:
|
||||
harness.metadata['title'] = Path(file_out).stem
|
||||
if file_out is None:
|
||||
harness.metadata['title'] = "WireViz diagram and BOM"
|
||||
else:
|
||||
harness.metadata['title'] = Path(file_out).stem
|
||||
|
||||
# add items
|
||||
sections = ['connectors', 'cables', 'connections']
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user