From 364313a9beec327fc16b43e918190bd449d8443d Mon Sep 17 00:00:00 2001
From: George Marchment <georgemarchment@yahoo.fr>
Date: Thu, 17 Apr 2025 11:38:58 +0200
Subject: [PATCH] Debugged a small thing in the rewritte of single line
 conditions

---
 src/code_.py    | 2 +-
 src/workflow.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/code_.py b/src/code_.py
index 5c315b9..f5a3250 100644
--- a/src/code_.py
+++ b/src/code_.py
@@ -109,7 +109,7 @@ class Code:
                                 extracted_condition = get_code_until_parenthese_count(code=temp_code[end_condition:], val=-1)
                                 condition = extracted_condition[:-1]
                                 #body = extarcted.replace(extracted_condition.strip(), "", 1).strip()
-                                body = re.sub(r"if *\("+re.escape(extracted_condition.strip()), "", all).strip()
+                                body = re.sub(r"if *\( *"+re.escape(extracted_condition.strip()), "", all).strip()
                                 if(body!="" and body[0]!="{"):
                                     new = f"if ({condition}) {{\n{body}\n}}\n"
                                     to_replace.append((all, new))
diff --git a/src/workflow.py b/src/workflow.py
index 3aacb38..73c97d7 100644
--- a/src/workflow.py
+++ b/src/workflow.py
@@ -1082,7 +1082,7 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
                     for ele in c:
                         if(ele.get_type()=="Operation"):
                             if(ele.get_create_loop_with_call_status()):
-                                raise BioFlowInsightError(f'BioFlow-Insight cannot rewrite the workflows since the operation "{ele.get_code(get_OG = True)}" creates the channel on which it depends.', type="Rewrite Error")
+                                raise BioFlowInsightError(f'BioFlow-Insight cannot rewrite the workflows since the operation "{ele.get_code(get_OG = True)}" defines the channel on which it depends. Simply try to renaming the channel.', type="Rewrite Error")
                             if(ele.get_artificial_status()==False):
                                 tab.append(ele)
                         else:
-- 
GitLab