Defines the registrar functions responsible for managing an on-disk
repository of User Interface Elements (UIEs) that define the Perks, Devices, Choosers, and
Monitors available to the user and the system. Defines a helper class UIESet that is used
internally by the registrar to represent collections of UIEs that are to
be loaded when LSR starts, when any Tier starts, or when a particular Tier starts for a particular
user.
Functions to install, uninstall, associate, disassociate, and list
UIEs are primarily of interest to third-party UIE developers and expert
users. These methods allow extensions to be added to LSR and associated
with profiles so they are loaded automatically at startup or when Tiers are created. The AEMain script defines a
command line interface for accessing these methods. See the documentation
in that module or the LSR man page for details.
Functions to load UIEs are of interest to LSR developers. Given a UIE
name, the loadOne method will import the Python module containing
the named UIE and return an instance of the class in that module of the
same name (if the UIE module is properly installed). Given a UIE kind and
name along with the name of a , the loadAssociated method will import all Python modules
containing the UIEs to be loaded and return a list of UIE objects sorted
in the desired load order. Objects, not classes, are returned by this
method implying any initialization requiring data from an external source
must be done outside the constructor.
Author:
Peter Parente
Organization:
IBM Corporation
Copyright:
Copyright (c) 2005, 2007 IBM Corporation
License:
The BSD License
All rights reserved. This program and the accompanying materials
are made available under the terms of the BSD license which
accompanies this distribution, and is available at http://www.opensource.org/licenses/bsd-license.php
|
Metadata
|
|
|
Metadata
|
|
|
object
|
_getUIEInstance(name)
Gets an instance of the UIE class having the same name as the module
indicated by the given name. |
source code
|
|
|
module
|
|
|
|
install(real_path,
local=True,
overwrite=False)
Installs a new UIE module in either the local or global repository. |
source code
|
|
|
|
|
|
list of string
|
associate(name,
profiles=None,
tier=None,
all_tiers=False,
index=None)
Associates an installed UIE of the given name with a profile so that
it is loaded automatically by LSR. |
source code
|
|
|
list of string
|
disassociate(name,
profiles=None,
tier=None,
all_tiers=False)
Disassociates an installed UIE of the given name from a profile so
that it is no longer loaded automatically by LSR. |
source code
|
|
|
list of string
|
|
|
boolean
|
|
|
dictionary of string : list
|
|
|
list of string
|
|
|
list of string or 2-tuple
|
listAssociated(kind,
profile,
tier=None)
Gets a list of the names of all UIEs of the given kind associated
with the given profile. |
source code
|
|
|
string
|
getPath(name)
Gets the absolute path where an installed UIE is located on disk. |
source code
|
|
|
object
|
loadOne(name)
Gets the class representing the installed UIE of the given kind and
name. |
source code
|
|
|
list of object
|
loadAssociated(kind,
profile,
tier=None)
Gets all UIE classes in the given profile to be loaded at the given
time. |
source code
|
|
|
|
log = logging.getLogger('UIRegistrar')
|
|
string
|
LOCAL_PATH = os.path.join(HOME_USER, os.path.basename(sys.argv...
Location of the set of installed UIEs for this user
|
|
string
|
GLOBAL_PATH = os.path.join(HOME_DIR, 'global.installed')
Location of the set of installed UIEs for all users of the system
|
|
string
|
PERK = 'perk'
Kind of UIE responsible for registering Tasks that handle AEEvents and AEInput.Gestures
|
|
string
|
DEVICE = 'device'
Kind of UIE responsible for managing a method of input (e.g
keyboard), managing a method of output (e.g speech), or both (e.g.
|
|
string
|
CHOOSER = 'chooser'
Kind of UIE responsible for interacting with the user via more than
the usual LSR key combos (e.g.
|
|
string
|
MONITOR = 'monitor'
Kind of UIE responsible for creating a human-readable representation
(e.g.
|
|
list
|
ALL_KINDS = [DEVICE, CHOOSER, MONITOR, PERK]
List of all known kinds of UIEs
|
|
list
|
STARTUP_KINDS = [DEVICE, MONITOR]
Subset of ALL_KINDS that should be loaded at startup
|
|
|
InstallCache = InstallCache()
|