nipy/nipype — pull request #681 by satra (2013-10-09 18:05:14+00:00)
Title: WIP: Refactor: changing filename generation to a more consistent model

core-devs please review. (unfortunately a bunch of PEP-8 fixes are also there).

This patch is to demonstrate a plan to refactor filename generation and thereby simplify interface creation.

@bpinsard, @inati - comments much appreciated

in this commit take a look at the InvWarp class in utils.py.
```
inverse_warp = File(argstr='--out=%s', name_source=['warp'],
hash_files=False, name_template='%s_inverse',
...
```
the goal will be:

add metadata:
name_source: indicates which field to draw a name from, this field must be the name of a File
name_template (optional): if you want to override the default _generated suffix

add functionality to your class or base class, to allow changing extensions specific to package or interface

def self._overload_extension(self, value):
do whatever you want here with the name

in the outputspec make sure the name matches that of the input spec