run_script
Run scripts to setup system dependencies and autopilot plugins
> # to list scripts
> python3 -m autopilot.setup.run_script --list
> # to execute one script (setup hifiberry soundcard)
> python3 -m autopilot.setup.run_script hifiberry
> # to execute multiple scripts
> python3 -m autopilot.setup.run_script hifiberry jackd
Functions:
|
Call a series of commands, giving a single return code on completion or failure |
|
Thin wrapper around |
|
Run a series of scripts, printing results |
Print a formatted list of names in |
- call_series(commands: List[Union[str, dict]], series_name=None, verbose: bool = True) bool[source]
Call a series of commands, giving a single return code on completion or failure
See
setup.scriptsfor syntax of command list.- Parameters
commands (list) – List of strings or dicts to call, see
setup.scriptsseries_name (None, str) – If provided, print name of currently running script
verbose (bool) – If
True(default), print command and status messages.
- Returns
bool -
Trueif completed successfully
- run_script(script_name)[source]
Thin wrapper around
call_series()that gets a script by name fromscripts.SCRIPTSand passes the list ofcommands- Parameters
script_name (str) – name of a script in
scripts.SCRIPTS
- run_scripts(scripts: List[str], return_all: bool = False, print_status: bool = True) Union[bool, Dict[str, bool]][source]
Run a series of scripts, printing results
- Parameters
scripts (list) – list of script names
return_all (bool) – if True, return dict of
{script:success}for each called script. IfFalse(default), return single bool if all commands were successfulprint_status (bool) – if
True(default), print whether each script completed successfully or not.
- Returns
success or failure of scripts -
Trueif all were successful,Falseotherwise.- Return type
- list_scripts()[source]
Print a formatted list of names in
scripts.SCRIPTS