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 event hooks #140

Merged
merged 4 commits into from Jul 5, 2021
Merged

add event hooks #140

merged 4 commits into from Jul 5, 2021

Conversation

jaredks
Copy link
Owner

@jaredks jaredks commented Jun 3, 2020

import rumps

class App(rumps.App):
    @rumps.events.before_start
    def before_start(self):
        print('=== inside app class: before_start ===')

    @rumps.events.before_quit
    def before_quit(self):
        print('=== inside app class: before quit ===')

    @rumps.events.on_notification
    def on_notification(self, n):
        print(f'=== inside app class: on_notification, got {n} ===')

# same as @rumps.events.on_notification
@rumps.notifications
def on_notification(n):
    print(f'=== outside app class: on_notification, got {n} ===')

@rumps.events.before_start
def before_start():
    print('=== outside app class: before_start ===')

@rumps.events.on_wake
def on_wake():
    print('=== outside app class: on_wake ===')

@rumps.events.on_sleep
def on_sleep():
    print('=== outside app class: on_sleep ===')

app = App('test_event_hooks')
app.run(debug=True)

@jaredks jaredks merged commit e300fe0 into master Jul 5, 2021
@jaredks jaredks deleted the feature-add-event-hooks branch July 5, 2021 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant