From 218c6a10f22dec7a283e569e7b332dd6e5052bc4 Mon Sep 17 00:00:00 2001 From: Michiel Cottaar <MichielCottaar@gmail.com> Date: Fri, 27 Apr 2018 15:41:41 +0100 Subject: [PATCH] Clarified that in output the logdir should be provided If a logdir has been set that directory should be provided rather than the directory from which the job was submitted (which is what the logdir defaults to). --- fsl/utils/fslsub.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fsl/utils/fslsub.py b/fsl/utils/fslsub.py index 81034b1a7..4d6bf1a61 100644 --- a/fsl/utils/fslsub.py +++ b/fsl/utils/fslsub.py @@ -156,19 +156,19 @@ def info(job_id): return res -def output(job_id, cwd='.', command=None, name=None): +def output(job_id, logdir='.', command=None, name=None): """Returns the output of the given job. :arg job_id: String containing job ID. - :arg cwd: Directory from which command was submitted - defaults to + :arg logdir: Directory containing the log - defaults to the current directory. :arg command: Command that was run. Not currently used. :arg name: Job name if it was specified. Not currently used. :returns: A tuple containing the standard output and standard error. """ - stdout = list(glob.glob(op.join(cwd, '*.o{}'.format(job_id)))) - stderr = list(glob.glob(op.join(cwd, '*.e{}'.format(job_id)))) + stdout = list(glob.glob(op.join(logdir, '*.o{}'.format(job_id)))) + stderr = list(glob.glob(op.join(logdir, '*.e{}'.format(job_id)))) if len(stdout) != 1 or len(stderr) != 1: raise ValueError('No/too many error/output files for job {}: stdout: ' -- GitLab