@@ -275,9 +275,8 @@ class DataGrabberInputSpec(DynamicTraitedSpec): #InterfaceInputSpec):
275
275
desc = 'Sort the filelist that matches the template' )
276
276
template = traits .Str (mandatory = True ,
277
277
desc = 'Layout used to get files. relative to base directory if defined' )
278
- template_args = traits .Dict (traits .Str ,
279
- traits .List (traits .List ),
280
- value = dict (outfiles = []), usedefault = True ,
278
+ template_args = traits .Dict (key_trait = traits .Str ,
279
+ value_trait = traits .List (traits .List ),
281
280
desc = 'Information to plug into template' )
282
281
283
282
class DataGrabber (IOBase ):
@@ -354,7 +353,6 @@ def __init__(self, infields=None, outfields=None, **kwargs):
354
353
for key in infields :
355
354
self .inputs .add_trait (key , traits .Any )
356
355
undefined_traits [key ] = Undefined
357
- self .inputs .template_args ['outfiles' ] = [infields ]
358
356
if outfields :
359
357
# add ability to insert field specific templates
360
358
self .inputs .add_trait ('field_template' ,
@@ -363,9 +361,12 @@ def __init__(self, infields=None, outfields=None, **kwargs):
363
361
undefined_traits ['field_template' ] = Undefined
364
362
#self.inputs.remove_trait('template_args')
365
363
outdict = {}
364
+ if not isdefined (self .inputs .template_args ):
365
+ self .inputs .template_args = {}
366
366
for key in outfields :
367
- outdict [key ] = []
368
- self .inputs .template_args = outdict
367
+ if not key in self .inputs .template_args :
368
+ self .inputs .template_args [key ] = [infields ]
369
+
369
370
self .inputs .trait_set (trait_change_notify = False , ** undefined_traits )
370
371
371
372
def _add_output_traits (self , base ):
0 commit comments