auxiliary
runscript
- class auxiliary.runscript.ScriptRunner(script_path: str, log_path: str)
Bases:
objectA class for running Bash scripts and capturing output in log files.
- Parameters:
script_path (str) – Path to the Bash script to be executed.
log_path (str) – Path to the log file where the script output will be saved.
- run(input_params
Optional[List[str]] = None) -> Tuple[bool, str]:
- Execute the script and capture the output in the log file.
- Returns()
- Tuple[bool, str]: A tuple containing a boolean (True if script executed successfully, False otherwise)
and an error message (empty string if no error occurred).
- _write_log_line(stream: str, line: str, log_file: object) None
- run(input_params: List[str] | None = None) Tuple[bool, str]
Execute the script and capture the output in the log file.
- Parameters:
input_params (list, optional) – List of input parameters to be passed to the script. Defaults to None.
- Returns:
- A tuple containing a boolean (True if script executed successfully, False otherwise)
and an error message (empty string if no error occurred).
- Return type:
Tuple[bool, str]