Skip to content

Commit cfe5a54

Browse files
committed
refactor: address review comments
1 parent 903032c commit cfe5a54

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/opossum_lib/spdx/convert_to_opossum.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import logging
66
import sys
77
import uuid
8+
from pathlib import PurePath
89
from typing import Any
910

1011
from networkx import DiGraph
@@ -74,9 +75,7 @@ def convert_spdx_to_opossum_information(filename: str) -> OpossumFileContent:
7475

7576
def convert_tree_to_opossum(tree: DiGraph) -> Opossum:
7677
metadata = create_metadata(tree)
77-
resources = [] # Resource(type=ResourceType.TOP_LEVEL)
78-
# resources_to_attributions: dict[str, list[str]] = dict()
79-
# external_attributions: dict[str, OpossumPackage] = dict()
78+
resources = []
8079
attribution_to_id: dict[OpossumPackage, str] = {}
8180
attribution_breakpoints = []
8281
external_attribution_sources = {
@@ -98,7 +97,7 @@ def convert_tree_to_opossum(tree: DiGraph) -> Opossum:
9897
"A tree should always have a node without incoming edge."
9998
)
10099
source_file_path = _get_file_path(connected_subgraph, source, source)
101-
rootnode = Resource(path=source_file_path)
100+
rootnode = Resource(path=PurePath(source_file_path))
102101
resources.append(rootnode)
103102
for node_label in connected_subgraph.nodes():
104103
node = connected_subgraph.nodes[node_label]

0 commit comments

Comments
 (0)