Module EventManager :: Class EventManager
[hide private]
[frames] | no frames]

Class EventManager

source code

            object --+    
                     |    
pyLinAcc.Event.Manager --+
                         |
                        EventManager

Watches for AT-SPI events and reports them to observers. Maintains a queue of AEEvent that are executed on a set interval.

Instance Methods [hide private]
 
__init__(self, acc_eng)
Initializes the parent class.
source code
 
init(self, view_man, tier_man, **kwargs)
Stores references to the ViewManager and TierManager.
source code
 
close(self)
Throws away all events in the raw_queue and ae_queue.
source code
 
addMonitors(self, *monitors)
Adds one or more AEMonitors to the list of monitors to be notified about events.
source code
AEMonitor.MonitorCollection
getMonitors(self)
Returns: Collection of all loaded AEMonitors
source code
 
showEvent(self, event)
Informs AEMonitors added via addMonitors of a raw event.
source code
True
_executeEvent(self, event)
Executes the provided AEEvent.
source code
 
flushEvents(self)
Flushes the event queue by destroying it and recreating it.
source code
 
postEvents(self, *events)
Add AEEvents to the queue.
source code
 
handleEvent(self, event)
Overrides the base implementation of handleEvent so that all pyLinAcc.Event.Events of interest are queued rather than immediately dispatched.
source code
boolean
onPumpRawEvents(self)
Pumps all pyLinAcc.Event.Events in the raw_queue.
source code
boolean
onPumpAEEvents(self)
Pumps all AEEvents in the ae_queue.
source code

Inherited from pyLinAcc.Event.Manager: addClient, generateKeyEvent, removeClient

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Instance Variables [hide private]
AccessEngine acc_eng
Reference to the AccessEngine object
Queue.Queue ae_queue
FIFO queue of AEEvent to be executed
AEEvent last_event
Queue.Queue raw_queue
FIFO queue of pyLinAcc.Event.Events to be dispatched
TierManager tier_manager
Reference to the TierManager object
integer timer_id
ID of the timer pumping the event queue
ViewManager view_manager
Reference to the ViewManager object

Inherited from pyLinAcc.Event.Manager: clients, observers, registry

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, acc_eng)
(Constructor)

source code 

Initializes the parent class. Creates an event queue. Asks the AccessEngine to schedule interval callbacks to the EventManager.onPumpRawEvents and EventManager.onPumpAEEvents methods.

Parameters:
Overrides: pyLinAcc.Event.Manager.__init__

init(self, view_man, tier_man, **kwargs)

source code 

Stores references to the ViewManager and TierManager. Instantiates all AEMonitor UIEs registered with UIRegistrar to be loaded at startup. Called by AccessEngine at startup.

Parameters:

close(self)

source code 

Throws away all events in the raw_queue and ae_queue. Calls the parent class close method.

Overrides: pyLinAcc.Event.Manager.close

addMonitors(self, *monitors)

source code 

Adds one or more AEMonitors to the list of monitors to be notified about events.

Parameters:

getMonitors(self)

source code 
Returns: AEMonitor.MonitorCollection
Collection of all loaded AEMonitors

showEvent(self, event)

source code 

Informs AEMonitors added via addMonitors of a raw event.

Parameters:

_executeEvent(self, event)

source code 

Executes the provided AEEvent. Provides references to all managers as named parameters to the event's execute method. Catches and logs all exceptions to prevent bad events from getting re-queued for later execution.

Parameters:
  • event (AEEvent) - Event to execute
Returns: True
Did the event execute properly or does it need to be re-queued for later execution?

postEvents(self, *events)

source code 

Add AEEvents to the queue. Events can be added by any part of the system Events marked with immediate priority are executed now instead of being added to the queue. Immediate execution is necessary for some kinds of events.

Parameters:
  • events (tuple of AEEvents) - Events to queue for dispatch

handleEvent(self, event)

source code 

Overrides the base implementation of handleEvent so that all pyLinAcc.Event.Events of interest are queued rather than immediately dispatched. This breaks the synchronous connection between LSR and the rest of the desktop. See pyLinAcc.Event.Manager.handleEvent for more details.

Parameters:
Overrides: pyLinAcc.Event.Manager.handleEvent

onPumpRawEvents(self)

source code 

Pumps all pyLinAcc.Event.Events in the raw_queue. Calls the inherited pyLinAcc.Event.Manager._dispatchEvent method to forward to the event to all registered clients. Catches and logs all exceptions to prevent them from propogating to the main loop that called this method.

This method is called on a set interval by the main event loop in AccessEngine.AccessEngine.run. It is registered for callbacks in the constructor of this class.

Returns: boolean
True to continue receiving notifications

onPumpAEEvents(self)

source code 

Pumps all AEEvents in the ae_queue. Executes each event pumped. Re-queues events for later execution that return False from their execute methods.

This method is called on a set interval by the main event loop in AccessEngine.AccessEngine.run. It is registered for callbacks in the constructor of this class.

Returns: boolean
True to continue receiving notifications