launch.descriptions package

Submodules

Module contents

descriptions Module.

class launch.descriptions.Executable[source]

Bases: object

Describes an executable (usually a single process) which may be run by the launch system.

__init__(*, cmd: Iterable[str | Substitution | Iterable[str | Substitution]], prefix: str | Substitution | Iterable[str | Substitution] | None = None, name: str | Substitution | Iterable[str | Substitution] | None = None, cwd: str | Substitution | Iterable[str | Substitution] | None = None, env: Dict[str | Substitution | Iterable[str | Substitution], str | Substitution | Iterable[str | Substitution]] | None = None, additional_env: Dict[str | Substitution | Iterable[str | Substitution], str | Substitution | Iterable[str | Substitution]] | None = None, arguments: Iterable[str | Substitution | Iterable[str | 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

Getter for additional_env.

property arguments

Getter for arguments.

property cmd

Getter for cmd.

property cwd

Getter for cwd.

property env

Getter for env.

property final_cmd

Getter for final_cmd.

property final_cwd

Getter for cwd.

property final_env

Getter for final_env.

property final_name

Getter for final_name.

property name

Getter for name.

property prefix

Getter for prefix.

prepare(context: LaunchContext, action: Action)[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.