Skip to content

Commit

Permalink
authenticate before each graph download
Browse files Browse the repository at this point in the history
  • Loading branch information
muddymudskipper committed Jun 26, 2024
1 parent d802a66 commit ec4ebcf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmem_plugin_robotreason/plugin_robotreason.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,13 @@ def create_xml_catalog_file(self, graphs: dict) -> None:
file.truncate(0)
file.write(reparsed)

def get_graphs(self, graphs: dict) -> None:
def get_graphs(self, graphs: dict, context: ExecutionContext) -> 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:
setup_cmempy_user_access(context.user)
file.write(get(graph).text)
if graph == self.data_graph_iri:
file.write(
Expand Down Expand Up @@ -394,7 +395,7 @@ def execute(self, inputs: Sequence[Entities], context: ExecutionContext) -> None
"""Execute plugin"""
setup_cmempy_user_access(context.user)
graphs = self.get_graphs_tree()
self.get_graphs(graphs)
self.get_graphs(graphs, context)
self.create_xml_catalog_file(graphs)
self.reason(graphs)
setup_cmempy_user_access(context.user)
Expand Down

0 comments on commit ec4ebcf

Please sign in to comment.