From 4a40372f00e2a4277b566127bdca4c884b0073ad Mon Sep 17 00:00:00 2001 From: Harold Martin Date: Wed, 6 Nov 2024 15:37:45 -0800 Subject: [PATCH] ignore shape in graph object override - fixes #98 (#103) * ignore shape in graph object override - fixes #98 * only ignore shape when it is none, prevent g2d output in spec test * update subgraph.xml spec --- graphviz2drawio/mx/GraphObj.py | 2 ++ specs/directed/subgraph.xml | 14 +++++++------- test_specs.sh | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/graphviz2drawio/mx/GraphObj.py b/graphviz2drawio/mx/GraphObj.py index d79bb2b..483dab2 100644 --- a/graphviz2drawio/mx/GraphObj.py +++ b/graphviz2drawio/mx/GraphObj.py @@ -15,4 +15,6 @@ def enrich_from_graph(self, attrs: dict | None) -> None: continue if k in _blacklist_attrs: continue + if k == "shape" and v == "none": + continue self.__setattr__(k, v) diff --git a/specs/directed/subgraph.xml b/specs/directed/subgraph.xml index 5be6476..430d917 100644 --- a/specs/directed/subgraph.xml +++ b/specs/directed/subgraph.xml @@ -8,37 +8,37 @@ - + - + - + - + - + - + - + diff --git a/test_specs.sh b/test_specs.sh index 2d13f0d..3343e21 100755 --- a/test_specs.sh +++ b/test_specs.sh @@ -25,8 +25,8 @@ process_files() { rel_path="${file#$src_dir/}" output_file="$out_dir/${rel_path%.gv.txt}.xml" mkdir -p "$(dirname "$output_file")" - python3 -m graphviz2drawio "$file" -o "$output_file" - echo "Processed: $file -> $output_file" + python3 -m graphviz2drawio "$file" -o "$output_file" > /dev/null 2>&1 + echo "Processed: $file -> $output_file ($?)" done }