From 9d1700c4a04c5b679f51f1489418ef8464a0c6e2 Mon Sep 17 00:00:00 2001 From: Daniel Rojas Date: Sat, 1 Mar 2025 17:25:31 +0100 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: Andreas Motl Co-authored-by: kvid --- src/wireviz/wireviz.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wireviz/wireviz.py b/src/wireviz/wireviz.py index f8b2ef8..e147708 100755 --- a/src/wireviz/wireviz.py +++ b/src/wireviz/wireviz.py @@ -116,8 +116,11 @@ 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 ====================================================