Skip to content

Commit d7ef91a

Browse files
committed
Parse SelectFiles format keys to allow attribute access
1 parent b9c75fb commit d7ef91a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

nipype/interfaces/io.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,8 +1256,10 @@ def __init__(self, templates, **kwargs):
12561256
infields = []
12571257
for name, template in list(templates.items()):
12581258
for _, field_name, _, _ in string.Formatter().parse(template):
1259-
if field_name is not None and field_name not in infields:
1260-
infields.append(field_name)
1259+
if field_name is not None:
1260+
field_name = re.match("\w+", field_name).group()
1261+
if field_name not in infields:
1262+
infields.append(field_name)
12611263

12621264
self._infields = infields
12631265
self._outfields = list(templates)

0 commit comments

Comments
 (0)