rad
3.0.0
|
Classes | |
class | KillOrphansContextManager |
Use instead of popen to perform cleanup of orphan subprocesses. More... | |
class | SignalContextManager |
Provides a context manager to be able to captue signals and forward them to a subprocess within a context manager scope. More... | |
Functions | |
def | cmd_and_log (List[str] command, *Optional[bool] kill_orphans=None, Optional[Callable[[str], None]] line_handler=None, Optional[bool] script_file=None, **kwargs) |
Runs command and logs to line_handler. More... | |
Variables | |
string | TEMPLATE |
def etr.tools.subprocess.cmd_and_log | ( | List[str] | command, |
*Optional[bool] | kill_orphans = None , |
||
Optional[Callable[[str], None]] | line_handler = None , |
||
Optional[bool] | script_file = None , |
||
** | kwargs | ||
) |
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 |