There was an error while loading. Please reload this page.
2 parents 3387a34 + 6519118 commit 53d415cCopy full SHA for 53d415c
create_cwl_from_objects.py
@@ -0,0 +1,29 @@
1
+#!/usr/bin/env python3
2
+# SPDX-License-Identifier: Apache-2.0
3
+import cwl_utils.parser_v1_2 as cwl
4
+
5
+from ruamel import yaml
6
7
+def main() -> None:
8
+ """Generate a CWL object to match "cat-tool.cwl"."""
9
+ inputs = [cwl.CommandInputParameter(id="file1", type="File")]
10
+ outputs = [
11
+ cwl.CommandOutputParameter(
12
+ id="output",
13
+ type="File",
14
+ outputBinding=cwl.CommandOutputBinding(glob="output"),
15
+ )
16
+ ]
17
+ cat_tool = cwl.CommandLineTool(
18
+ inputs=inputs,
19
+ outputs=outputs,
20
+ cwlVersion="v1.2",
21
+ baseCommand="cat",
22
+ stdin="$(inputs.file1.path)",
23
+ stdout="output",
24
25
+ print(yaml.main.round_trip_dump(cat_tool.save()))
26
27
28
+if __name__ == "__main__":
29
+ main()
0 commit comments