Skip to content

Commit f09b3bf

Browse files
committed
fix old _get_trait_desc calls
1 parent 454c6ac commit f09b3bf

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

nipype/interfaces/base/support.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,10 @@ def _inputs_help(cls):
291291
if mandatory_items:
292292
helpstr += ['\t[Mandatory]']
293293
for name, spec in sorted(mandatory_items):
294-
helpstr += _get_trait_desc(inputs, name, spec)
294+
helpstr += get_trait_desc(inputs, name, spec)
295295

296296
mandatory_keys = [item[0] for item in mandatory_items]
297-
optional_items = ['\n'.join(_get_trait_desc(inputs, name, val))
297+
optional_items = ['\n'.join(get_trait_desc(inputs, name, val))
298298
for name, val in inputs.traits(transient=None).items()
299299
if name not in mandatory_keys]
300300
if optional_items:
@@ -318,7 +318,7 @@ def _outputs_help(cls):
318318
if cls.output_spec:
319319
outputs = cls.output_spec()
320320
outhelpstr = [
321-
'\n'.join(_get_trait_desc(outputs, name, spec))
321+
'\n'.join(get_trait_desc(outputs, name, spec))
322322
for name, spec in sorted(outputs.traits(transient=None).items())]
323323
if outhelpstr:
324324
helpstr = helpstr[:-1] + outhelpstr
@@ -338,7 +338,7 @@ def _refs_help(cls):
338338
return helpstr
339339

340340

341-
def _get_trait_desc(inputs, name, spec):
341+
def get_trait_desc(inputs, name, spec):
342342
"""Parses a HasTraits object into a nipype documentation string"""
343343
desc = spec.desc
344344
xor = spec.xor

nipype/scripts/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
from .instance import import_module
1515
from ..interfaces.base import InputMultiPath, traits
16+
from ..interfaces.base.support import get_trait_desc
1617

1718
# different context options
1819
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@@ -61,8 +62,7 @@ def add_args_options(arg_parser, interface):
6162
"""Add arguments to `arg_parser` to create a CLI for `interface`."""
6263
inputs = interface.input_spec()
6364
for name, spec in sorted(interface.inputs.traits(transient=None).items()):
64-
desc = "\n".join(interface._get_trait_desc(inputs, name,
65-
spec))[len(name) + 2:]
65+
desc = "\n".join(get_trait_desc(inputs, name, spec))[len(name) + 2:]
6666
# Escape any % signs with a %
6767
desc = desc.replace('%', '%%')
6868
args = {}

nipype/utils/nipype_cmd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import sys
99

1010
from ..interfaces.base import Interface, InputMultiPath, traits
11+
from ..interfaces.base.support import get_trait_desc
1112
from .misc import str2bool
1213

1314

@@ -30,8 +31,7 @@ def add_options(parser=None, module=None, function=None):
3031
inputs = interface.input_spec()
3132
for name, spec in sorted(
3233
interface.inputs.traits(transient=None).items()):
33-
desc = "\n".join(interface._get_trait_desc(inputs, name,
34-
spec))[len(name) + 2:]
34+
desc = "\n".join(get_trait_desc(inputs, name, spec))[len(name) + 2:]
3535
args = {}
3636

3737
if spec.is_trait_type(traits.Bool):

0 commit comments

Comments
 (0)