Skip to content

Commit 970152e

Browse files
author
Anton Khodak
committed
Run "#main resolved object by default
1 parent 6670a19 commit 970152e

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

cwltool/load_tool.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,21 @@ def make_tool(document_loader, # type: Loader
281281
"""Make a Python CWL object."""
282282
resolveduri = document_loader.resolve_ref(uri)[0]
283283

284+
processobj = None
284285
if isinstance(resolveduri, list):
285286
if len(resolveduri) == 1:
286287
processobj = resolveduri[0]
287288
else:
288-
raise WorkflowException(
289-
u"Tool file contains graph of multiple objects, must specify "
290-
"one of #%s" % ", #".join(
291-
urllib.parse.urldefrag(i["id"])[1] for i in resolveduri
292-
if "id" in i))
289+
for obj in resolveduri:
290+
if obj['id'].endswith('#main'):
291+
processobj = obj
292+
break
293+
if not processobj:
294+
raise WorkflowException(
295+
u"Tool file contains graph of multiple objects, must specify "
296+
"one of #%s" % ", #".join(
297+
urllib.parse.urldefrag(i["id"])[1] for i in resolveduri
298+
if "id" in i))
293299
elif isinstance(resolveduri, dict):
294300
processobj = resolveduri
295301
else:

0 commit comments

Comments
 (0)