@@ -315,8 +315,8 @@ def has_metadata(trait, metadata, value=None, recursive=True):
315
315
return count > 0
316
316
317
317
318
- class MultiPath (traits .List ):
319
- """ Abstract class - shared functionality of input and output MultiPath
318
+ class MultiObject (traits .List ):
319
+ """ Abstract class - shared functionality of input and output MultiObject
320
320
"""
321
321
322
322
def validate (self , object , name , value ):
@@ -335,18 +335,18 @@ def validate(self, object, name, value):
335
335
inner_trait = self .inner_traits ()[0 ]
336
336
if not isinstance (value , list ) \
337
337
or (isinstance (inner_trait .trait_type , traits .List ) and
338
- not isinstance (inner_trait .trait_type , InputMultiPath ) and
338
+ not isinstance (inner_trait .trait_type , InputMultiObject ) and
339
339
not isinstance (value [0 ], list )):
340
340
newvalue = [value ]
341
- value = super (MultiPath , self ).validate (object , name , newvalue )
341
+ value = super (MultiObject , self ).validate (object , name , newvalue )
342
342
343
343
if value :
344
344
return value
345
345
346
346
self .error (object , name , value )
347
347
348
348
349
- class OutputMultiPath ( MultiPath ):
349
+ class OutputMultiObject ( MultiObject ):
350
350
""" Implements a user friendly traits that accepts one or more
351
351
paths to files or directories. This is the output version which
352
352
return a single string whenever possible (when it was set to a
@@ -358,9 +358,9 @@ class OutputMultiPath(MultiPath):
358
358
359
359
XXX This needs to be vetted by somebody who understands traits
360
360
361
- >>> from nipype.interfaces.base import OutputMultiPath , TraitedSpec
361
+ >>> from nipype.interfaces.base import OutputMultiObject , TraitedSpec
362
362
>>> class A(TraitedSpec):
363
- ... foo = OutputMultiPath (File(exists=False))
363
+ ... foo = OutputMultiObject (File(exists=False))
364
364
>>> a = A()
365
365
>>> a.foo
366
366
<undefined>
@@ -392,7 +392,7 @@ def set(self, object, name, value):
392
392
self .set_value (object , name , value )
393
393
394
394
395
- class InputMultiPath ( MultiPath ):
395
+ class InputMultiObject ( MultiObject ):
396
396
""" Implements a user friendly traits that accepts one or more
397
397
paths to files or directories. This is the input version which
398
398
always returns a list. Default value of this trait
@@ -403,9 +403,9 @@ class InputMultiPath(MultiPath):
403
403
404
404
XXX This needs to be vetted by somebody who understands traits
405
405
406
- >>> from nipype.interfaces.base import InputMultiPath , TraitedSpec
406
+ >>> from nipype.interfaces.base import InputMultiObject , TraitedSpec
407
407
>>> class A(TraitedSpec):
408
- ... foo = InputMultiPath (File(exists=False))
408
+ ... foo = InputMultiObject (File(exists=False))
409
409
>>> a = A()
410
410
>>> a.foo
411
411
<undefined>
@@ -424,3 +424,6 @@ class InputMultiPath(MultiPath):
424
424
425
425
"""
426
426
pass
427
+
428
+ InputMultiPath = InputMultiObject
429
+ OutputMultiPath = OutputMultiObject
0 commit comments