launch.event_handlers.on_action_event_base module
Module for OnActionEventBase class.
- class launch.event_handlers.on_action_event_base.OnActionEventBase[source]
Bases:
BaseEventHandler
Base event handler for events that have a source action.
- __init__(*, action_matcher: Callable[[Action], bool] | Action | None, on_event: LaunchDescriptionEntity | Iterable[LaunchDescriptionEntity] | Callable[[Event, LaunchContext], LaunchDescriptionEntity | Iterable[LaunchDescriptionEntity] | None], target_event_cls: Type[Event], target_action_cls: Type[Action], **kwargs) None [source]
Construct a OnActionEventBase instance.
- Parameters:
action_matcher – ExecuteProcess instance or callable to filter events from which process/processes to handle.
on_event – Action to be done to handle the event.
target_event_cls – A subclass of Event, indicating which events should be handled.
target_action_cls – A subclass of Action, indicating which kind of action can generate the event.
- describe() Tuple[str, List[LaunchDescriptionEntity | Iterable[LaunchDescriptionEntity]]] [source]
Return a description tuple.
- handle(event: Event, context: LaunchContext) LaunchDescriptionEntity | Iterable[LaunchDescriptionEntity] | None [source]
Handle the given event.