File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,7 @@ def bind_input(self,
195
195
discover_secondaryFiles , # type: bool
196
196
lead_pos = None , # type: Optional[Union[int, List[int]]]
197
197
tail_pos = None , # type: Optional[List[int]]
198
+ cwl_version = None # type: Optional[Text]
198
199
): # type: (...) -> List[MutableMapping[Text, Any]]
199
200
200
201
if tail_pos is None :
@@ -211,7 +212,12 @@ def bind_input(self,
211
212
212
213
bp = list (aslist (lead_pos ))
213
214
if "position" in binding :
214
- bp .extend (aslist (binding ["position" ]))
215
+ position = binding ["position" ]
216
+ if isinstance (position , str ) and cwl_version != "v1.0" :
217
+ binding ['position' ] = self .do_eval (position , context = datum )
218
+ bp .append (binding ['position' ])
219
+ else :
220
+ bp .extend (aslist (binding ['position' ]))
215
221
else :
216
222
bp .append (0 )
217
223
bp .extend (aslist (tail_pos ))
Original file line number Diff line number Diff line change @@ -703,9 +703,13 @@ def inc(d): # type: (List[int]) -> None
703
703
tmpdir ,
704
704
stagedir )
705
705
706
+ cwl_version = self .metadata .get (
707
+ "http://commonwl.org/cwltool#original_cwlVersion" , None )
708
+
706
709
bindings .extend (builder .bind_input (
707
710
self .inputs_record_schema , job ,
708
- discover_secondaryFiles = getdefault (runtime_context .toplevel , False )))
711
+ discover_secondaryFiles = getdefault (runtime_context .toplevel , False ),
712
+ cwl_version = cwl_version ))
709
713
710
714
if self .tool .get ("baseCommand" ):
711
715
for index , command in enumerate (aslist (self .tool ["baseCommand" ])):
@@ -722,7 +726,12 @@ def inc(d): # type: (List[int]) -> None
722
726
if isinstance (arg , MutableMapping ):
723
727
arg = copy .deepcopy (arg )
724
728
if arg .get ("position" ):
725
- arg ["position" ] = [arg ["position" ], i ]
729
+ position = arg .get ("position" )
730
+ if isinstance (position , str ) and cwl_version != "v1.0" :
731
+ position = builder .do_eval (position )
732
+ if position is None :
733
+ position = 0
734
+ arg ["position" ] = [position , i ]
726
735
else :
727
736
arg ["position" ] = [0 , i ]
728
737
bindings .append (arg )
You can’t perform that action at this time.
0 commit comments