Execution utils module
This module provides utils to execute internal mldev command from shell scripts and external scripts from stages.
- check_kill_process(pstring)[исходный код]
TODO docs
- Параметры
pstring –
«returns:
- exec_command(cmdline, env=None, capture=False)[исходный код]
Executes the given :param cmdline: with shell. Passes current „“os.environ““ to the command.
Calls „“setenv.sh““ script before running the command
Raises exception if subordinate command fails :param cmdline: command line to execute :param env: additional environment for command :param capture: if True, then capture output in
CompletedProcess.stdout
:return: instance ofCompletedProcess
- exec_tool_command(cmdline, extra='mldev', environ=None)[исходный код]
Executes the given tool command :param cmdline: with shell.
See
exec_command
for more details :param cmdline: command to execute (relative toinstall_dir
) :param environ: additional environment for the tool command :return: instance ofCompletedProcess
- prepare_experiment_command(cmdline, env=None)[исходный код]
Makes a single string to run the given :param cmdline: with shell. Passes :param env: to the command by prepending with
export
.- Параметры
cmdline – command line to execute
env – additional environment to pass
- Результат
a cmdline that runs in venv
- shell_escape(s: str, shell_symbols='"\'')[исходный код]
If any control symbols - prepend „“ Double „“ to „' :param s: a string to escape :param shell_symbols: a string with control characters to escape :return: escaped string
- shell_quote(s: str)[исходный код]
Escapes and quotes string
s
- Параметры
s –
- Результат