Skip to content

Commit d4d3a1e

Browse files
committed
refactor: Allow stdin/stdout buffers to be passed to Nodes without tmp file
1 parent ba00291 commit d4d3a1e

File tree

1 file changed

+6
-2
lines changed
  • back-end/pyworkflow/pyworkflow

1 file changed

+6
-2
lines changed

back-end/pyworkflow/pyworkflow/node.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from .parameters import *
2-
2+
import io
33

44
class Node:
55
"""Node object
@@ -58,7 +58,11 @@ def get_execution_options(self, workflow, flow_nodes):
5858
else:
5959
replacement_value = option.get_value()
6060

61-
if key == 'file':
61+
if key == 'file' and type(replacement_value) == io.TextIOWrapper:
62+
# For files specified via stdin/stdout, store directly
63+
option.set_value(replacement_value)
64+
elif key == 'file':
65+
# Otherwise, point to filepath stored in Workflow directory
6266
option.set_value(workflow.path(replacement_value))
6367

6468
execution_options[key] = option

0 commit comments

Comments
 (0)