comparison env/lib/python3.9/site-packages/galaxy/tool_util/cwl/runnable.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4f3585e2f14b
1 """Lighter-weight variant of Planemo runnable outputs."""
2 from galaxy.tool_util.parser import get_tool_source
3 from .parser import workflow_proxy
4 from .util import guess_artifact_type
5
6
7 def get_outputs(path):
8 tool_or_workflow = guess_artifact_type(path)
9 if tool_or_workflow == "tool":
10 tool_source = get_tool_source(path)
11 output_datasets, _ = tool_source.parse_outputs(None)
12 outputs = [ToolOutput(o) for o in output_datasets.values()]
13 return outputs
14 else:
15 workflow = workflow_proxy(path, strict_cwl_validation=False)
16 return [CwlWorkflowOutput(label) for label in workflow.output_labels]
17
18
19 class CwlWorkflowOutput:
20
21 def __init__(self, label):
22 self._label = label
23
24 def get_id(self):
25 return self._label
26
27
28 class ToolOutput:
29
30 def __init__(self, tool_output):
31 self._tool_output = tool_output
32
33 def get_id(self):
34 return self._tool_output.name