Package emma :: Module events :: Class Event
[hide private]
[frames] | no frames]

Class Event

source code

Event addressing class

It holds the event name, interface and identifier of the event. You can access to each of them from the object once instanciated:

>>> myEvent = Event(event="foo", identifier="bar")
>>> myEvent.event
'foo'
>>> myEvent.interface
>>> myEvent.identifier
'bar'
Instance Methods [hide private]
 
__init__(self, event=None, interface=None, identifier=None)
Define the event
source code
 
__cmp__(self, event) source code
 
__hash__(self) source code
 
elements(self)
Get the elements of the event
source code
 
all_events(self)
Get all the events that will be trigger with it
source code
Method Details [hide private]

__init__(self, event=None, interface=None, identifier=None)
(Constructor)

source code 

Define the event

Set the event name, interface and identifier, none of them is required. Any of the three elements empty will mean that the event subscription will get all the events with the element or elements defined.

Parameters:
  • event (string) - name of the event
  • interface (string) - interface producer or receiver of the event
  • identifier (string) - the identifier string of the interface

elements(self)

source code 

Get the elements of the event

Returns:
(event, interface, identifier)

all_events(self)

source code 

Get all the events that will be trigger with it

Returns:
[all the combinations of None and elements of the event]

Attention: this method is meant to be use only inside emma.events