Skip to content

Commit 448b875

Browse files
committed
Revert "removing terminal_output from CommandLine call (ignore_exception is deprecated)"
This reverts commit 708ac1c.
1 parent 708ac1c commit 448b875

File tree

17 files changed

+42
-21
lines changed

17 files changed

+42
-21
lines changed

nipype/interfaces/afni/base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ def standard_image(img_name):
8787
Could be made more fancy to allow for more relocatability'''
8888
clout = CommandLine(
8989
'which afni',
90-
resource_monitor=False).run()
90+
resource_monitor=False,
91+
terminal_output='allatonce').run()
9192
if clout.runtime.returncode is not 0:
9293
return None
9394

nipype/interfaces/base/core.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,8 @@ def version(klass):
13141314
try:
13151315
clout = CommandLine(
13161316
command=klass.version_cmd,
1317-
resource_monitor=False).run()
1317+
resource_monitor=False,
1318+
terminal_output='allatonce').run()
13181319
except IOError:
13191320
return None
13201321

nipype/interfaces/diffusion_toolkit/base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def version():
4848
Version number as string or None if FSL not found
4949
5050
"""
51-
clout = CommandLine(command='dti_recon').run()
51+
clout = CommandLine(
52+
command='dti_recon', terminal_output='allatonce').run()
5253

5354
if clout.runtime.returncode is not 0:
5455
return None

nipype/interfaces/matlab.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def get_matlab_command():
2525
res = CommandLine(
2626
command='which',
2727
args=matlab_cmd,
28-
resource_monitor=False).run()
28+
resource_monitor=False,
29+
terminal_output='allatonce').run()
2930
matlab_path = res.runtime.stdout.strip()
3031
except Exception:
3132
return None

nipype/interfaces/minc/base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def version():
5656
try:
5757
clout = CommandLine(
5858
command='mincinfo',
59-
args='-version').run()
59+
args='-version',
60+
terminal_output='allatonce').run()
6061
except IOError:
6162
return None
6263

nipype/pipeline/engine/utils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,8 @@ def _run_dot(dotfilename, format_ext):
13381338
dot_base = os.path.splitext(dotfilename)[0]
13391339
formatted_dot = '{}.{}'.format(dot_base, format_ext)
13401340
cmd = 'dot -T{} -o"{}" "{}"'.format(format_ext, formatted_dot, dotfilename)
1341-
res = CommandLine(cmd, resource_monitor=False).run()
1341+
res = CommandLine(cmd, terminal_output='allatonce',
1342+
resource_monitor=False).run()
13421343
return formatted_dot, res
13431344

13441345

nipype/pipeline/plugins/condor.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def __init__(self, **kwargs):
4949

5050
def _is_pending(self, taskid):
5151
cmd = CommandLine(
52-
'condor_q', resource_monitor=False)
52+
'condor_q', resource_monitor=False, terminal_output='allatonce')
5353
cmd.inputs.args = '%d' % taskid
5454
# check condor cluster
5555
oldlevel = iflogger.level
@@ -64,7 +64,8 @@ def _submit_batchtask(self, scriptfile, node):
6464
cmd = CommandLine(
6565
'condor_qsub',
6666
environ=dict(os.environ),
67-
resource_monitor=False)
67+
resource_monitor=False,
68+
terminal_output='allatonce')
6869
path = os.path.dirname(scriptfile)
6970
qsubargs = ''
7071
if self._qsub_args:

nipype/pipeline/plugins/dagman.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ def _submit_graph(self, pyfiles, dependencies, nodes):
158158
cmd = CommandLine(
159159
'condor_submit_dag',
160160
environ=dict(os.environ),
161-
resource_monitor=False)
161+
resource_monitor=False,
162+
terminal_output='allatonce')
162163
# needs -update_submit or re-running a workflow will fail
163164
cmd.inputs.args = '%s -update_submit %s' % (self._dagman_args,
164165
dagfilename)

nipype/pipeline/plugins/lsf.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def _is_pending(self, taskid):
4848
But _is_pending should return True until a job has finished and is
4949
ready to be checked for completeness. So return True if status is
5050
either 'PEND' or 'RUN'"""
51-
cmd = CommandLine('bjobs', resource_monitor=False)
51+
cmd = CommandLine(
52+
'bjobs', resource_monitor=False, terminal_output='allatonce')
5253
cmd.inputs.args = '%d' % taskid
5354
# check lsf task
5455
oldlevel = iflogger.level
@@ -65,7 +66,8 @@ def _submit_batchtask(self, scriptfile, node):
6566
cmd = CommandLine(
6667
'bsub',
6768
environ=dict(os.environ),
68-
resource_monitor=False)
69+
resource_monitor=False,
70+
terminal_output='allatonce')
6971
bsubargs = ''
7072
if self._bsub_args:
7173
bsubargs = self._bsub_args

nipype/pipeline/plugins/oar.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ def _submit_batchtask(self, scriptfile, node):
6969
cmd = CommandLine(
7070
'oarsub',
7171
environ=dict(os.environ),
72-
resource_monitor=False)
72+
resource_monitor=False,
73+
terminal_output='allatonce')
7374
path = os.path.dirname(scriptfile)
7475
oarsubargs = ''
7576
if self._oarsub_args:

nipype/pipeline/plugins/pbs.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def __init__(self, **kwargs):
5151
def _is_pending(self, taskid):
5252
result = CommandLine('qstat -f {}'.format(taskid),
5353
environ=dict(os.environ),
54+
terminal_output='file_split',
5455
resource_monitor=False).run()
5556

5657
stdout = result.runtime.stdout
@@ -66,7 +67,8 @@ def _submit_batchtask(self, scriptfile, node):
6667
cmd = CommandLine(
6768
'qsub',
6869
environ=dict(os.environ),
69-
resource_monitor=False)
70+
resource_monitor=False,
71+
terminal_output='allatonce')
7072
path = os.path.dirname(scriptfile)
7173
qsubargs = ''
7274
if self._qsub_args:

nipype/pipeline/plugins/pbsgraph.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ def _submit_graph(self, pyfiles, dependencies, nodes):
5858
cmd = CommandLine(
5959
'sh',
6060
environ=dict(os.environ),
61-
resource_monitor=False)
61+
resource_monitor=False,
62+
terminal_output='allatonce')
6263
cmd.inputs.args = '%s' % submitjobsfile
6364
cmd.run()
6465
logger.info('submitted all jobs to queue')

nipype/pipeline/plugins/sge.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,8 @@ def _submit_batchtask(self, scriptfile, node):
392392
cmd = CommandLine(
393393
'qsub',
394394
environ=dict(os.environ),
395-
resource_monitor=False)
395+
resource_monitor=False,
396+
terminal_output='allatonce')
396397
path = os.path.dirname(scriptfile)
397398
qsubargs = ''
398399
if self._qsub_args:

nipype/pipeline/plugins/sgegraph.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ def make_job_name(jobnumber, nodeslist):
155155
cmd = CommandLine(
156156
'bash',
157157
environ=dict(os.environ),
158-
resource_monitor=False)
158+
resource_monitor=False,
159+
terminal_output='allatonce')
159160
cmd.inputs.args = '%s' % submitjobsfile
160161
cmd.run()
161162
logger.info('submitted all jobs to queue')

nipype/pipeline/plugins/slurm.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ def _is_pending(self, taskid):
6666
res = CommandLine(
6767
'squeue',
6868
args=' '.join(['-j', '%s' % taskid]),
69-
resource_monitor=False).run()
69+
resource_monitor=False,
70+
terminal_output='allatonce').run()
7071
return res.runtime.stdout.find(str(taskid)) > -1
7172

7273
def _submit_batchtask(self, scriptfile, node):
@@ -78,7 +79,8 @@ def _submit_batchtask(self, scriptfile, node):
7879
cmd = CommandLine(
7980
'sbatch',
8081
environ=dict(os.environ),
81-
resource_monitor=False)
82+
resource_monitor=False,
83+
terminal_output='allatonce')
8284
path = os.path.dirname(scriptfile)
8385

8486
sbatch_args = ''

nipype/pipeline/plugins/slurmgraph.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ def make_job_name(jobnumber, nodeslist):
155155
cmd = CommandLine(
156156
'bash',
157157
environ=dict(os.environ),
158-
resource_monitor=False)
158+
resource_monitor=False,
159+
terminal_output='allatonce')
159160
cmd.inputs.args = '%s' % submitjobsfile
160161
cmd.run()
161162
logger.info('submitted all jobs to queue')

nipype/utils/docparse.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ def get_doc(cmd, opt_map, help_flag=None, trap_error=True):
254254
"""
255255
res = CommandLine(
256256
'which %s' % cmd.split(' ')[0],
257-
resource_monitor=False).run()
257+
resource_monitor=False,
258+
terminal_output='allatonce').run()
258259
cmd_path = res.runtime.stdout.strip()
259260
if cmd_path == '':
260261
raise Exception('Command %s not found' % cmd.split(' ')[0])
@@ -333,7 +334,8 @@ def get_params_from_doc(cmd, style='--', help_flag=None, trap_error=True):
333334
"""
334335
res = CommandLine(
335336
'which %s' % cmd.split(' ')[0],
336-
resource_monitor=False).run()
337+
resource_monitor=False,
338+
terminal_output='allatonce').run()
337339
cmd_path = res.runtime.stdout.strip()
338340
if cmd_path == '':
339341
raise Exception('Command %s not found' % cmd.split(' ')[0])

0 commit comments

Comments
 (0)