@@ -345,6 +345,8 @@ def __init__(self, infields=None, outfields=None, **kwargs):
345
345
See class examples for usage
346
346
347
347
"""
348
+ if not outfields :
349
+ outfields = ['outfiles' ]
348
350
super (DataGrabber , self ).__init__ (** kwargs )
349
351
undefined_traits = {}
350
352
# used for mandatory inputs check
@@ -353,9 +355,6 @@ def __init__(self, infields=None, outfields=None, **kwargs):
353
355
for key in infields :
354
356
self .inputs .add_trait (key , traits .Any )
355
357
undefined_traits [key ] = Undefined
356
- if not outfields :
357
- outfields = ['outfiles' ]
358
-
359
358
# add ability to insert field specific templates
360
359
self .inputs .add_trait ('field_template' ,
361
360
traits .Dict (traits .Enum (outfields ),
@@ -365,7 +364,10 @@ def __init__(self, infields=None, outfields=None, **kwargs):
365
364
self .inputs .template_args = {}
366
365
for key in outfields :
367
366
if not key in self .inputs .template_args :
368
- self .inputs .template_args [key ] = [infields ]
367
+ if infields :
368
+ self .inputs .template_args [key ] = [infields ]
369
+ else :
370
+ self .inputs .template_args [key ] = []
369
371
370
372
self .inputs .trait_set (trait_change_notify = False , ** undefined_traits )
371
373
0 commit comments