This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
pyee
======

.. image:: https://travis-ci.org/eagleamon/pyee-topics.png
:target: https://travis-ci.org/eagleamon/pyee-topics

pyee supplies an ``EventEmitter`` object similar to the ``EventEmitter``
from Node.js.

There is also the possibility to use mqtt topic patterns to match events

Example:
--------

::

In [1]: from pyee import EventEmitter

In [2]: ee = EventEmitter()

In [3]: @ee.on('event')
...: def event_handler():
...: print 'BANG BANG'
...:

In [4]: ee.emit('event')
BANG BANG

In [5]:

In [6]: ee.on('a/+/c', lambda ...)

Easy-peasy.


Installation:
-------------

::

sudo pip install pyee

Methods:
--------

**ee.on(event, f=None)**: Registers the function ``f`` to the event name
``event``. Example::

ee.on('data', some_fxn)

If ``f`` is not specified, ``ee.on`` returns a function that takes ``f`` as a
callback, which allows for decorator styles::

@ee.on('data')
def data_handler(data):
print data

**ee.emit(event, *args, **kwargs)**: Emits the event, calling the attached functions
with ``*args``. For example::

ee.emit('data', '00101001')

This will call ``data('00101001')'`` (assuming ``data`` is an attached function).
Returns ``False`` if no functions are attached to handle the emission (otherwise ``True``).

**ee.once(event, f=None)**: The same as ``ee.on``, except that the listener
is automatically removed after it's called.

**ee.remove_listener(event, fxn)**: Removes the function ``fxn`` from ``event``.
Requires that the function is not closed over by ``ee.on`` (using this with the
decorator style is unfortunately not possible).

**ee.remove_all_listeners(event)**: Removes all listeners from ``event``.

**ee.listeners(event)**: Returns the array of all listeners registered to
the given ``event``.


(Special) Events:
-------

**"new_listener"**: Fires whenever a new listener is created. Listeners for this
event do not fire upon their own creation.

**"error"**: When emitted raises an Exception by default, behavior can be overriden by
attaching callback to the event. For example::

@ee.on('error')
def onError(message):
logging.err(message)

ee.emit('error', Exception('something blew up'))

Tests:
------

::

nosetests

License:
--------

MIT.
Release History

Release History

0.0.13

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.12

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.11

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.10

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.9

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.8

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pyee-topics-0.0.13.tar.gz (4.8 kB) Copy SHA256 Checksum SHA256 Source Jul 13, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting