Skip to content

Commit

Permalink
add: comma separator for multiple labels
Browse files Browse the repository at this point in the history
  • Loading branch information
mgxd committed Jan 27, 2020
1 parent 997c1e5 commit 58f7315
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions smriprep/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ def output_space(value):
"""Parse one element of ``--output-spaces``."""
tpl_args = value.split(':')
template = tpl_args[0]
spaces = []
for modifier in tpl_args[1:]:
spec = {}
mitems = modifier.split('-', 1)
spec[mitems[0]] = len(mitems) == 1 or mitems[1]
spaces.append((template, spec))

if template in ParseTemplates.EXCEPTIONS or template in LEGACY_SPACES:
return [(template, {})]
Expand All @@ -53,6 +47,14 @@ def output_space(value):
Template identifier "{}" not found. Please, make sure TemplateFlow is \
correctly installed and contains the given template identifiers.""".format(template))

spaces = []
for modifiers in tpl_args[1:]:
spec = {}
for modifier in modifiers.split(','):
mitems = modifier.split('-', 1)
spec[mitems[0]] = len(mitems) == 1 or mitems[1]
spaces.append((template, spec))

if not spaces:
spaces.append((template, {}))
return spaces

0 comments on commit 58f7315

Please sign in to comment.