From 49c7685bb226d136f744e4fd727f5483dca32cf6 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Fri, 22 Oct 2021 22:17:23 +0200 Subject: [PATCH] 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. kvid rebased and mixed original commit with similar change by Daniel Rojas Co-authored-by: kvid --- src/wireviz/wireviz.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wireviz/wireviz.py b/src/wireviz/wireviz.py index 7bcaa32..cf851f8 100755 --- a/src/wireviz/wireviz.py +++ b/src/wireviz/wireviz.py @@ -115,8 +115,9 @@ def parse( # keep track of auto-generated designators to avoid duplicates autogenerated_designators = {} + # When title is not given, either deduce it from filename, or use default text. if "title" not in harness.metadata: - harness.metadata["title"] = Path(yaml_file).stem if yaml_file else "" + harness.metadata["title"] = Path(yaml_file).stem if yaml_file else "WireViz diagram and BOM" # add items # parse YAML input file ====================================================