@@ -263,24 +263,30 @@ class ProcStreamlines(StdOutCommandLine):
263
263
input_spec = ProcStreamlinesInputSpec
264
264
output_spec = ProcStreamlinesOutputSpec
265
265
266
+ def _format_arg (self , name , spec , value ):
267
+ if name == 'outputroot' :
268
+ newval = self ._get_actual_ouputroot (value )
269
+ arg = '-outputroot ' + newval
270
+ return arg
271
+ return super (ProcStreamlines , self )._format_arg (name , spec , value )
272
+
266
273
def _run_interface (self , runtime ):
267
274
outputroot = self .inputs .outputroot
268
275
if isdefined (outputroot ):
269
- outputroot = os . path . join ( 'procstream_outfiles' , outputroot )
270
- base , filename , ext = split_filename (outputroot )
276
+ actual_outputroot = self . _get_actual_ouputroot ( outputroot )
277
+ base , filename , ext = split_filename (actual_outputroot )
271
278
if not os .path .exists (base ):
272
279
os .makedirs (base )
273
- self .inputs .outputroot = outputroot
274
280
new_runtime = super (ProcStreamlines , self )._run_interface (runtime )
275
- self .outputroot_files = self . _get_ouputroot_files ( outputroot )
281
+ self .outputroot_files = glob . glob ( os . path . join ( os . getcwd (), actual_outputroot + '*' ) )
276
282
return new_runtime
277
283
else :
278
284
new_runtime = super (ProcStreamlines , self )._run_interface (runtime )
279
285
return new_runtime
280
286
281
- def _get_ouputroot_files (self , outputroot ):
282
- outputroot_files = glob . glob ( os .path .join (os . getcwd (), outputroot + '*' ) )
283
- return outputroot_files
287
+ def _get_actual_ouputroot (self , outputroot ):
288
+ actual_outputroot = os .path .join ('procstream_outfiles' , outputroot )
289
+ return actual_outputroot
284
290
285
291
def _list_outputs (self ):
286
292
outputs = self .output_spec ().get ()
0 commit comments