scientiflow-cli 0.4.1__py3-none-any.whl → 0.4.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -109,34 +109,27 @@ class PipelineExecutor:
109
109
  except Exception as e:
110
110
  print(f"[ERROR] Failed to update terminal output: {e}")
111
111
 
112
+
112
113
  # def replace_variables(self, command: str) -> str:
113
114
  # """Replace placeholders like ${VAR} with environment values."""
115
+ # print(self.environment_variables)
114
116
  # return re.sub(r'\$\{(\w+)\}', lambda m: self.environment_variables.get(m.group(1), m.group(0)), command)
115
117
 
116
- # def replace_variables(self, command: str) -> str:
117
- # def replacer(match):
118
- # key = match.group(1)
119
- # value = self.environment_variables.get(key, match.group(0))
120
- # if isinstance(value, list):
121
- # # Convert list to safe, space-separated string
122
- # return " ".join(shlex.quote(str(v)) for v in value)
123
- # return shlex.quote(str(value)) if isinstance(value, str) else str(value)
124
- # replaced_command = re.sub(r'\$\{(\w+)\}', replacer, command)
125
- # return replaced_command
126
-
127
118
  def replace_variables(self, command: str) -> str:
119
+ """Replace placeholders like ${VAR} with environment values.
120
+ - If value is a list: safely join into space-separated arguments (quoted).
121
+ - Otherwise: use the old behavior (direct substitution).
122
+ """
128
123
  def replacer(match):
129
124
  key = match.group(1)
130
125
  value = self.environment_variables.get(key, match.group(0))
126
+ # ✅ Special handling for lists
131
127
  if isinstance(value, list):
132
- # ✅ Only modify behavior for lists — safely join them
133
128
  return " ".join(shlex.quote(str(v)) for v in value)
134
- # ✅ For strings, keep old behavior (no quoting)
135
- return value if isinstance(value, str) else str(value)
136
-
137
- replaced_command = re.sub(r'\$\{(\w+)\}', replacer, command)
138
- return replaced_command
139
-
129
+ # ✅ Default: keep original behavior for strings, numbers, None
130
+ return self.environment_variables.get(key, match.group(0))
131
+ return re.sub(r'\$\{(\w+)\}', replacer, command)
132
+
140
133
 
141
134
  def execute_command(self, command: str):
142
135
  """Run the command in the terminal, display output in real-time, and log the captured output."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scientiflow-cli
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: CLI tool for scientiflow. This application runs on the client side, decodes pipelines, and executes them in the configured order!
5
5
  License: Proprietary
6
6
  Author: ScientiFlow
@@ -8,7 +8,7 @@ scientiflow_cli/config.py,sha256=_ThqpT5MpbE3fYh7WfmMQj6WLoEN5NNVkYMRvxv4ANc,345
8
8
  scientiflow_cli/main.py,sha256=TwCRK381_TYrJ5LAXlsSJdJVe8LhfD2SWGBtGp6hRFk,5278
9
9
  scientiflow_cli/pipeline/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  scientiflow_cli/pipeline/container_manager.py,sha256=KAnE5AvsSg4cewLc_v4gWCqhKGoc7ycHOtl_HYxUK7E,8444
11
- scientiflow_cli/pipeline/decode_and_execute.py,sha256=4jGwv1g2esQ0u0J36Emf0TAKisQ7ANjGiDHZfD-BYSs,16737
11
+ scientiflow_cli/pipeline/decode_and_execute.py,sha256=UxvEU5g--OMd_J3dt8PIcGeF82uDL2uanY54ZVbRk-M,16398
12
12
  scientiflow_cli/pipeline/get_jobs.py,sha256=69jOIVwXd8j2lAYy28r2QcsjFT4yRpXNOqsfopiZhFs,1498
13
13
  scientiflow_cli/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  scientiflow_cli/services/auth_service.py,sha256=lknARfVTjRCH-4yWVPKiS330NIVHxFw3HlQdN2Lw3Og,3343
@@ -23,8 +23,8 @@ scientiflow_cli/utils/file_manager.py,sha256=J6FBaZ0xz6OH4vcArOGj5KqKSZ2AD78HNei
23
23
  scientiflow_cli/utils/logger.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  scientiflow_cli/utils/mock.py,sha256=UZ9cN2Qx3EAXcxnLQY5z4DQWy4jflnWFnfNTsuvnFH8,11237
25
25
  scientiflow_cli/utils/singularity.py,sha256=MPBMpL_9ik9mKApht9LKf1zlyMjNk8GGfKFhbrZHErs,4747
26
- scientiflow_cli-0.4.1.dist-info/LICENSE.md,sha256=nb6GGGYuS_KXe33mSNwcEW-QzvwM475NQ4cNE7KBb34,425
27
- scientiflow_cli-0.4.1.dist-info/METADATA,sha256=uyLky9fOE6TjEWNxhpw-YfgCAba4IfTchxKXHuwJG-w,2491
28
- scientiflow_cli-0.4.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
29
- scientiflow_cli-0.4.1.dist-info/entry_points.txt,sha256=0lq2mjcG5hGfODrQodeMSAy9RfE2EX1MZSHRpfSncxc,61
30
- scientiflow_cli-0.4.1.dist-info/RECORD,,
26
+ scientiflow_cli-0.4.2.dist-info/LICENSE.md,sha256=nb6GGGYuS_KXe33mSNwcEW-QzvwM475NQ4cNE7KBb34,425
27
+ scientiflow_cli-0.4.2.dist-info/METADATA,sha256=aPNmj6g_5enMVn2qHCkItfBIK-cmkKzW9x9TkndHOF4,2491
28
+ scientiflow_cli-0.4.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
29
+ scientiflow_cli-0.4.2.dist-info/entry_points.txt,sha256=0lq2mjcG5hGfODrQodeMSAy9RfE2EX1MZSHRpfSncxc,61
30
+ scientiflow_cli-0.4.2.dist-info/RECORD,,