Classes | |
class | SignalContextManager |
Provides a context manager to be able to captue signals and forward them to a subprocess within a context manager scope. More... | |
class | KillOrphansContextManager |
Use instead of popen to perform cleanup of orphan subprocesses. More... | |
Functions | |
def | cmd_and_log |
Runs command and logs to line_handler. More... | |
Variables | |
string | TEMPLATE |
def etr.tools.subprocess.cmd_and_log | ( | command | ) |
Runs command and logs to line_handler.
It can also generate a script file that re-creates the execution environment which can be useful for debugging outside etr.
command | Command to execute. |
kill_orphans | Whether to kill orphaned processes or not. Default is True. |
line_handler | Callback invoked for each line of output of command |
script_file | Whether or not to generate a script file that reproduce the command invocation. |
string etr.tools.subprocess.TEMPLATE |