Skip to content

Commit

Permalink
move temp file creation from init to get_graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
muddymudskipper committed Jun 21, 2024
1 parent 021687a commit ff0572c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmem_plugin_robotreason/plugin_robotreason.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ def __init__(
self.result_iri = result_iri
self.reasoner = reasoner
self.temp = f"robot_{uuid4().hex}"
if not Path(self.temp).exists():
Path(self.temp).mkdir(parents=True)

def create_xml_catalog_file(self, graphs: dict) -> None:
"""Create XML catalog file"""
Expand All @@ -129,6 +127,8 @@ def create_xml_catalog_file(self, graphs: dict) -> None:

def get_graphs(self, graphs: dict) -> None:
"""Get graphs from CMEM"""
if not Path(self.temp).exists():
Path(self.temp).mkdir(parents=True)
for graph in graphs:
with (Path(self.temp) / graphs[graph]).open("w", encoding="utf-8") as file:
file.write(get(graph).text)
Expand Down

0 comments on commit ff0572c

Please sign in to comment.