44"""
55Various utilities
66
7- Change directory to provide relative paths for doctests
8-
9- .. testsetup::
10- import os
11- filepath = os.path.dirname( os.path.realpath( __file__ ) )
12- datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
13- os.chdir(datadir)
14-
7+ Change directory to provide relative paths for doctests
8+ >>> import os
9+ >>> filepath = os.path.dirname(os.path.realpath(__file__))
10+ >>> datadir = os.path.realpath(os.path.join(filepath,
11+ ... '../../testing/data'))
12+ >>> os.chdir(datadir)
1513
1614"""
1715from __future__ import print_function , division , unicode_literals , absolute_import
2725
2826from ..base import (traits , TraitedSpec , DynamicTraitedSpec , File ,
2927 Undefined , isdefined , OutputMultiPath , InputMultiPath ,
30- BaseInterface , BaseInterfaceInputSpec )
28+ BaseInterface , BaseInterfaceInputSpec , Str )
3129from ..io import IOBase , add_traits
3230from ...utils .filemanip import filename_to_list , copyfile , split_filename
3331
@@ -158,11 +156,10 @@ class RenameInputSpec(DynamicTraitedSpec):
158156 in_file = File (exists = True , mandatory = True , desc = "file to rename" )
159157 keep_ext = traits .Bool (desc = ("Keep in_file extension, replace "
160158 "non-extension component of name" ))
161- format_string = traits .String (mandatory = True ,
162- desc = ("Python formatting string for output "
163- "template" ))
164- parse_string = traits .String (desc = ("Python regexp parse string to define "
165- "replacement inputs" ))
159+ format_string = Str (mandatory = True ,
160+ desc = "Python formatting string for output template" )
161+ parse_string = Str (desc = "Python regexp parse string to define "
162+ "replacement inputs" )
166163 use_fullpath = traits .Bool (False , usedefault = True ,
167164 desc = "Use full path as input to regex parser" )
168165
@@ -186,6 +183,7 @@ class Rename(IOBase):
186183
187184 Examples
188185 --------
186+
189187 >>> from nipype.interfaces.utility import Rename
190188 >>> rename1 = Rename()
191189 >>> rename1.inputs.in_file = "zstat1.nii.gz"
0 commit comments