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_series(commands[, series_name, verbose])

Call a series of commands, giving a single return code on completion or failure

run_script(script_name)

Thin wrapper around call_series() that gets a script by name from scripts.SCRIPTS and passes the list of commands

run_scripts(scripts[, return_all, print_status])

Run a series of scripts, printing results

list_scripts()

Print a formatted list of names in scripts.SCRIPTS

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.scripts for syntax of command list.

Parameters
  • commands (list) – List of strings or dicts to call, see setup.scripts

  • series_name (None, str) – If provided, print name of currently running script

  • verbose (bool) – If True (default), print command and status messages.

Returns

bool - True if completed successfully

run_script(script_name)[source]

Thin wrapper around call_series() that gets a script by name from scripts.SCRIPTS and passes the list of commands

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. If False (default), return single bool if all commands were successful

  • print_status (bool) – if True (default), print whether each script completed successfully or not.

Returns

success or failure of scripts - True if all were successful, False otherwise.

Return type

bool

list_scripts()[source]

Print a formatted list of names in scripts.SCRIPTS