sardanaevent

This module is part of the Python Pool libray. It defines the base classes for pool event mechanism

Classes

EventGenerator

Inheritance diagram of EventGenerator
class EventGenerator(max_queue_len=10, listeners=None)[source]

A class capable of generating events to their listeners

add_listener(listener)[source]

Adds a new listener for this object.

Parameters:

listener – a listener

remove_listener(listener)[source]

Removes an existing listener for this object.

Parameters:

listener – the listener to be removed

Returns:

True is succeeded or False otherwise

has_listeners()[source]

Returns True if anybody is listening to events from this object

Returns:

True is at least one listener is listening or False otherwise

get_listeners()[source]
fire_event(event_type, event_value, listeners=None)[source]
queue_event(event_type, event_value, listeners=None)[source]
flush_queue()[source]

EventReceiver

Inheritance diagram of EventReceiver
class EventReceiver[source]

A simple class that implements useful features for a class which is an event receiver. The actual class may inherit from this EventReceiver class and may choose to use just a part of the API provided by this class, the whole API or none of the API.

block_events()[source]
unblock_events()[source]
are_events_blocked()[source]

EventType

Inheritance diagram of EventType
class EventType(name, priority=0)[source]

Definition of an event type

get_name()[source]

Returns this event name

Return type:

str

Returns:

this event name

get_priority()[source]

Returns this event priority

Return type:

str

Returns:

this event priority