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-2.0.0a1.tar.gz
(5.7 kB
view hashes)
Built Distribution
Close
Hashes for whistle-2.0.0a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81ad3c6e13dee62c32155821f913c2cf2d3df8714dcca92b79ea1e1f75ea73ef |
|
MD5 | bd4e58a7ad606d28303315bf9d126909 |
|
BLAKE2b-256 | 2dc988fae4fd45763548986eae91d45409748515d68a64b0038a637d48cbc0ba |