AccessEngine :: AEScript :: AEScript :: Class AEScript
[hide private]
[frames] | no frames]

Class AEScript

source code

                     object --+    
                              |    
AEUserInterface.AEUserInterface --+
                                  |
                                 AEScript

Registers and maintains a collection of Task Functions that will execute in response to AccessEngine events and commands (AEEvents and AEInput.Gestures). This class should be sublclassed by script developers who wish to define, modify, or extend the SUE user interface.

Instance Methods [hide private]
 
__init__(self)
Creates empty dictionaries for registered, event, command and chooser tasks.
source code
 
preInit(self, tier)
Overrides pre-initialization to load persisted state from disk.
source code
 
init(self)
Does nothing.
source code
 
postClose(self)
Frees all tasks managed by this AEScript.
source code
 
close(self)
Does nothing.
source code
AEState
getState(self)
Returns the AEState for this AEScript or a dummy object that can be used to store state information that is neither user configurable or persistable.
source code
 
setIdealOutput(self, *capabilities)
Sets the ideal device capabilities to be used to locate a device for all output methods invoked from the caller's AEScript module, including the Script class itself and all of its registered tasks.
source code
list of string
getIdealOutput(self)
Gets the ideal device capabilities to locate a device to be used by all output methods invoked from the caller's Script module, including the AEScript class itself and all of its registered tasks.
source code
 
_changeDefaultOutput(self, ref=None)
Gets an output device based on the ideal capabilities requested by the current AEScript.
source code
def_out
getOutputDevices(self)
Gets the output device for this AEScript.
source code
AETier
getAETier(self)
Gets the AETier to the AEScript.
source code
AEPor
getPointerPOR(self, script)
Gets the pointer AEPor for this AETier.
source code
 
setPointerPOR(self, por)
Sets the pointer AEPor for this AETier.
source code
AEPor
getVirtualPOR(self)
Get the actual virtual pointer.
source code
 
setVirtualPOR(self, por)
Set the virtual pointer on the passed por position.
source code
3-tuple of integer, string, integer
getLastKey(self)
Gets the key code, key sym, and modifiers of the last key pressed when this AETier was active.
source code
object
getTempData(self, name)
Gets the value previously stored under the given name using AETier.setTempVal.
source code
 
setTempData(self, name, value)
Stores the given value under the given name.
source code
 
registerTask(self, task_name, execute_function, update_function=None)
Registers a new AEScript task under the given name if no task is already registered with that name in this AEScript.
source code
 
registerTimerTask(self, task_name, interval, execute_function, task_script_name=None)
Registers a task to be called on a set interval.
source code
 
registerCyclicInputTask(self, cycle_name, task_name, task_script_name=None)
Registeres a cyclic_input_task and/or links another task to it.
source code
 
registerCyclicInputTasks(self, cycle_name, *task_names)
Registers a list of tasks to a cyclic_input_task.
source code
 
registerCommand(self, device, task_name, description=None, propagate=False, *codes)
Registers a task in this AETier to be executed in response to an AEEvent indicating that the given action codes were input on the given AEInput device.
source code
 
registerChooserTask(self, chooser, task_name)
Registers a chooser_task with the given name to be executed in response to a change in the given AEChooser.
source code
 
bindToEvent(self, task_name, event_kind, focus=False, tier=False, background=False, all=False)
Bindes a script task to an event type.
source code
 
unregisterTask(self, task_name, class_name=None)
Unregisters a registered_task from this AEScript only.
source code
 
unregisterTimerTask(self, task_name, class_name=None)
Unregisters a task from being called on a set interval.
source code
 
unregisterCyclicInputTask(self, cycle_name)
Unregisters a cyclic_input_tasks.
source code
 
unregisterTaskFromCyclicInputTask(self, cycle_name, task_name, cycle_script_name=None, task_script_name=None)
Unregisters one task from a cyclic_input_tasks.
source code
 
unregisterCommand(self, device, *codes)
Unregisters the action codes on the given device.
source code
 
unregisterChooserTask(self, chooser)
Removes the connection between a chooser_tasks and a AEChooser so the task is no longer executed in response to a change in the given AEChooser.
source code
 
unbindFromEvent(self, task_name, event_kind, focus=False, tier=False, background=False, all=False)
Removes the connection between an event_kind and a task.
source code
tuple of string ('task name', 'script name')
getCommandTask(self, gesture_list)
Gets the task registered in this AEScript only to execute in response to the given AEInput.GestureList.
source code
tuple of string ('task name', 'script name')
getChooserTask(self, chooser_key)
Gets a chooser_tasks registered to respond to a certain chooser.
source code
list
getRegisteredTask(self, task_key)
Gets the execute and update functions for the task if it is registered in this AEScript only.
source code
list of tuple ('task name', 'script name')
getEventTasks(self, event_type, task_layer)
Get all tasks registered to handle the given AEEvent type in this AEScript only.
source code
list of string
getChainSegment(self, link, target, class_name=None)
Gets a copy of the segment of the task chain for target specified by the link type.
source code
tuple of string ('task name', 'script name')
mergeChain(self, target, before, after, target_class_name=None)
Adds the before and after segments of the chain for the target specified.
source code
 
chainTask(self, task_name, link, target, target_class_name=None)
Links a task to the one named in target.
source code
 
unchainTask(self, task_name, link, target, target_class_name=None)
Unlinks a task from the one named in target.
source code
list of tuple ('task name', 'script name')
getTaskKeys(self)
Gets the keys to all tasks registered in this AEScript.
source code
 
unregisterModifiers(self, dev, modifiers)
Unregisters a list of input modifiers.
source code
 
registerModifiers(self, dev, modifiers)
Registers a list of input modifiers.
source code
 
doTask(self, task_name_to_do, task_script_to_do=None, propagate=True, chain=True, **kwargs)
Immediately executes a task registered under the given name in this AETier.
source code
 
doCyclicInputTask(self, **kwargs)
Executes the next task which is connected to the cyclic_input_tasks.
source code
object
getScriptSetting(self, setting_name)
Gets the AEScript AEState.Setting variable with the given name.
source code
object
getScriptSettingVal(self, setting_name)
Gets the value of the AEScript AEState.Setting state variable with the given name.
source code
 
setScriptSettingVal(self, setting_name, value)
Sets the value of the AEScript AEState.Setting state variable with the given name.
source code
 
getAnchorTaskId(self)
Gets the identity of the task.
source code
 
getAnchorScriptClassName(self)
Gets the class name of the AEScript.
source code

Inherited from AEUserInterface.AEUserInterface: getClassName, getDescription, getName, getPath

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

Class Variables [hide private]
AEState class STATE = ScriptState
Class to instantiate and use to store state information across all instances of this AEScript.
Instance Variables [hide private]
dictionary after_chains
Mapping from target task name to a list of task names which should be executed after the target :
dictionary around_chains
Mapping from target task name to one task name which should be executed instead of the target :
dictionary around_tasks
additional informations for an event task that is chained around another task :
dictionary before_chains
Mapping from target task name to a list of task names which should be executed before the target :
dictionary chooser_tasks
Connects a task to respond to a change in a AEChooser :
dictionary command_descriptions
Description of the task to be shown in command chooser :
weakref.WeakValueDictionary of (AEInput.GestureList : tuple) commands
Connects a task to a AEInput.GestureList sequence on some AEInput device.
dictionary cyclic_input_tasks
Connects more than one task to a AEInput.GestureList sequence on some AEInput device.
dictionary def_out
Default output device to use for all Output.say calls in a AEScript module :
dictionary event_tasks
Notes which tasks are bind to which event type on which event layer :
list of string out_caps
Capabilities set by setIdealOutput as ideal for output from this AEScript.
weakref.WeakKeyDictionary registered_modifiers
Mapping from device to a registered modifier for that device
dictionary registered_tasks
All task wich are registered with the registerTask method in this AEScript.
ScriptState state
Settings for this AEScript.
AETier tier
The tier for the application this script belongs to.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Creates empty dictionaries for registered, event, command and chooser tasks. Create a state object for storage using the class in STATE in case the AEScript hasn't previously persisted its settings on disk.
Overrides: object.__init__

Note: Script writers should override init to do initialization, not this method.

preInit(self, tier)

source code 
Overrides pre-initialization to load persisted state from disk. Fetches the managers from the AccessEngine first so that state can be loaded using the AESettingsManager. Loads the state, then invokes the super class version of this method to finish initialization.
Parameters:
  • tier (AETier) - The tier for the application this AEScript belongs to.

Note: Script writers should override init to do initialization, not this method.

init(self)

source code 
Does nothing. Reserved for subclasses to initialize themselves.

postClose(self)

source code 
Frees all tasks managed by this AEScript.

Note: Script writers should override close to do finialization, not this method.

close(self)

source code 
Does nothing. Reserved for subclasses to finalize themselves.

getState(self)

source code 
Returns the AEState for this AEScript or a dummy object that can be used to store state information that is neither user configurable or persistable.
Returns: AEState
Returns the settings for this AEScript or a dummy object.

setIdealOutput(self, *capabilities)

source code 
Sets the ideal device capabilities to be used to locate a device for all output methods invoked from the caller's AEScript module, including the Script class itself and all of its registered tasks. The capabilities list should include strings naming AEOutput interfaces ("audio" and/or "braille") at present.
Parameters:
  • capabilities (list of string) - Names of capabilities required on the device.

getIdealOutput(self)

source code 
Gets the ideal device capabilities to locate a device to be used by all output methods invoked from the caller's Script module, including the AEScript class itself and all of its registered tasks.
Returns: list of string
Names of capabilities set as ideal for a default output device.

_changeDefaultOutput(self, ref=None)

source code 
Gets an output device based on the ideal capabilities requested by the current AEScript. Creates a weak proxy for the device object. When the weak ref is no longer valid, this method is called again to find another suitable device.
Parameters:
  • ref (weakref.proxy) - Weak proxy that is no longer valid

getOutputDevices(self)

source code 
Gets the output device for this AEScript.
Returns: def_out
Return the output device for this AEScript.

getAETier(self)

source code 
Gets the AETier to the AEScript.
Returns: AETier
Return the tier to the AEScript.

getPointerPOR(self, script)

source code 
Gets the pointer AEPor for this AETier.
Returns: AEPor
Point of regard stored programmatically by this AETier.

setPointerPOR(self, por)

source code 
Sets the pointer AEPor for this AETier.
Parameters:
  • por (AEPor) - Point of regard to set as the pointer

getVirtualPOR(self)

source code 
Get the actual virtual pointer.
Returns: AEPor
Return the actual virtual pointer

setVirtualPOR(self, por)

source code 
Set the virtual pointer on the passed por position.
Parameters:
  • por (AEPor) - por position

getLastKey(self)

source code 
Gets the key code, key sym, and modifiers of the last key pressed when this AETier was active. This information should not be used to trigger events, but rather as additional information for correcting accessibility problems in certain applications where the standard accessibility events do not provide enough information.
Returns: 3-tuple of integer, string, integer
Key code, key sym, and key modifier bit mask

Note: The values returned by this event are platform specific. This may change in the future. Are you sure you don't want to use a task to response to an AEInput.Gesture?

getTempData(self, name)

source code 

Gets the value previously stored under the given name using AETier.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.

setTempData(self, name, value)

source code 

Stores the given value under the given name. The data will be available via AETier.getTempVal to all tasks executing or updating in response to the current AEEvent. 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.

registerTask(self, task_name, execute_function, update_function=None)

source code 

Registers a new AEScript task under the given name if no task is already registered with that name in this AEScript.

Only one task can be registered under a name in a AEScript. If a task is already registered under the given name, any other registration with that name is ignored.

Tasks that will also be bind to an event can specify an update function. This function will be called when another task forbids the execution of other tasks. The update function allows a task to do necessary actions like state changes.
Parameters:
  • task_name (string) - Name of the task to register.
  • execute_function (instancemethod) - Function that implements the task.
  • update_function (instancemethod) - Function for houskeeping.
Raises:
  • ValueError - When a task with the given name is already registered in this AEScript.

registerTimerTask(self, task_name, interval, execute_function, task_script_name=None)

source code 
Registers a task to be called on a set interval.
Parameters:
  • task_name (string) - Register the name of task.
  • interval (integer) - Interval in seconds which the task will be notified.
  • execute_function (instancemethod) - Function that implements the task.
  • task_script_name (string) - Name of the script in which the execute function of the task is implemented.
Raises:
  • ValueError - When a task with the given name is already registered in the AEScript.

registerCyclicInputTask(self, cycle_name, task_name, task_script_name=None)

source code 

Registeres a cyclic_input_task and/or links another task to it.

A cyclic input task links several tasks together. Every time the cyclic input task is executed it calls the next linked task. This is usefull, to connect more than one task to a keyboard command. This method links one task to the end of a list of tasks, that are already linked to the cyclic input task.
Parameters:
  • cycle_name (string) - Name of the cyclic input task.
  • task_name (string) - Name of the task that shall be linked to the cyclic input task.
  • task_script_name (string) - Name of the script in which the task is registered. If task_script_name is None the current script name will be used.
Raises:
  • ValueError - When the task is not registered.

Note: The task with the task_name must already be registered as a task, before it can be linked to a cyclic input task.

registerCyclicInputTasks(self, cycle_name, *task_names)

source code 
Registers a list of tasks to a cyclic_input_task. Uses the registerCyclicInputTask method.
Parameters:
  • cycle_name (string) - Name of the cyclic input task.
  • task_names (list of string) - List with task names, that shall be connected to the cyclic input task.

Note: If you use this method all tasks must be implemented in the same script. Otherwise use the registerCyclicInputTask directly and specify a script name.

registerCommand(self, device, task_name, description=None, propagate=False, *codes)

source code 
Registers a task in this AETier to be executed in response to an AEEvent indicating that the given action codes were input on the given AEInput device.
Parameters:
  • device (AEInput) - Input device to monitor.
  • codes (list of list of integer) - List of lists of action codes forming the AEInput.Gesture that will trigger the execution of the named task. For example, codes=[[Keyboard.AEK_CTRL, Keyboard.AEK_TILDE]] indicates the single gesture of simultaneously pressing Ctrl and ~ on the keyboard device.
  • description (string) - Description of the task to be shown in command chooser
  • task_name (string) - Name of the task registered via registerTask to execute when the input gesture is detected on the device
  • propagate (boolean) - Should the input gesture be allowed to propagate to the OS after we receive it?
Raises:
  • ValueError - When a task with the given name is not registered.

registerChooserTask(self, chooser, task_name)

source code 
Registers a chooser_task with the given name to be executed in response to a change in the given AEChooser.
Parameters:
  • chooser (AEChooser) - Chooser that the task should observe
  • task_name (string) - Name of a task that should observe the chooser

bindToEvent(self, task_name, event_kind, focus=False, tier=False, background=False, all=False)

source code 

Bindes a script task to an event type. The type determines which kind of AEEvent will trigger the execution of the registered_tasks. If one or more tasks are already registered for this type, the given task will be inserted at the top of the registered stack of tasks (i.e. it will be executed first for the appropriate event).

The focus, tier, and background parameters specify on which layer the task will handle events. If focus is True, the task will be executed in response to an event from a focused control within this AETier. If tier is True, the task will be executed in response to an event from an unfocused control within this AETier. If background is True, the task will be executed in response to an event from any control within the tier when the AETier is not active.

The three layers are mutually exclusive. You may set any combination of focus, tier, and background to True to register the given task on each selected layer in one call. If all three parameters are False, the registration defaults to the focus layer.
Parameters:
  • task_name (string) - Register the name of task.
  • event_kind (int) - For which event will this task be registered. Use the constants in AEConstants.Event that start with EVENT_TYPE_ to specify the event kind.
  • focus (boolean) - Should this task handle events from focused accessibles in this AETier?
  • tier (boolean) - Should this task handle events from unfocused accessibles in this AETier?
  • background (boolean) - Should this task handle events from any accessible in this AETier when the AETier is inactive?
  • all (boolean) - This task registers for all layers.

unregisterTask(self, task_name, class_name=None)

source code 
Unregisters a registered_task from this AEScript only. If a task with the given name is not found in this AEScript, an exception is raised.
Parameters:
  • task_name (string) - Name of the task to unregister.
  • class_name (script) - Name of the script the task is implemented in. If class_name is None this script will be used as class_name.
Raises:
  • KeyError - When a task with the given name in the given script is not registered.

unregisterTimerTask(self, task_name, class_name=None)

source code 
Unregisters a task from being called on a set interval.
Parameters:
  • task_name (string) - Name of the task to unregister.
  • class_name (string) - Name of the class the task is implemented in. If class_name is None the current script name will be used.
Raises:
  • KeyError - When the task is not registered.

unregisterCyclicInputTask(self, cycle_name)

source code 
Unregisters a cyclic_input_tasks.
Parameters:
  • cycle_name (string) - Name of the cyclic input task.

unregisterTaskFromCyclicInputTask(self, cycle_name, task_name, cycle_script_name=None, task_script_name=None)

source code 
Unregisters one task from a cyclic_input_tasks.
Parameters:
  • cycle_name (string) - Name of the cyclic input task.
  • task_name (string) - Name of the task that shall be removed from the cyclic input.
  • cycle_script_name (string) - Name of the script, where the cycle input task was registered. If cycle_script_name is None the current script name will be used.
  • task_script_name (string) - Name of the script, where the task is implemented. If task_script_name is None the current script name will be used.

unregisterCommand(self, device, *codes)

source code 
Unregisters the action codes on the given device.
Parameters:
  • device (AEInput) - Input device to monitor.
  • codes (list of list of integer) - List of lists of action codes forming the AEInput.Gesture that will trigger the execution of the registered tasks. For example, codes=[[Keyboard.AEK_CTRL, Keyboard.AEK_TILDE]] indicates the single gesture of simultaneously pressing Ctrl and ~ on the keyboard device.
Raises:

unregisterChooserTask(self, chooser)

source code 
Removes the connection between a chooser_tasks and a AEChooser so the task is no longer executed in response to a change in the given AEChooser.
Parameters:
  • chooser (AEChooser) - Chooser that the task should no longer observe.
Raises:
  • KeyError - When the given AEChooser is not registered.

unbindFromEvent(self, task_name, event_kind, focus=False, tier=False, background=False, all=False)

source code 
Removes the connection between an event_kind and a task. If the given task was not registered for an event in this AEScript, an exception is raised. The focus, tier, and background parameters state from which layer(s) this task should be unregistered.
Parameters:
  • task_name (string) - Name of the task.
  • event_kind (int) - For which event was this task registered. Use the constants in AEConstants.Event that start with EVENT_TYPE_ to specify the event kind.
  • focus (boolean) - Should this task handle events from focused accessibles in this AETier?
  • tier (boolean) - Should this task handle events from unfocused accessibles in this AETier?
  • background (boolean) - Should this task handle events from any accessible in this AETier when the AETier is inactive?
  • all (boolean) - This task registers for all layers.
Raises:
  • KeyError - When there are no tasks registered for the event type on the specified layer.
  • ValueError - When the given task is not registered for the event type on one of the specified layers.

See Also: bindToEvent

getCommandTask(self, gesture_list)

source code 

Gets the task registered in this AEScript only to execute in response to the given AEInput.GestureList.

Called by AETier.AETier.getCommandTask during a search through all AEScripts in the owning AETier for the given key list.
Parameters:
Returns: tuple of string ('task name', 'script name')
Key of the task set to execute in response to the input gesture or None.

getChooserTask(self, chooser_key)

source code 

Gets a chooser_tasks registered to respond to a certain chooser. None is returned if not found.

Called by AETier.getChooserTask during a search through all AEScripts in the owning AETier for the given AEChooser.
Parameters:
  • chooser_key (integer) - Unique key identifying the Chooser.
Returns: tuple of string ('task name', 'script name')
Key to a task set to execute in response to the chooser or None.

getRegisteredTask(self, task_key)

source code 

Gets the execute and update functions for the task if it is registered in this AEScript only. If no task is registered under the given key in this AEScript, returns None.

Called by AETier.getRegisteredTasks during a search through all AEScripts in the owning AETier for the given name.
Parameters:
  • task_key (tuple of string ('task name', 'script name')) - Key of the task to locate.
Returns: list
List with the task functions.

getEventTasks(self, event_type, task_layer)

source code 

Get all tasks registered to handle the given AEEvent type in this AEScript only.

Called by AETier.getEventTasks during a search through all AEScripts in the owning AETier for the given task type.
Parameters:
  • event_type (AEEvent class) - Desired type of AEEvent.
  • task_layer (integer) - Layer on which the desired tasks are registered.
Returns: list of tuple ('task name', 'script name')
List of all tasks that handle the given event type on the given layer in this AEScript.

getChainSegment(self, link, target, class_name=None)

source code 
Gets a copy of the segment of the task chain for target specified by the link type. A copy is returned to avoid iteration errors if the list changes size during execution of the tasks in the chain.
Parameters:
  • link (integer) - One of the CHAIN constants in AEConstants.API .
  • target (string) - Name of the task to link to.
  • class_name (string) - name of the class the task is implemented in.
Returns: list of string
Task names chained in the given manner.

mergeChain(self, target, before, after, target_class_name=None)

source code 
Adds the before and after segments of the chain for the target specified. The parameters before and after are lists, possibly containing segments from other AEScripts. These lists are modified in place for performance. The around segment is returned since it is a single value.
Parameters:
  • target (string or tuple of string ('target name', 'script name')) - Name or key of the task to link to.
  • target_class_name (string) - Name of the script the task is implemented in
  • before (list with tuple of string [('task name', 'script name')]) - List with task keys, that are chained to be executed before the target
  • after (list with tuple of string [('task name', 'script name')]) - List with task keys, that are chained to be executed after the target
Returns: tuple of string ('task name', 'script name')
Task name for around link type, or None if nothing is linked around the target

chainTask(self, task_name, link, target, target_class_name=None)

source code 

Links a task to the one named in target. The task will be added either before, after, or around depending on the value of link. Does not allow a task to link to itself (i.e. name cannot equal target).

Invokes AETier.addChainRef to add a reference to this AEScript to the AETier which will later have to traverse the chain across AEScripts.

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:
  • task_name (string) - Name of the task to link.
  • link (integer) - One of the CHAIN constants in AEConstants.API.
  • target (string) - Name of the task to link to.
  • target_class_name (string) - Name of the script the target task is implemented in. If target_class_name is None the current script will be used.
Raises:
  • ValueError - When the link type is unknown.
  • AssertionError - When the name equals the target.

unchainTask(self, task_name, link, target, target_class_name=None)

source code 

Unlinks a task from the one named in target. The task will be unlinked either before, after, or around depending on the value of link. If link is None, the task will be unlinked from all cases if possible.

Invokes AETier.removeChainRef to delete a reference to this AEScript to the AETier which will later have to traverse the chain across AEScripts.

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:
  • task_name (string) - Name of the task to unlink.
  • link (integer) - One of the CHAIN constants in AEConstants.API.
  • target (string) - Name of the task to unlink from.
  • target_class_name (string) - Name of the script the target task is implemented in. If target_class_name is None the current script will be used.
Raises:
  • ValueError - When the named task is not unlinked at least once or the link type is unknown.
  • KeyError - When the target task does not have a chain segement in this AEScript for the given link type.

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

getTaskKeys(self)

source code 
Gets the keys to all tasks registered in this AEScript.
Returns: list of tuple ('task name', 'script name')
All keys.

unregisterModifiers(self, dev, modifiers)

source code 
Unregisters a list of input modifiers. Ignores the error cases when the device has no registered modifiers or one of the given modifiers is not registered.
Parameters:
  • dev (AEInput) - An AEInput device.
  • modifiers (integer) - A list of key codes used as modifiers.

registerModifiers(self, dev, modifiers)

source code 
Registers a list of input modifiers.
Parameters:
  • dev (AEInput) - An AEInput device.
  • modifiers (integer) - A list of key codes used as modifiers.

doTask(self, task_name_to_do, task_script_to_do=None, propagate=True, chain=True, **kwargs)

source code 

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

The chain parameter dictates whether only the registered_tasks 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 AEScript. It is used internally by a cyclic_input_tasks to handle the propagation flag in task chains.
Parameters:
  • task_name_to_do (string) - Name of the task to execute
  • task_script_to_do (string) - name of the script the task is implemented in
  • 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)?
  • 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

doCyclicInputTask(self, **kwargs)

source code 
Executes the next task which is connected to the cyclic_input_tasks.
Parameters:
  • 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.
Raises:
  • KeyError - When the cycle input task is not registered as such.
  • LookupError - When the task list for the cyclic input task is empty.

Note: KeyError inherits LookupError

getScriptSetting(self, setting_name)

source code 

Gets the AEScript AEState.Setting variable with the given name.

This method should be used when a script wants to access its own settings. If a script needs to access the settings of another script use the System.getScriptSetting method.
Parameters:
  • setting_name (immutable) - Name of the script
Returns: object
Setting object for given script.

getScriptSettingVal(self, setting_name)

source code 

Gets the value of the AEScript AEState.Setting state variable with the given name.

This method should be used when a script wants to access its own settings. If a script needs to access the settings of another script use the System.getScriptSettingVal method.
Parameters:
  • setting_name (immutable) - Name of the script.
Returns: object
Value contained in AEState attribute with given name.

setScriptSettingVal(self, setting_name, value)

source code 

Sets the value of the AEScript AEState.Setting state variable with the given name.

This method should be used when a script wants to set its own settings. If a script needs to set the settings of another script use the System.setScriptSettingVal method.
Parameters:
  • setting_name (immutable) - Name of the script.
  • value (object) - Value contained in AEState attribute with given name.
Raises:
  • KeyError - When the AEScript is not found

Class Variable Details [hide private]

STATE

Class to instantiate and use to store state information across all instances of this AEScript. Defaults to the AEState base class, but can be overridden with a subclass of AEState.
Type:
AEState class
Value:
ScriptState

Instance Variable Details [hide private]

after_chains

Mapping from target task name to a list of task names which should be executed after the target :
 Dictionary {
   key: ('task name', 'script name'),
   value: list of [('task name', 'script name')]
 }
Type:
dictionary

around_chains

Mapping from target task name to one task name which should be executed instead of the target :
 Dictionary {
   key: ('task name', 'script name'),
   value: ('task name', 'script name')
 }
Type:
dictionary

around_tasks

additional informations for an event task that is chained around another task :
 Dictionary {
   key: 'new task name',
   value: ['replaced task name', 'replaced task script', AEScript, 
           execute_function, update_function, ['functions_to_replace']]
 }
Type:
dictionary

before_chains

Mapping from target task name to a list of task names which should be executed before the target :
 Dictionary {
   key: ('task name', 'script name'),
   value: list of [('task name', 'script name')]
 }
Type:
dictionary

chooser_tasks

Connects a task to respond to a change in a AEChooser :
 Dictionary {
   key: id(AEChooser),
   value: ('task name', 'script name')
 }
Type:
dictionary

command_descriptions

Description of the task to be shown in command chooser :
 Dictionary {
   key: 'task name',
   value: string
 }
Type:
dictionary

commands

Connects a task to a AEInput.GestureList sequence on some AEInput device. The task name needs to be hashed into the registered_tasks dictionary to fully resolve the task. :
 WeakValueDictionary {
   key: AEInput.GestureList,
   value: ('task name', 'script name')
 }
Type:
weakref.WeakValueDictionary of (AEInput.GestureList : tuple)

cyclic_input_tasks

Connects more than one task to a AEInput.GestureList sequence on some AEInput device. When the action code of the AEInput.GestureList is activated once the first task will be executed. The second time the action code is activated the second task will be executed, and so on...:
 Dictionary {
   key: ('cycle name', 'script name'),
   value: [ ('task name', 'script name') ]
 }
Type:
dictionary

def_out

Default output device to use for all Output.say calls in a AEScript module :
 Dictionary {
   key: Script
   value: weakref.proxy to AEOutput
 }
Type:
dictionary

event_tasks

Notes which tasks are bind to which event type on which event layer :
 Dictionary {
   key: (AEEvent-Type-Class, layer),
   value: [ ('task name', 'script name') ]
 }
Type:
dictionary

out_caps

Capabilities set by setIdealOutput as ideal for output from this AEScript. These are used to "late bind" a device for use during execution of this AEScript and its tasks. Defaults to audio.
Type:
list of string

registered_tasks

All task wich are registered with the registerTask method in this AEScript. This dictionary connects the name of the task to the associated execute and update functions. Furthermore it notes to which cyclic input task this task belongs :
 Dictionary {
   key: ('task name', 'script name'),
   value: [execute_function, update_function, [ ('cycle name', 'script name') ]]
 }
Type:
dictionary

state

Settings for this AEScript. Defaults to an empty ScriptState object that can be used to store state information that is not configurable or persistable unless STATE is specified.
Type:
ScriptState