Skip to main content
https://secure.travis-ci.org/nicolaiarocci/events.png?branch=master

The C# language provides a handy way to declare, subscribe to and fire events. Technically, an event is a “slot” where callback functions (event handlers) can be attached to - a process referred to as subscribing to an event. Here is a handy package that encapsulates the core to event subscription and event firing and feels like a “natural” part of the language.

>>> def something_changed(reason):
...     print "something changed because %s" % reason
...

>>> from events import Events
>>> events = Events()
>>> events.on_change += something_changed

Multiple callback functions can subscribe to the same event. When the event is fired, all attached event handlers are invoked in sequence. To fire the event, perform a call on the slot:

>>> events.on_change('it had to happen')
'something changed because it had to happen'

Documentation

Complete documentation is available at http://events.readthedocs.org

Installing

Events is on PyPI so all you need to do is:

pip install events

Testing

Just run:

python setup.py test

Or use tox to test the package under all supported Pythons: 2.6, 2.7, 3.3, 3.4.

License

Events is BSD licensed. See the LICENSE for details.

Contributing

Please see the Contribution Guidelines.

Attribution

Based on the excellent recipe by Zoran Isailovski, Copyright (c) 2005.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Events-0.2.1.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file Events-0.2.1.tar.gz.

File metadata

  • Download URL: Events-0.2.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Events-0.2.1.tar.gz
Algorithm Hash digest
SHA256 0a7f6ca93ff5eac108e9555c50b5b0a23d4e6ec5517c079b13b1c9acb6f3d567
MD5 01fb6bffd04b4f323e539c8cf592b423
BLAKE2b-256 8de355b90312c2640722ed2b4ef378a0782109f71b1801072466d6a7e9dba584

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page