Task :: Tools :: System :: System :: Class System
[hide private]
[frames] | no frames]

Class System

source code

    object --+    
             |    
Base.TaskTools --+
                 |
                System

Provides methods for managing Tiers, Perks, and Tasks.

Instance Methods [hide private]
string
getProfileName(self)
Gets the name of the profile LSR is running under.
source code
 
pushPerk(self, *names)
Adds one or more Perks to the top of the stack.
source code
 
insertPerk(self, index, perk)
Adds one Perk to the stack at the insertion index.
source code
 
popPerk(self, *indices)
Removes one or more Perks from the stack given their indices.
source code
 
popThisPerk(self)
Removes the current Perk from the Tier.
source code
 
reloadPerks(self)
Reloads all Perks in the current Tier.
source code
list of string
_getUIEInstances(self, kind, which)
Internal method for getting instances of all installed or associated UIElements for the given kind.
source code
list of string
_getClassNames(self, kind, which)
Internal method for getting class names of all installed or associated UIElements for the given kind.
source code
list of string
_getNames(self, kind, which)
Internal method for getting names of all installed or associated UIElements for the given kind.
source code
list of string
_getDescriptions(self, kind, which)
Internal method for getting descriptions of all installed or associated UIElements for the given kind.
source code
list of 3-tuple of string
getPerkMetadata(self, which=AEConstants.UIE_LOADED)
Gets metadata for all Perks in this Tier, all installed Perks, Perks associated with this Tier, or all Perks associated with this profile depending on the which flag.
source code
list of 3-tuple of string
getDeviceMetadata(self, which=AEConstants.UIE_LOADED)
Gets metadata for all AEOutput and AEInput devices currently loaded in, installed in, or associated with the active profile depending on the which flag.
source code
list of 3-tuple of string
getMonitorMetadata(self, which=AEConstants.UIE_LOADED)
Gets metadata for all AEMonitors currently loaded in, installed in, or associated with the active profile depending on the which flag.
source code
list of 3-tuple of string
getChooserMetadata(self, which=AEConstants.UIE_ALL_ASSOCIATED)
Gets metadata for all AEChoosers installed in or associated with the active profile depending on the which flag.
source code
list of string
getDeviceClassNames(self, which=AEConstants.UIE_LOADED)
Gets the programmatic class names of all AEOutput and AEInput devices currently loaded in, installed in, or associated with the active profile depending on the which flag.
source code
list of string
getDeviceNames(self, which=AEConstants.UIE_LOADED)
Gets the human readable names of all AEOutput and AEInput devices currently loaded in, installed in, or associated with the active profile depending on the which flag.
source code
list of string
getDeviceDescriptions(self, which=AEConstants.UIE_LOADED)
Gets the descriptions of all AEOutput and AEInput devices currently loaded in, installed in, or associated with the active profile depending on the which flag.
source code
list of string
getMonitorClassNames(self, which=AEConstants.UIE_LOADED)
Gets the programmatic class names of all AEMonitors currently loaded in, installed in, or associated with the active profile depending on the which flag.
source code
list of string
getMonitorNames(self, which=AEConstants.UIE_LOADED)
Gets the human readable names of all AEMonitors currently loaded in, installed in, or associated with the active profile depending on the which flag.
source code
list of string
getMonitorDescriptions(self, which=AEConstants.UIE_LOADED)
Gets the human readable descriptions of all AEMonitors currently loaded in, installed in, or associated with the active profile depending on the which flag.
source code
list of string
getChooserClassNames(self, which=AEConstants.UIE_ALL_ASSOCIATED)
Gets the programmatic class names of all AEChoosers installed in or associated with the active profile depending on the which flag.
source code
list of string
getChooserNames(self, which=AEConstants.UIE_ALL_ASSOCIATED)
Gets the human readable names of all AEChoosers installed in or associated with the active profile depending on the which flag.
source code
list of string
getChooserDescriptions(self, which=AEConstants.UIE_ALL_ASSOCIATED)
Gets the descriptions of all AEChoosers installed in or associated with the active profile depending on the which flag.
source code
list of string
getPerkClassNames(self, which=AEConstants.UIE_LOADED)
Gets the programmatic class names of all Perks in this Tier, all installed Perks, Perks associated with this Tier, or all Perks associated with this profile depending on the which flag.
source code
list of string
getPerkNames(self, which=AEConstants.UIE_LOADED)
Gets the human readable names of all Perks in this Tier, all installed Perks, Perks associated with this Tier, or all Perks associated with this profile depending on the which flag.
source code
list of string
getPerkDescriptions(self, which=AEConstants.UIE_LOADED)
Gets the human readable descriptions of all Perks in this Tier, all installed Perks, Perks associated with this Tier, or all Perks associated with this profile depending on the which flag.
source code
 
registerTask(self, task)
Universal task registration method.
source code
 
unregisterTask(self, task)
Universal task unregistration method.
source code
 
chainTask(self, name, link, target)
Chains the Task with the given name to the target Task.
source code
 
unchainTask(self, name, link, target)
Unchains the Task with the given name to the target Task.
source code
Task.Base.Task
getTierNamedTask(self, name)
Gets the Task with the given name if it is registered anywhere in the current Tier.
source code
list of Task.Base.Task
getTierEventTasks(self, event_type, task_layer)
Gets all registered Tasks registered to handle the given AEEvent type on the given layer from the current Tier.
source code
Task.Base.Task
getNamedTask(self, name)
Gets the Task with the given name if it is registered in this Perk only.
source code
list of Task.Base.Task
getEventTasks(self, event_type, task_layer)
Get all registered Tasks registered to handle the given AEEvent type in this Perk only.
source code
AEState
getDeviceState(self, device_name)
Gets the default AEState associated with an AEOutput or AEInput device currently loaded in the DeviceManager.
source code
AEState
getPerkState(self, perk_name, reload=True)
Gets the AEState associated with a Perk.
source code
boolean
loadAllMonitors(self)
Loads and shows all AEMonitors associated with this profile.
source code
boolean
unloadAllMonitors(self)
Hides and unloads all AEMonitors associated with this profile.
source code
 
loadMonitor(self, name)
Loads and shows one AEMonitor.
source code
 
unloadMonitor(self, name)
Hides and unloads one AEMonitor.
source code
AEChooser
loadChooser(self, name, **kwargs)
Loads an AEChooser dialog with the given name from disk.
source code
 
unloadChooser(self, chooser)
Unloads the given AEChooser dialog.
source code
 
doTask(self, task_name, chain=True, propagate=True, layer=None, **kwargs)
Immediately executes a Task registered under the given name in this Tier.
source code
 
blockNTasks(self, n, task_type, condition=lambda**x: True)
Blocks Tasks of the given type from executing in response to the next n events.
source code
 
associatePerk(self, name, tier=None, all_tiers=False, index=None)
Associates a Perk with the active profile.
source code
 
disassociatePerk(self, name, tier=None, all_tiers=False)
Disassociates a Perk from the active profile.
source code
 
associateMonitor(self, name)
Associates a AEMonitor with the active profile.
source code
 
disassociateMonitor(self, name)
Associates a AEMonitor with the active profile.
source code
 
associateDevice(self, name, index=None)
Associates a AEOutput or AEInput device with the active profile.
source code
 
disassociateDevice(self, name)
Disassociates a AEOutput or AEInput device from the active profile.
source code
 
refreshDevices(self)
Unloads all existing devices then immediately loads all devices associated with the active profile.
source code
 
setTempVal(self, name, value)
Stores the given value under the given name.
source code
object
getTempVal(self, name)
Gets the value previously stored under the given name using setTempVal.
source code
 
registerConstants(self, scope, *names)
Adds new constants to AEConstants such that they are visible to other Perks.
source code
object
getPerkByName(self, name)
Gets the Perk with the given name.
source code
object
getPerkVar(self, perk_name, var_name)
Gets the Perk instance variable with the given name.
source code
object
setPerkVar(self, perk_name, var_name, value)
Sets the Perk instance variable with the given name to value.
source code
object
getPerkSetting(self, setting_name, perk_name=None)
Gets the Perk Setting state variable with the given name.
source code
object
getPerkSettingVal(self, setting_name, perk_name=None)
Gets the value of the Perk Setting state variable with the given name.
source code
 
setPerkSettingVal(self, setting_name, value, perk_name=None)
Sets the value of the Perk Setting state variable with the given name.
source code
list of 2-tuple of string
getHistory(self)
Gets the zipped contents of getTaskHistory and getPerkHistory.
source code
list of string
getTaskHistory(self)
Gets the identities of all Tasks that have executed in response to the event currently being processed.
source code
list of string
getPerkHistory(self)
Gets the class names of all Perks that have executed in response to the event currently being processed.
source code
string
getAnchorTaskId(self)
Gets the identity of the Task which this one is executing before, after, or around according to a previous chaining.
source code
string
getAnchorPerkClassName(self)
Gets the class name of the Perk owning the Task that would be returned by getAnchorTaskId.
source code
list of string
getPerkTaskNames(self, perk_name=None)
Gets the names of all Tasks currently registered in the named Perk.
source code
list of string
getTierTaskNames(self)
Gets the names of all Tasks currently registered in this Tier.
source code

Inherited from Base.TaskTools: __init__, close, init, postClose, postExecute, preExecute, preInit

Inherited from Base.TaskTools (private): _changeDefaultOutput

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

getProfileName(self)

source code 

Gets the name of the profile LSR is running under.

Returns: string
Profile name

pushPerk(self, *names)

source code 

Adds one or more Perks to the top of the stack. If more than one Perk is specified, the last specified Perk will be at the top of the stack when this method completes. That is, the behavior of pushing more than one Perk at a time is the same as if each Perk were pushed individually.

Parameters:
  • names (string) - Names of Perks to add

insertPerk(self, index, perk)

source code 

Adds one Perk to the stack at the insertion index. Negative indices are valid per Python list convention.

Parameters:
  • index (integer) - Index at which the Perk should be inserted into the stack where zero is the bottom
  • perk (Perk) - Perk to add

popPerk(self, *indices)

source code 

Removes one or more Perks from the stack given their indices.

Parameters:
  • indices (list of integer) - Indices of Perks to remove
Raises:
  • IndexError - When the stack is empty
  • ValueError - When specified Perk is not found

popThisPerk(self)

source code 

Removes the current Perk from the Tier. No Task.Tools methods should be invoked after this call.

reloadPerks(self)

source code 

Reloads all Perks in the current Tier. Any changes made to the Perk logic will take effect immediately after the reload. This method does not refer to the Perks associated with the current profile. It simply reloads all currently loaded Perks.

_getUIEInstances(self, kind, which)

source code 

Internal method for getting instances of all installed or associated UIElements for the given kind.

Parameters:
  • kind (string) - Kind of UIElement to fetch metadata for, one of UIRegistrar.ALL_KINDS
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of string
All descriptions
Notes:
  • Installed UIEs that are not importable because of missing dependencies or other errors are not included in the list.
  • Getting loaded chooser names is not currently supported.

_getClassNames(self, kind, which)

source code 

Internal method for getting class names of all installed or associated UIElements for the given kind.

Parameters:
  • kind (string) - Kind of UIElement to fetch metadata for, one of UIRegistrar.ALL_KINDS
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of string
All descriptions

Note: Installed UIEs that are not importable because of missing dependencies are not listed as installed to maintain parity with _getNames and _getDescriptions.

_getNames(self, kind, which)

source code 

Internal method for getting names of all installed or associated UIElements for the given kind.

Parameters:
  • kind (string) - Kind of UIElement to fetch metadata for, one of UIRegistrar.ALL_KINDS
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of string
All descriptions

_getDescriptions(self, kind, which)

source code 

Internal method for getting descriptions of all installed or associated UIElements for the given kind.

Parameters:
  • kind (string) - Kind of UIElement to fetch metadata for, one of UIRegistrar.ALL_KINDS
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of string
All descriptions

getPerkMetadata(self, which=AEConstants.UIE_LOADED)

source code 

Gets metadata for all Perks in this Tier, all installed Perks, Perks associated with this Tier, or all Perks associated with this profile depending on the which flag. Includes Perk class names, human readable names, and descriptions.

The default value is used if which is invalid.

Parameters:
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of 3-tuple of string
Class names, names, descriptions

getDeviceMetadata(self, which=AEConstants.UIE_LOADED)

source code 

Gets metadata for all AEOutput and AEInput devices currently loaded in, installed in, or associated with the active profile depending on the which flag.

The default value is used if which is invalid.

Parameters:
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of 3-tuple of string
Class names, names, descriptions

getMonitorMetadata(self, which=AEConstants.UIE_LOADED)

source code 

Gets metadata for all AEMonitors currently loaded in, installed in, or associated with the active profile depending on the which flag.

The default value is used if which is invalid.

Parameters:
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of 3-tuple of string
Class names, names, descriptions

getChooserMetadata(self, which=AEConstants.UIE_ALL_ASSOCIATED)

source code 

Gets metadata for all AEChoosers installed in or associated with the active profile depending on the which flag.

The default value is used if which is invalid.

Parameters:
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of 3-tuple of string
Class names, names, descriptions

Note: Getting loaded chooser names is not currently supported.

getDeviceClassNames(self, which=AEConstants.UIE_LOADED)

source code 

Gets the programmatic class names of all AEOutput and AEInput devices currently loaded in, installed in, or associated with the active profile depending on the which flag.

The default value is used if which is invalid.

Parameters:
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of string
Names of all AEOutput and AEInput classes

getDeviceNames(self, which=AEConstants.UIE_LOADED)

source code 

Gets the human readable names of all AEOutput and AEInput devices currently loaded in, installed in, or associated with the active profile depending on the which flag.

The default value is used if which is invalid.

Parameters:
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of string
Names of all AEOutput and AEInput devices

getDeviceDescriptions(self, which=AEConstants.UIE_LOADED)

source code 

Gets the descriptions of all AEOutput and AEInput devices currently loaded in, installed in, or associated with the active profile depending on the which flag.

The default value is used if which is invalid.

Parameters:
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of string
Names of all AEOutput and AEInput devices

getMonitorClassNames(self, which=AEConstants.UIE_LOADED)

source code 

Gets the programmatic class names of all AEMonitors currently loaded in, installed in, or associated with the active profile depending on the which flag.

The default value is used if which is invalid.

Parameters:
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of string
Names of all AEMonitor classes

getMonitorNames(self, which=AEConstants.UIE_LOADED)

source code 

Gets the human readable names of all AEMonitors currently loaded in, installed in, or associated with the active profile depending on the which flag.

The default value is used if which is invalid.

Parameters:
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of string
Names of all AEMonitors

getMonitorDescriptions(self, which=AEConstants.UIE_LOADED)

source code 

Gets the human readable descriptions of all AEMonitors currently loaded in, installed in, or associated with the active profile depending on the which flag.

The default value is used if which is invalid.

Parameters:
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of string
Descriptions of all AEMonitors

getChooserClassNames(self, which=AEConstants.UIE_ALL_ASSOCIATED)

source code 

Gets the programmatic class names of all AEChoosers installed in or associated with the active profile depending on the which flag.

The default value is used if which is invalid.

Parameters:
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of string
Names of all AEChooser classes

Note: Getting loaded chooser names is not currently supported.

getChooserNames(self, which=AEConstants.UIE_ALL_ASSOCIATED)

source code 

Gets the human readable names of all AEChoosers installed in or associated with the active profile depending on the which flag.

The default value is used if which is invalid.

Parameters:
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of string
Names of all AEChoosers

Note: Getting loaded chooser names is not currently supported.

getChooserDescriptions(self, which=AEConstants.UIE_ALL_ASSOCIATED)

source code 

Gets the descriptions of all AEChoosers installed in or associated with the active profile depending on the which flag.

The default value is used if which is invalid.

Parameters:
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of string
Descriptions of all AEChoosers

Note: Getting loaded chooser names is not currently supported.

getPerkClassNames(self, which=AEConstants.UIE_LOADED)

source code 

Gets the programmatic class names of all Perks in this Tier, all installed Perks, Perks associated with this Tier, or all Perks associated with this profile depending on the which flag.

The default value is used if which is invalid.

Parameters:
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of string
Names of all Perk classes

getPerkNames(self, which=AEConstants.UIE_LOADED)

source code 

Gets the human readable names of all Perks in this Tier, all installed Perks, Perks associated with this Tier, or all Perks associated with this profile depending on the which flag.

The default value is used if which is invalid.

Parameters:
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of string
Names of all Perks

getPerkDescriptions(self, which=AEConstants.UIE_LOADED)

source code 

Gets the human readable descriptions of all Perks in this Tier, all installed Perks, Perks associated with this Tier, or all Perks associated with this profile depending on the which flag.

The default value is used if which is invalid.

Parameters:
  • which (integer) - Which names to get, one of the UIE_ constants in AEConstants
Returns: list of string
Descriptions of all Perks

registerTask(self, task)

source code 

Universal task registration method. Uses known interfaces to try to register the given Task as an event task, an input task, a timer task, etc. All information for configuring the Task is contained in the task itself.

Parameters:
Raises:
  • NotImplementedError - When the Task does not properly implement the interfaces it should

unregisterTask(self, task)

source code 

Universal task unregistration method. Uses known interfaces to try to unregister the given Task as an event task, an input task, a timer task, etc. All information for configuring the Task is contained in the task itself.

Parameters:
Raises:
  • NotImplementedError - When the Task does not properly implement the interfaces it should

chainTask(self, name, link, target)

source code 

Chains the Task with the given name to the target Task. If link is CHAIN_BEFORE, the linked Task will execute before the target. If link is CHAIN_AFTER, the linked Task will execute after. If link is CHAIN_AROUND, the linked Task will execute in lieu of the target, but can execute the target manually using doTask.

Parameters:
  • target (string) - Name of the Task to link to
  • link (integer) - One of the CHAIN constants in AEConstants.Tools
  • name (string) - Name of the Task to link

unchainTask(self, name, link, target)

source code 

Unchains the Task with the given name to the target Task. The link parameter has the same meaning as in chainTask. If link is set to None, one reference to the named Task is removed from the before, after, and around chains.

Parameters:
  • target (string @param link One of the CHAIN constants in AEConstants.Tools or None) - Name of the Task to unlink from
  • name (string) - Name of the Task to unlink
Raises:
  • ValueError - When the named Task is not unlinked at least once
  • KeyError - When the target Task does not have a chain segement in this Perk for the given link type

Note: The target Task must be registered at the time of invocation.

getTierNamedTask(self, name)

source code 

Gets the Task with the given name if it is registered anywhere in the current Tier. If no Task is registered under the given name, returns None.

Calls Tier.Tier.getNamedTask to search across all Perks in the owning Tier.

Parameters:
  • name (string) - Name of the Task to locate
Returns: Task.Base.Task
Task with the given name or None

getTierEventTasks(self, event_type, task_layer)

source code 

Gets all registered Tasks registered to handle the given AEEvent type on the given layer from the current Tier.

Calls Tier.Tier.getEventTasks to search across all Perks in the owning Tier.

Parameters:
  • event_type (AEEvent class) - Desired type of AEEvent
  • task_layer (integer) - Layer on which the desired Tasks are registered
Returns: list of Task.Base.Task
List of all Tasks that handle the given event type and on the given layer in the Tier which owns this Perk

getNamedTask(self, name)

source code 

Gets the Task with the given name if it is registered in this Perk only. If no Task is registered under the given name in this Perk, returns None.

Parameters:
  • name (string) - Name of the Task to locate
Returns: Task.Base.Task
Task with the given name or None

See Also: getTierNamedTask

getEventTasks(self, event_type, task_layer)

source code 

Get all registered Tasks registered to handle the given AEEvent type in this Perk only.

Parameters:
  • event_type (AEEvent class) - Desired type of AEEvent
  • task_layer (integer) - Layer on which the desired Tasks are registered
Returns: list of Task.Base.Task
List of all Tasks that handle the given event type on the given layer in this Perk

See Also: getTierEventTasks

getDeviceState(self, device_name)

source code 

Gets the default AEState associated with an AEOutput or AEInput device currently loaded in the DeviceManager.

Parameters:
  • device_name (string) - Name of the device
Returns: AEState
Loaded state for the device

getPerkState(self, perk_name, reload=True)

source code 

Gets the AEState associated with a Perk. If the state was previously persisted to disk, it is loaded from disk. If not, a new state object is created for the named Perk and immediately persisted in the user's profile.

Parameters:
  • perk_name (string) - Name of the Perk
Returns: AEState
Loaded state for the Perk

loadAllMonitors(self)

source code 

Loads and shows all AEMonitors associated with this profile.

Returns: boolean
Was at least one monitor loaded?

unloadAllMonitors(self)

source code 

Hides and unloads all AEMonitors associated with this profile.

Returns: boolean
Was at least one monitor unloaded?

loadMonitor(self, name)

source code 

Loads and shows one AEMonitor.

Parameters:
  • name (string) - Class name of the AEMonitor

unloadMonitor(self, name)

source code 

Hides and unloads one AEMonitor.

Parameters:
  • name (string) - Class name of the AEMonitor

loadChooser(self, name, **kwargs)

source code 

Loads an AEChooser dialog with the given name from disk. Passes the keyword arguments to the init method of the chooser. This method should typically only be invoked by a Task.ChooserTask subclass.

Parameters:
  • name (string) - UIE name of the chooser
  • kwargs (dictionary) - Keyword arguments to initialize the chooser
Returns: AEChooser
Reference to the chooser if it was created. If it already existed, None is returned instead.

unloadChooser(self, chooser)

source code 

Unloads the given AEChooser dialog. This method should typically only be invoked by a Task.ChooserTask subclass.

Parameters:
  • chooser (AEChooser) - The chooser to unload

doTask(self, task_name, chain=True, propagate=True, layer=None, **kwargs)

source code 

Immediately executes a Task registered under the given name in this Tier. Keyword arguments for Task execution may be provided. The task_por of this Task is always provided to the Task being executed and this Task's task_por is updated with the value of the pointer after the other Task has finished execution.

The chain parameter dictates whether only the named Task is executed (False), or if all other Tasks chained to it are as well (True). The propagate parameter determines whether the execute or update method is called on the Task. This param is not typically specified by a Task or Perk. It is used internally by Task.CyclicInputTask to handle the propagation flag in Task chains.

Parameters:
  • task_name (string) - Name of the Task to execute
  • chain (boolean) - Execute all Tasks chained to the one named or just the one named?
  • propagate (boolean) - Should chained Tasks be executed (True) or updated (False)?
  • layer (integer) - Event layer on which the Task will execute. Defaults to the same layer as the caller if None.
  • kwargs (dictionary) - Arbitrary keyword arguments to pass to the Task, some of which may be required, others which may be optional, and others which may be completely ignored

blockNTasks(self, n, task_type, condition=lambda**x: True)

source code 

Blocks Tasks of the given type from executing in response to the next n events. This is a convenience shortcut to avoid registering one-shot Tasks in Perks to do exactly the same thing.

Parameters:
  • n (integer) - Number of events to block
  • task_type (Task class) - Kind of Task to block
  • condition (callable) - Condition statement to check if the event is actually one to be consumed. The callable is called with the keyword arguments passed to the Task execute method.

associatePerk(self, name, tier=None, all_tiers=False, index=None)

source code 

Associates a Perk with the active profile.

Parameters:
  • name (string) - Name of the UIE to associate
  • tier (string) - Name of the Tier with which the Perk will be associated. Defaults to the name of the Tier specified by the Perk itself.
  • all_tiers (boolean) - Should the Perk be loaded on every Tier? Defaults to the value specified by the Perk itself.
  • index (integer) - Load order index of the Perk. Lower means sooner to load but also later to handle events (i.e. bottom of the Perk stack).

disassociatePerk(self, name, tier=None, all_tiers=False)

source code 

Disassociates a Perk from the active profile.

Parameters:
  • name (string) - Name of the UIE to disassociate
  • tier (string) - Name of the Tier from which the Perk will be disassociated. Defaults to the name of the Tier specified by the Perk itself.
  • all_tiers - Should the Perk be removed from the list of Perks to load for every Tier? Defaults to the value specified by the Perk itself.

associateMonitor(self, name)

source code 

Associates a AEMonitor with the active profile. Loads it immediately.

Parameters:
  • name (string) - Name of the UIE to associate

disassociateMonitor(self, name)

source code 

Associates a AEMonitor with the active profile. Unloads it immediately.

Parameters:
  • name (string) - Name of the UIE to associate

associateDevice(self, name, index=None)

source code 

Associates a AEOutput or AEInput device with the active profile. Does not load it immediately. See refreshDevices for that functionality.

Parameters:
  • name (string) - Name of the UIE to associate
  • index (integer) - Load order index of the device where lower means sooner, None means last.

disassociateDevice(self, name)

source code 

Disassociates a AEOutput or AEInput device from the active profile. Does not unload it immediately. See refreshDevices for that functionality.

Parameters:
  • name (string) - Name of the UIE to associate

setTempVal(self, name, value)

source code 

Stores the given value under the given name. The data will be available via getTempVal to all Tasks executing or updating in response to the current AEEvent. This includes cascading Task.EventTasks, chained Task.InputTasks with names, etc. Once the event has been handled by all Tasks, all stored information is discarded automatically.

The name must be an immutable object. The value can be an arbitrary object. Only the value from the most recent call with a given name is stored.

Parameters:
  • name (immutable) - Name to associate with the value
  • value (object) - Any value to store

getTempVal(self, name)

source code 

Gets the value previously stored under the given name using setTempVal. See that method for details.

If no value has been stored under the given name, None is returned.

Parameters:
  • name (immutable) - Name of the stored data
Returns: object
Value stored under the given name or None

registerConstants(self, scope, *names)

source code 

Adds new constants to AEConstants such that they are visible to other Perks. If any of the named constants do not exist, an exception will be raised. If any of the named constants are already registered, they will be silently ignored by AEConstants.register.

Parameters:
  • scope (dictionary) - Scope in which the constants are defined (e.g. globals())
  • names (list of string) - Names of constants to register
Raises:
  • KeyError - When one of the named constants does not exist in the scope

getPerkByName(self, name)

source code 

Gets the Perk with the given name.

If no perk is registered under the given name, KeyError is raised.

Parameters:
  • name (string) - Name of the perk
Returns: object
Perk with the given name
Raises:
  • KeyError - When the perk with the given name is not found

getPerkVar(self, perk_name, var_name)

source code 

Gets the Perk instance variable with the given name.

If no perk is registered under the given name a KeyError is raised if the perk does not contain var_name an AttributeError is raised.

Parameters:
  • perk_name (immutable) - Name of the perk
  • var_name (immutable) - Name of the instance variable
Returns: object
perk variable with the given name
Raises:
  • KeyError - When the perk or variable with it's given name is not found
  • AttributeError - When attribute is not found is not found

setPerkVar(self, perk_name, var_name, value)

source code 

Sets the Perk instance variable with the given name to value.

If no perk is registered under the given name a KeyError is raised if the perk does not contain var_name an AttributeError is raised.

Parameters:
  • perk_name (immutable) - Name of the perk
  • var_name (immutable) - Name of the instance variable
  • value (immutable) - value to set instance variable
Returns: object
perk variable with the given name
Raises:
  • KeyError - When the perk or variable with it's given name
  • AttributeError - When attribute is not found

getPerkSetting(self, setting_name, perk_name=None)

source code 

Gets the Perk Setting state variable with the given name.

If no perk is registered under the given name or setting_name is not found, KeyError is raised.

Parameters:
  • perk_name (immutable) - Name of the perk
  • setting_name (immutable) - Name of the perk
Returns: object
Setting object for given perk.
Raises:
  • KeyError - When the perk is not found

getPerkSettingVal(self, setting_name, perk_name=None)

source code 

Gets the value of the Perk Setting state variable with the given name.

If no perk is registered under the given name or if setting_name is not found, KeyError is raised.

Parameters:
  • perk_name (immutable) - Name of the perk
  • setting_name (immutable) - Name of the perk
Returns: object
value contained in AEState attribute with given name
Raises:
  • KeyError - When the perk is not found

setPerkSettingVal(self, setting_name, value, perk_name=None)

source code 

Sets the value of the Perk Setting state variable with the given name.

If no perk is registered under the given name or if setting_name is not found, KeyError is raised.

Parameters:
  • perk_name (immutable) - Name of the perk
  • setting_name (immutable) - Name of the perk
  • value - value contained in AEState attribute with given name
  • value - object
Raises:
  • KeyError - When the Perk is not found

getHistory(self)

source code 

Gets the zipped contents of getTaskHistory and getPerkHistory. This method does not involve extra processing because the history is already zipped in the Tier. In fact, the other methods require the extra work of unzipping.

The history is ordered from the first Task to respond to an event to the most recent Task to respond, including the current Task.

Returns: list of 2-tuple of string
List of Task identities and Perk class names

getTaskHistory(self)

source code 

Gets the identities of all Tasks that have executed in response to the event currently being processed. This includes all chained Tasks and all Tasks executed using doTask flattened into a linear history.

If any Task that executed did not have an identity, None is substituted in its place.

The history is ordered from the first Task to respond to an event to the most recent Task to respond, including the current Task.

Returns: list of string
Identities of the Tasks

getPerkHistory(self)

source code 

Gets the class names of all Perks that have executed in response to the event currently being processed. The contents of the list returned by this method have a one-to-one pairing with the list contents from getTaskHistory.

The history is ordered from the first Perk to respond to an event to the most recent Perk to respond, including the current Perk.

Returns: list of string
Class names of the Perks

getAnchorTaskId(self)

source code 

Gets the identity of the Task which this one is executing before, after, or around according to a previous chaining. If this Task is not executing as part of a chain, returns None.

Returns: string
Identity of the Task or None

getAnchorPerkClassName(self)

source code 

Gets the class name of the Perk owning the Task that would be returned by getAnchorTaskId.

Returns: string
Class name of the Perk or None

See Also: getAnchorTaskId

getPerkTaskNames(self, perk_name=None)

source code 

Gets the names of all Tasks currently registered in the named Perk. If no name is given, this Perk is used. If the named Perk is not found, an exception is raised.

Parameters:
  • perk_name (string) - Name of the Perk to query or None to mean this one
Returns: list of string
List of all registered Task names
Raises:
  • KeyError - When the named Perk is not loaded

getTierTaskNames(self)

source code 

Gets the names of all Tasks currently registered in this Tier.

Returns: list of string
List of all registered Task names