launch.descriptions package
Submodules
Module contents
descriptions Module.
- class launch.descriptions.Executable[source]
Bases:
objectDescribes an executable (usually a single process) which may be run by the launch system.
- __init__(*, cmd: Iterable[str | Path | Substitution | Iterable[str | Path | Substitution]], prefix: str | Path | Substitution | Iterable[str | Path | Substitution] | None = None, name: str | Path | Substitution | Iterable[str | Path | Substitution] | None = None, cwd: str | Path | Substitution | Iterable[str | Path | Substitution] | None = None, env: Dict[str | Path | Substitution | Iterable[str | Path | Substitution], str | Path | Substitution | Iterable[str | Path | Substitution]] | None = None, additional_env: Dict[str | Path | Substitution | Iterable[str | Path | Substitution], str | Path | Substitution | Iterable[str | Path | Substitution]] | None = None, arguments: Iterable[str | Path | Substitution | Iterable[str | Path | Substitution]] | None = None) None[source]
Initialize an Executable description.
- Parameters:
cmd – A list where the first item is the executable and the rest are arguments to the executable, each item may be a string or a list of strings and Substitutions to be resolved at runtime
prefix – a set of commands/arguments to precede the cmd, used for things like gdb/valgrind and defaults to the LaunchConfiguration called ‘launch-prefix’. Note that a non-default prefix provided in a launch file will override the prefix provided via the launch-prefix launch configuration regardless of whether the launch-prefix-filter launch configuration is provided.
name – The label used to represent the process, as a string or a Substitution to be resolved at runtime, defaults to the basename of the executable
cwd – The directory in which to run the executable
env – Dictionary of environment variables to be used, starting from a clean environment. If None, the current environment of the launch context is used.
additional_env – Dictionary of environment variables to be added. If env was None, they are added to the current environment. If not, env is updated with additional_env.
arguments – list of extra arguments for the executable
- property additional_env: List[Tuple[List[Substitution], List[Substitution]]] | None
Getter for additional_env.
- property arguments: Iterable[str | Path | Substitution | Iterable[str | Path | Substitution]] | None
Getter for arguments.
- property cmd: List[List[Substitution]]
Getter for cmd.
- property cwd: List[Substitution] | None
Getter for cwd.
- property env: List[Tuple[List[Substitution], List[Substitution]]] | None
Getter for env.
- property name: List[Substitution] | None
Getter for name.
- property prefix: List[Substitution]
Getter for prefix.
- prepare(context: LaunchContext, action: Action) None[source]
Prepare an executable description for execution in a given environment.
This does the following: - performs substitutions on various properties
Note that ‘action’ is not used at this level; it is provided for use by subclasses which may override this method.