Skip to content

Commit c1a71f3

Browse files
committed
ENH: Update cmdline overrides
1 parent c697018 commit c1a71f3

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

nipype/interfaces/afni/base.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,10 @@ class AFNIPythonCommandInputSpec(CommandLineInputSpec):
294294
class AFNIPythonCommand(AFNICommand):
295295
@property
296296
def cmd(self):
297-
if spawn.find_executable(super(AFNIPythonCommand,
298-
self).cmd) is not None:
299-
return spawn.find_executable(super(AFNIPythonCommand, self).cmd)
300-
else:
301-
return super(AFNIPythonCommand, self).cmd
297+
orig_cmd = super(AFNIPythonCommand, self).cmd
298+
found = spawn.find_executable(orig_cmd)
299+
return found if found is not None else orig_cmd
302300

303301
@property
304-
def cmdline(self):
305-
return "{} {}".format(self.inputs.py27_path,
306-
super(AFNIPythonCommand, self).cmdline)
302+
def _cmd_prefix(self):
303+
return "{} ".format(self.inputs.py27_path)

nipype/interfaces/freesurfer/preprocess.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -655,8 +655,9 @@ def cmdline(self):
655655
files = self._get_filelist(outdir)
656656
for infile, outfile in files:
657657
if not os.path.exists(outfile):
658-
single_cmd = '%s %s %s' % (self.cmd, infile,
659-
os.path.join(outdir, outfile))
658+
single_cmd = '%s%s %s %s' % (self._cmd_prefix, self.cmd,
659+
infile, os.path.join(outdir,
660+
outfile))
660661
cmd.extend([single_cmd])
661662
return '; '.join(cmd)
662663

nipype/interfaces/minc/minc.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1742,15 +1742,15 @@ def _list_outputs(self):
17421742
@property
17431743
def cmdline(self):
17441744
output_file_base = self.inputs.output_file_base
1745+
orig_cmdline = super(Blur, self).cmdline
17451746

17461747
if isdefined(output_file_base):
1747-
return super(Blur, self).cmdline
1748+
return orig_cmdline
17481749
else:
17491750
# FIXME this seems like a bit of a hack. Can we force output_file
17501751
# to show up in cmdline by default, even if it isn't specified in
17511752
# the instantiation of Pik?
1752-
return '%s %s' % (super(Blur, self).cmdline,
1753-
self._gen_output_base())
1753+
return '%s %s' % (orig_cmdline, self._gen_output_base())
17541754

17551755

17561756
class MathInputSpec(CommandLineInputSpec):

0 commit comments

Comments
 (0)