Event dispatcher (see python-whistle.github.io).
Project description
Whistle is a lightweight python library that allow your application components to communicate with each other by dispatching events and listening to them.
Homepage: https://python-whistle.github.io/
Install
pip install whistle
Quick start
Install the whistle package:
$ pip install whistle
Create an event dispatcher:
from whistle import EventDispatcher
dispatcher = EventDispatcher()
Add a listener to react to events
def on_spectacle_starts(event):
print('Please turn down your phones!')
dispatcher.add_listener('spectacle.starts', on_spectacle_starts)</code></pre>
Dispatch!
dispatcher.dispatch('spectacle.starts')
Made with ♥ by Romain Dorgueil and contributors.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
whistle-1.0.1.tar.gz
(4.5 kB
view hashes)
Built Distributions
whistle-1.0.1-py3.6.egg
(7.3 kB
view hashes)
whistle-1.0.1-py3.5.egg
(7.3 kB
view hashes)