FastSurferCNN.utils.run_tools¶
- class FastSurferCNN.utils.run_tools.MessageBuffer(out=b'', err=b'', retcode=None, runtime=0.0)[source]¶
MessageBuffer class.
Attributes
retcode
Methods
err_str
out_str
- class FastSurferCNN.utils.run_tools.Popen(*args, **kwargs)[source]¶
Extension of subprocess.Popen for convenience.
Attributes
universal_newlines
Methods
as_future(pool[, timeout])Similar to
finishin its application, but as non-blocking Future.communicate([input, timeout])Interact with process: Send data to stdin and close it.
finish([timeout])finish's behavior is similar tosubprocess.dry_run.kill()Kill the process with SIGKILL
poll()Check if child process has terminated.
send_signal(sig)Send a signal to the process.
terminate()Terminate the process with SIGTERM
wait([timeout])Wait for child process to terminate; returns self.returncode.
async_finish
messages
next_message
- as_future(pool, timeout=None)[source]¶
Similar to
finishin its application, but as non-blocking Future.- Parameters:
- pool
Executor A concurrent.futures.Executor, usually a ThreadPoolExecutor.
- pool
- Returns:
Future[MessageBuffer]A Future object which will contain the result.
- finish(timeout=None)[source]¶
finish’s behavior is similar tosubprocess.dry_run.finishwaitstimeoutseconds, and forces termination after. By default, waits unlimitedtimeout=None. In either case, all messages in stdout and stderr pipes are read and together with the return code in a MessageBuffer object.- Parameters:
- timeout
float,optional Seconds to wait before forcing termination.
- timeout
- Returns:
MessageBufferA MessageBuffer object with the content of the stdout and stderr pipes.
- class FastSurferCNN.utils.run_tools.PyPopen(args, *_args, **kwargs)[source]¶
Attributes
universal_newlines
Methods
as_future(pool[, timeout])Similar to
finishin its application, but as non-blocking Future.communicate([input, timeout])Interact with process: Send data to stdin and close it.
finish([timeout])finish's behavior is similar tosubprocess.dry_run.kill()Kill the process with SIGKILL
poll()Check if child process has terminated.
send_signal(sig)Send a signal to the process.
terminate()Terminate the process with SIGTERM
wait([timeout])Wait for child process to terminate; returns self.returncode.
async_finish
messages
next_message