Skip to content

Commit

Permalink
Fix find-replace error
Browse files Browse the repository at this point in the history
  • Loading branch information
illusional committed Sep 1, 2021
1 parent 7256865 commit 948b7d4
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions janisdk/fromwdl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
def add_fromwdl_args(parser):
parser.description = (
"Parse a WDL command line tool / workflow and write it as a Janis file"
)

parser.add_argument(
"-o",
"--output",
help="Directory to output the workflow / tools to, otherwise this is written to stdout",
)

parser.add_argument("wdlfile", help="The path to the WDL file")

parser.add_argument(
"translation", default="janis", choices=["cwl", "wdl", "janis"], nargs="?"
)

return parser


def do_fromwdl(args):
from janis_core import WdlParser, Logger


Logger.info(f"Loading WDL file: {args.wdlfile}")
tool = WdlParser.from_doc(args.wdlfile)

Logger.info(f"Loaded {tool.type()}: {tool.versioned_id()}")

translated = tool.translate(
args.translation,
to_console=args.output is None,
to_disk=args.output is not None,
export_path=args.output,
)

return translated

0 comments on commit 948b7d4

Please sign in to comment.