Skip to content

Commit 948b7d4

Browse files
committed
Fix find-replace error
1 parent 7256865 commit 948b7d4

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

janisdk/fromwdl/__init__.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
def add_fromwdl_args(parser):
2+
parser.description = (
3+
"Parse a WDL command line tool / workflow and write it as a Janis file"
4+
)
5+
6+
parser.add_argument(
7+
"-o",
8+
"--output",
9+
help="Directory to output the workflow / tools to, otherwise this is written to stdout",
10+
)
11+
12+
parser.add_argument("wdlfile", help="The path to the WDL file")
13+
14+
parser.add_argument(
15+
"translation", default="janis", choices=["cwl", "wdl", "janis"], nargs="?"
16+
)
17+
18+
return parser
19+
20+
21+
def do_fromwdl(args):
22+
from janis_core import WdlParser, Logger
23+
24+
25+
Logger.info(f"Loading WDL file: {args.wdlfile}")
26+
tool = WdlParser.from_doc(args.wdlfile)
27+
28+
Logger.info(f"Loaded {tool.type()}: {tool.versioned_id()}")
29+
30+
translated = tool.translate(
31+
args.translation,
32+
to_console=args.output is None,
33+
to_disk=args.output is not None,
34+
export_path=args.output,
35+
)
36+
37+
return translated

0 commit comments

Comments
 (0)