Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'handle_once' property for unregistering an EventHandler after one event #141

Merged
merged 3 commits into from
Sep 25, 2018

Commits on Sep 22, 2018

  1. Add 'handle_once' property to EventHandler

    This is useful for implementing "one shot" events.
    The property can be set via the constructor or setter.
    If 'handle_once' is set to True, then the EventHandler unregisters itself from the context after the first time it is handled.
    All subclasses of EventHandler pass it kwargs so they can use the new property.
    Tests included.
    jacobperron committed Sep 22, 2018
    Configuration menu
    Copy the full SHA
    dbf1ad7 View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2018

  1. Add a common interface for describing an EventHandler

    A common pattern for describing event handlers has been moved to the parent class.
    Subclasses should implement the 'handler_description' and 'matcher_description' properties rather than implementing a describe method.
    jacobperron committed Sep 24, 2018
    Configuration menu
    Copy the full SHA
    fec5e1d View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2018

  1. Remove 'handle_once' setter from EventHandler

    Plus other minor cleanup.
    jacobperron committed Sep 25, 2018
    Configuration menu
    Copy the full SHA
    b6ec8b1 View commit details
    Browse the repository at this point in the history