Skip to content

Commit

Permalink
Add 'handle_once' option to RegisterEventHandler
Browse files Browse the repository at this point in the history
This allows the user to configure "one shot" events via launch actions.

Closes #111.
  • Loading branch information
jacobperron committed Sep 21, 2018
1 parent 0a67450 commit 07c9f77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion launch/launch/actions/register_event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ class RegisterEventHandler(Action):
place.
"""

def __init__(self, event_handler: EventHandler, **kwargs) -> None:
def __init__(self, event_handler: EventHandler, handle_once: bool = False, **kwargs) -> None:
"""Constructor."""
super().__init__(**kwargs)
self.__event_handler = event_handler
self.__event_handler.handle_once = handle_once

@property
def event_handler(self) -> EventHandler:
Expand Down

0 comments on commit 07c9f77

Please sign in to comment.