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

Class TierManager

source code

object --+
         |
        TierManager

Creates Tiers for all processes detectable by pyLinAcc. Routes AEEvents to the active Tier for handling by Tasks registered by Perks. Changes the active Tier as the active top-level application changes.

Instance Methods [hide private]
 
__init__(self, ae)
Creates the empty dictionary for storing Tiers and initializes the active tier to None.
source code
 
init(self, view_man, sett_man, **kwargs)
Stores a references to the DeviceManager.
source code
 
close(self)
Removes all monitors and persists the current LSRState.
source code
LSRState
getState(self)
Returns: State shared across all Tiers
source code
AEMonitor.MonitorCollection
getMonitors(self)
Returns: Collection of all loaded AEMonitors
source code
 
addMonitors(self, *monitors)
Adds one or more AEMonitors to the list of monitors to be notified about events.
source code
 
showTask(self, task, perk)
Informs AEMonitors added via addMonitors of a Task executing or updating.
source code
 
showEvent(self, event, tier_name)
Informs AEMonitors added via addMonitors of an event.
source code
 
showChain(self, chain_type, anchor_ident)
Informs AEMonitors added via addMonitors of a chained Task executing.
source code
 
showPropagate(self, propagate)
Informs AEMonitors added via addMonitors of the propagation return value from a Task.
source code
 
freeDeadTiers(self, aids)
Compares the list of given application names and IDs with those currently associated with Tiers.
source code
Tier
createTier(self, name, aid, por, init)
Creates a new Tier using the application name and ID as a hash code.
source code
 
removeTier(self, aid)
Removes an existing Tier.
source code
 
switchTier(self, name, aid, por)
Switches the active Tier based on the current view's root accessible.
source code
 
setEventInterest(self, kind, wants)
Informs the ViewManager of a change in interest in AEEvents by some Tier.
source code
 
_resetGesture(self)
Resets the gesture sequence counter.
source code
 
manageEvent(self, event)
Dispatches an AEEvent to the Tier to be handled by its Perks.
source code
 
manageGesture(self, event)
Dispatches an AEEvent to the active Tier so that it can determine which registered Task, if any, should be executed in response to some AEInput.Gesture.
source code
 
manageChooser(self, event)
Dispatches an AEEvent.ChooserChange to the Tier associated with the event so that it can determine which registered Task, if any, should be executed in response to a change in the chooser such as its completion or its cancellation.
source code
 
manageTimer(self, event)
Dispatches an AEEvent.TimerAlert to the Tier associated with the event so that it can determine which registered Task, if any, should be executed in response to the timer firing.
source code
 
managePrivate(self, event)
Dispatches an AEEvent.PrivateChange to the active Tier so it can store important information without passing it along to Perks and Tasks.
source code

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

Instance Variables [hide private]
AccessEngine acc_eng
The Access Engine that started this manager
Tier active_tier
Tier for the application currently in focus
SettingsManager sett_manager
Reference to the SettingsManager to be used to persist and load LSRState
LSRState state
Global state informaion.
dictionary tiers
All Tiers created for running applications
ViewManager view_manager
Reference to the ViewManager to be used to dynamically change which events should be monitored based on the registered Tasks
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, ae)
(Constructor)

source code 

Creates the empty dictionary for storing Tiers and initializes the active tier to None. Stores a reference to AccessEngine.

Parameters:
Overrides: object.__init__

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

source code 

Stores a references to the DeviceManager. Called by AccessEngine at startup.

Parameters:

close(self)

source code 

Removes all monitors and persists the current LSRState. Informs all existing Tiers that their state should be persisted also.

getState(self)

source code 
Returns: LSRState
State shared across all Tiers

getMonitors(self)

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

addMonitors(self, *monitors)

source code 

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

Parameters:

showTask(self, task, perk)

source code 

Informs AEMonitors added via addMonitors of a Task executing or updating.

Parameters:

showEvent(self, event, tier_name)

source code 

Informs AEMonitors added via addMonitors of an event.

Parameters:
  • event (AEEvent) - An AEEvent object
  • tier_name (string) - Name of the Tier executing the event

showChain(self, chain_type, anchor_ident)

source code 

Informs AEMonitors added via addMonitors of a chained Task executing.

Parameters:
  • chain_type (integer) - One of the AEConstants CHAIN_* constants
  • anchor_ident (string) - Identifier of the anchor Task

showPropagate(self, propagate)

source code 

Informs AEMonitors added via addMonitors of the propagation return value from a Task.

Parameters:
  • propagate (boolean) - Was the event consumed (False) or allowed to propagate (True)?

freeDeadTiers(self, aids)

source code 

Compares the list of given application names and IDs with those currently associated with Tiers. Frees Tiers in the tiers dictionary that no longer have associated applications.

Parameters:
  • aids (list) - List of identifiers for applications currently in existence

createTier(self, name, aid, por, init)

source code 

Creates a new Tier using the application name and ID as a hash code. If init is True, only creates the Tier if a specific Perk is associated with this profile for the named application.

Parameters:
  • name (string) - Name of the now active application
  • aid (hashable) - Unique ID for the application associated with the Tier
  • init (boolean) - Initialize the Tier only if a Perk is associated for this particular application?
  • por (POR) - Point of regard to the top object represented by the Tier
Returns: Tier
The new Tier that was created

removeTier(self, aid)

source code 

Removes an existing Tier.

Parameters:
  • aid (hashable) - Unique ID for the application associated with the Tier

switchTier(self, name, aid, por)

source code 

Switches the active Tier based on the current view's root accessible. The view's root accessible is queried for information that can uniquely identify the Tier to use.

If a Tier already exists for the given view, it is activated. If one does not exist, a Tier is created using createTier and made active.

Parameters:
  • name (string) - Name of the now active application
  • aid (hashable) - Unique ID for the application associated with the Tier
  • por (POR) - Point of regard to the top object represented by the Tier

setEventInterest(self, kind, wants)

source code 

Informs the ViewManager of a change in interest in AEEvents by some Tier. Used to optimize which system events are monitored in order to improve performance. Just acts as a proxy.

Parameters:
  • kind (AEEvent class) - Kind of AEEvent of interest to a Task
  • wants (boolean) - Does a Perk want an event (i.e. a Task is registering for it or no longer want an event (i.e. a Task is unregistering for it)?

manageEvent(self, event)

source code 

Dispatches an AEEvent to the Tier to be handled by its Perks. Makes the final determination of on what layer the event occurred. Events from a focused source are already marked as AEConstants.Event.LAYER_FOCUS. Events from a unfocused source in the active Tier are marked as AEConstants.Event.LAYER_TIER. All other events for which a Tier exists to handle them are marked as AEConstants.Event.LAYER_BACKGROUND.

Parameters:

manageGesture(self, event)

source code 

Dispatches an AEEvent to the active Tier so that it can determine which registered Task, if any, should be executed in response to some AEInput.Gesture.

Parameters:

manageChooser(self, event)

source code 

Dispatches an AEEvent.ChooserChange to the Tier associated with the event so that it can determine which registered Task, if any, should be executed in response to a change in the chooser such as its completion or its cancellation.

Parameters:

manageTimer(self, event)

source code 

Dispatches an AEEvent.TimerAlert to the Tier associated with the event so that it can determine which registered Task, if any, should be executed in response to the timer firing.

Parameters:

managePrivate(self, event)

source code 

Dispatches an AEEvent.PrivateChange to the active Tier so it can store important information without passing it along to Perks and Tasks.

Parameters:

Instance Variable Details [hide private]

state

Global state informaion. Has properties representing system-wide settings.
Type:
LSRState