From bcd1bcbe39d71372603243af28a269400ba1eb05 Mon Sep 17 00:00:00 2001
From: George Marchment <georgemarchment@yahoo.fr>
Date: Mon, 19 Feb 2024 15:34:12 +0100
Subject: [PATCH] Update Ro-Crate Profile

---
 src/ro_crate.py | 7 ++++---
 src/workflow.py | 4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/ro_crate.py b/src/ro_crate.py
index 3b180dd..6330b41 100644
--- a/src/ro_crate.py
+++ b/src/ro_crate.py
@@ -39,8 +39,8 @@ class RO_Crate:
         root["name"] = self.workflow.get_name()
         root["datePublished"] = self.workflow.get_datePublished()
         root["description"] = self.workflow.get_description()
-        root["mainEntity"] = {"@id": self.workflow.get_main_file(),
-                              "@type":["File", "SoftwareSourceCode"]} #We do not consider a File as a "ComputationalWorkflow" since multiple (sub)workflows can be defined in a same file
+        root["mainEntity"] = {"@id": self.workflow.get_main_file()}
+                              #, "@type":["File", "SoftwareSourceCode"]} #We do not consider a File as a "ComputationalWorkflow" since multiple (sub)workflows can be defined in a same file
         root["license"] = {"@id":self.workflow.get_license()}
         authors = self.workflow.get_authors()
         tab_authors = []
@@ -77,7 +77,7 @@ class RO_Crate:
         current_directory = os.getcwd()
         os.chdir("/".join(self.workflow.nextflow_file.get_file_address().split("/")[:-1]))
         try:           
-            os.system(f"git log {'--reverse'*reverse} {file} > temp_{id(self)}.txt >/dev/null 2>&1")
+            os.system(f"git log {'--reverse'*reverse} {file} > temp_{id(self)}.txt")
             with open(f'temp_{id(self)}.txt') as f:
                 info = f.read()
             os.system(f"rm temp_{id(self)}.txt")
@@ -153,6 +153,7 @@ class RO_Crate:
         for file in self.files:
             self.initialise_file(file)
         self.fill_from_workflow()
+        self.dico.pop("temp_directory")
 
         with open(f"{self.workflow.get_output_dir()}/ro-crate-metadata-{self.workflow.get_name()}.json", 'w') as output_file :
             json.dump(self.dico, output_file, indent=2)
\ No newline at end of file
diff --git a/src/workflow.py b/src/workflow.py
index cd29a6a..b29ea75 100644
--- a/src/workflow.py
+++ b/src/workflow.py
@@ -37,7 +37,7 @@ class Workflow:
         current_directory = os.getcwd()
         os.chdir("/".join(self.nextflow_file.get_file_address().split("/")[:-1]))
         try:
-            os.system(f"git log --reverse > temp_{id(self)}.txt >/dev/null 2>&1")
+            os.system(f"git log --reverse > temp_{id(self)}.txt")
             with open(f'temp_{id(self)}.txt') as f:
                 self.log = f.read()
             os.system(f"rm temp_{id(self)}.txt")
@@ -52,7 +52,7 @@ class Workflow:
         current_directory = os.getcwd()
         os.chdir("/".join(self.nextflow_file.get_file_address().split("/")[:-1]))
         try:
-            os.system(f"git ls-remote --get-url origin > temp_address_{id(self)}.txt >/dev/null 2>&1")
+            os.system(f"git ls-remote --get-url origin > temp_address_{id(self)}.txt")
             with open(f'temp_address_{id(self)}.txt') as f:
                 self.address = f.read()
             os.system(f"rm temp_address_{id(self)}.txt")
-- 
GitLab