Event Dispatcher for Python 3.5+
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
docs
misc
tests
whistle
.coveragerc
.gitignore
.style.yapf
.travis.yml
MANIFEST.in
Makefile
Projectfile
README.rst
RELEASE.rst
classifiers.txt
readthedocs.yml
requirements-dev.txt
requirements.txt
setup.cfg
setup.py
version.txt

README.rst

Whistle

Whistle is a lightweight python library that allow your application components to communicate with each other by dispatching events and listening to them.

PyPI Versions Documentation Status https://travis-ci.org/python-whistle/whistle.svg?branch=master Coverage License Status

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.

License Status