launch.event_handlers package

Submodules

Module contents

Package for event_handlers.

class launch.event_handlers.OnExecutionComplete[source]

Bases: OnActionEventBase

Convenience class for handling an action completion event.

It may be configured to only handle the completion of a specific action, or to handle them all.

__init__(*, target_action: Callable[[Action], bool] | Action | None = None, on_completion: LaunchDescriptionEntity | Iterable[LaunchDescriptionEntity] | Callable[[ExecutionComplete, LaunchContext], LaunchDescriptionEntity | Iterable[LaunchDescriptionEntity] | None], **kwargs) None[source]

Create an OnExecutionComplete event handler.

class launch.event_handlers.OnIncludeLaunchDescription[source]

Bases: EventHandler

Event handler used to handle asynchronous requests to include LaunchDescriptions.

__init__(**kwargs)[source]

Create an OnIncludeLaunchDescription event handler.

property handler_description: str

Return the string description of the handler.

property matcher_description: str

Return the string description of the matcher.

class launch.event_handlers.OnProcessExit[source]

Bases: OnActionEventBase

Convenience class for handling a process exited event.

It may be configured to only handle the exiting of a specific action, or to handle all exited processes.

__init__(*, target_action: Callable[[ExecuteLocal], bool] | ExecuteLocal | None = None, on_exit: LaunchDescriptionEntity | Iterable[LaunchDescriptionEntity] | Callable[[ProcessExited, LaunchContext], LaunchDescriptionEntity | Iterable[LaunchDescriptionEntity] | None], **kwargs) None[source]

Create an OnProcessExit event handler.

class launch.event_handlers.OnProcessIO[source]

Bases: OnActionEventBase

Convenience class for handling I/O from processes via events.

__init__(*, target_action: Callable[[Action], bool] | Action | None = None, on_stdin: Callable[[ProcessIO], LaunchDescriptionEntity | Iterable[LaunchDescriptionEntity] | None] | None = None, on_stdout: Callable[[ProcessIO], LaunchDescriptionEntity | Iterable[LaunchDescriptionEntity] | None] | None = None, on_stderr: Callable[[ProcessIO], LaunchDescriptionEntity | Iterable[LaunchDescriptionEntity] | None] | None = None, **kwargs) None[source]

Create an OnProcessIO event handler.

class launch.event_handlers.OnProcessStart[source]

Bases: OnActionEventBase

Convenience class for handling a process started event.

It may be configured to only handle the starting of a specific action, or to handle all started processes.

__init__(*, target_action: Callable[[Action], bool] | Action | None = None, on_start: LaunchDescriptionEntity | Iterable[LaunchDescriptionEntity] | Callable[[ProcessStarted, LaunchContext], LaunchDescriptionEntity | Iterable[LaunchDescriptionEntity] | None], **kwargs) None[source]

Create an OnProcessStart event handler.

class launch.event_handlers.OnShutdown[source]

Bases: BaseEventHandler

Convenience class for handling the launch shutdown event.

__init__(*, on_shutdown: LaunchDescriptionEntity | Iterable[LaunchDescriptionEntity] | Callable[[Shutdown, LaunchContext], LaunchDescriptionEntity | Iterable[LaunchDescriptionEntity] | None], **kwargs) None[source]

Create an OnShutdown event handler.

handle(event: Event, context: LaunchContext) LaunchDescriptionEntity | Iterable[LaunchDescriptionEntity] | None[source]

Handle the given event.

property handler_description: str

Return the string description of the handler.

property matcher_description

Return the string description of the matcher.

launch.event_handlers.event_named(name: str) Callable[[Event], bool][source]

Generate a lambda that compares the given name to an event’s name given to the lambda.