Package mrv :: Module util :: Class EventSender
[hide private]
[frames] | no frames]

Class EventSender

source code

object --+
         |
        EventSender
Known Subclasses:

Base class for all classes that want to provide a common callback interface to supply event information to clients.

Usage: Derive from this class and define your callbacks like:

>>> event = Event()
>>> # Call it using
>>> self.event.send([*args][,**kwargs]])
>>> # Users register using
>>> yourinstance.event = callable
>>> # and deregister using
>>> yourinstance.event.remove(callable)

Notes:
Instance Methods [hide private]
 
clearAllEvents(self)
Remove all event receivers for all events registered in this instance.
source code
 
sender(self)
Returns: instance which sent the event you are currently processing
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
listEventNames(cls)
Returns: list of event ids that exist on our class
source code
Class Variables [hide private]
  reraise_on_error = False
hash(x)
  sender_as_argument = False
hash(x)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

clearAllEvents(self)

source code 
Remove all event receivers for all events registered in this instance.

Note: This usually doesn't need to be called directly, but might be useful in conjunction with other system that do not release your strongly bound instance

listEventNames(cls)
Class Method

source code 
Returns:
list of event ids that exist on our class

sender(self)

source code 
Returns:
instance which sent the event you are currently processing
Raises:
  • ValueError - if no event is currently in progress