Skip to content

Commit

Permalink
Rewrite CWL tools.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Nov 20, 2019
1 parent bfbdae9 commit 9a8855d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/galaxy/tool_util/cwl/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

RawProcessReference = namedtuple("RawProcessReference", ["loading_context", "process_object", "uri"])
ResolvedProcessDefinition = namedtuple("ResolvedProcessDefinition", ["loading_context", "uri", "raw_process_reference"])
REWRITE_EXPRESSIONS = True


class SchemaLoader(object):
Expand All @@ -37,8 +38,15 @@ def loading_context(self):
return loading_context

def raw_process_reference(self, path, loading_context=None):
uri = "file://" + os.path.abspath(path)
path = os.path.abspath(path)
uri = "file://" + path
loading_context = loading_context or self.loading_context()
if REWRITE_EXPRESSIONS and not uri.endswith(".galaxy"):
galaxy_path = os.path.abspath(path) + ".galaxy"
from cwl_utils import etools_to_clt
etools_to_clt.main([path, galaxy_path])
galaxy_uri = "file://" + galaxy_path
uri = galaxy_uri
loading_context, process_object, uri = load_tool.fetch_document(uri, loadingContext=loading_context)
return RawProcessReference(loading_context, process_object, uri)

Expand Down

0 comments on commit 9a8855d

Please sign in to comment.