From 1984be894aad0361d765dacf7e272ca618520fbd Mon Sep 17 00:00:00 2001 From: Adrian Braemer Date: Tue, 21 Jan 2025 12:47:33 +0100 Subject: [PATCH] fix: paths on windows by replacing \ with / --- src/opossum_lib/opossum_model.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/opossum_lib/opossum_model.py b/src/opossum_lib/opossum_model.py index b78332f..1bd4a1a 100644 --- a/src/opossum_lib/opossum_model.py +++ b/src/opossum_lib/opossum_model.py @@ -90,7 +90,7 @@ def create_attribution_mapping( ] = {} def process_node(node: Resource) -> None: - path = str(node.path) + path = str(node.path).replace("\\", "/") if not path.startswith("/"): # the / is required by OpossumUI path = "/" + path @@ -133,7 +133,9 @@ def to_opossum_file_format(self) -> opossum_file.ResourceInFile: return 1 else: return { - str(child.path.relative_to(self.path)): child.to_opossum_file_format() + str(child.path.relative_to(self.path)).replace( + "\\", "/" + ): child.to_opossum_file_format() for child in self.children.values() }