Package mrv :: Module batch
[hide private]
[frames] | no frames]

Module batch

source code

This modules contains utilities to do opeations in batch mode. The module can be used from within python if required, but is more commonly used from the commandline, possibly wrapped by a shell script to specialize its usae

Functions [hide private]
 
superviseJobs(jobs, returnIfLessThan, cmdinput, errorstream, donestream)
Check on the jobs we have and wait for finished ones.
source code
 
killProcess(process)
Kill the given process :note: raises if kill is not supported by the os module
source code
 
process(cmd, args, inputList, errorstream=None, donestream=None, inputsPerProcess=1, numJobs=1)
Launch process at cmd with args and a list of input objects from inputList appended to args :param cmd: full path to tool you wish to start, like /bin/bash :param args: List of all argument strings to be passed to cmd :param inputList: list of input files to be passed as input to cmd :param errorstream: stream to which errors will be written to as they occour if not None :param donestream: stream to which items from input list will be passed once they have been processed if not None.
source code
    Command Line Tool
 
_usageAndExit(msg=None)
Print usage
source code
 
_toStream(arg, stream)
:return: stream according to arg :param stream: stream to return if arg sais so
source code
 
_popleftchecked(argv, errmsg)
pop an arg from argv and return with an error message on error
source code
 
main(*args)
Processes the arguments
source code
Variables [hide private]
  __all__ = None
hash(x)
  __package__ = 'mrv'
Function Details [hide private]

superviseJobs(jobs, returnIfLessThan, cmdinput, errorstream, donestream)

source code 

Check on the jobs we have and wait for finished ones. Write information about them into the respective streams :param returnIfLessThan: return once we have less than the given amount of running jobs

process(cmd, args, inputList, errorstream=None, donestream=None, inputsPerProcess=1, numJobs=1)

source code 

Launch process at cmd with args and a list of input objects from inputList appended to args :param cmd: full path to tool you wish to start, like /bin/bash :param args: List of all argument strings to be passed to cmd :param inputList: list of input files to be passed as input to cmd :param errorstream: stream to which errors will be written to as they occour if not None :param donestream: stream to which items from input list will be passed once they have been processed if not None. Items are newline terminated :param inputsPerProcess: pass the given number of inputs to the cmd, or less if there are not enough items on the input list :param numJobs: number of processes we may run in parallel