Package dogtail :: Module tree :: Class Node
[hide private]
[frames] | no frames]

Class Node

source code

Known Subclasses:

A node in the tree of UI elements. This class is mixed in with Accessibility.Accessible to both make it easier to use and to add additional functionality. It also has a debugName which is set up automatically when doing searches.

Instance Methods [hide private]
 
__setupUserData(self) source code
 
_getDebugName(self) source code
 
_setDebugName(self, debugName) source code
 
_getDead(self) source code
 
_getChildren(self) source code
 
doAction(self, name)
Perform the action with the specified name.
source code
 
_getActions(self) source code
 
_getComboValue(self) source code
 
_setComboValue(self, value) source code
 
_getURI(self) source code
 
_getText(self) source code
 
_setText(self, text) source code
 
_getCaretOffset(self) source code
 
_setCaretOffset(self, offset) source code
 
_getPosition(self) source code
 
_getSize(self) source code
 
_getExtents(self) source code
 
contains(self, x, y) source code
 
getChildAtPoint(self, x, y) source code
 
grabFocus(self)
Attempts to set the keyboard focus to this Accessible.
source code
 
click(self, button=1)
Generates a raw mouse click event, using the specified button.
source code
 
doubleClick(self, button=1)
Generates a raw mouse double-click event, using the specified button.
source code
 
_labeler(self) source code
 
_labelee(self) source code
 
_isSensitive(self) source code
 
_isShowing(self) source code
 
_isFocusable(self) source code
 
_isFocused(self) source code
 
_isChecked(self) source code
 
selectAll(self)
Selects all children.
source code
 
deselectAll(self)
Deselects all selected children.
source code
 
select(self)
Selects the Accessible.
source code
 
deselect(self)
Deselects the Accessible.
source code
 
_getSelected(self) source code
 
_getSelectedChildren(self) source code
 
_getValue(self) source code
 
_setValue(self, value) source code
 
_getMinValue(self) source code
 
_getMinValueIncrement(self) source code
 
_getMaxValue(self) source code
 
typeText(self, string)
Type the given text into the node, with appropriate delays and logging.
source code
 
keyCombo(self, comboString) source code
 
getLogString(self)
Get a string describing this node for the logs, respecting the config.absoluteNodePaths boolean.
source code
 
satisfies(self, pred)
Does this node satisfy the given predicate?
source code
 
dump(self, type='plain', fileName=None) source code
 
getAbsoluteSearchPath(self)
FIXME: this needs rewriting...
source code
 
getRelativeSearch(self)
Get a (ancestorNode, predicate, isRecursive) triple that identifies the best way to find this Node uniquely.
source code
 
__nodeIsIdentifiable(self, ancestor) source code
 
_fastFindChild(self, pred, recursive=True)
Searches for an Accessible using methods from pyatspi.utils
source code
 
findChild(self, pred, recursive=True, debugName=None, retry=True, requireResult=True)
Search for a node satisyfing the predicate, returning a Node.
source code
 
findChildren(self, pred, recursive=True)
Find all children/descendents satisfying the predicate.
source code
 
findAncestor(self, pred)
Search up the ancestry of this node, returning the first Node satisfying the predicate, or None.
source code
 
child(self, name='', roleName='', description='', label='', recursive=True, debugName=None)
Finds a child satisying the given criteria.
source code
 
menu(self, menuName, recursive=True)
Search below this node for a menu with the given name.
source code
 
menuItem(self, menuItemName, recursive=True)
Search below this node for a menu item with the given name.
source code
 
textentry(self, textEntryName, recursive=True)
Search below this node for a text entry with the given name.
source code
 
button(self, buttonName, recursive=True)
Search below this node for a button with the given name.
source code
 
childLabelled(self, labelText, recursive=True)
Search below this node for a child labelled with the given text.
source code
 
childNamed(self, childName, recursive=True)
Search below this node for a child with the given name.
source code
 
tab(self, tabName, recursive=True)
Search below this node for a tab with the given name.
source code
 
getUserVisibleStrings(self)
Get all user-visible strings in this node and its descendents.
source code
 
blink(self, count=2)
Blink, baby!
source code
Properties [hide private]
  debugName
debug name assigned during search operations
  dead
Is the node dead (defunct) ?
  children
a list of this Accessible's children
string roleName
Gets the unlocalized role name of the accessible from the cache if it is available, otherwise, fetches it remotely.
Accessibility.Role role
Gets the role of the accessible from the cache if it is available, otherwise, fetches it remotely.
integer indexInParent
Gets the index of this accessible in its parent.
  actions
A dictionary of supported action names as keys, with Action objects as values.
  combovalue
The value (as a string) currently selected in the combo box.
  URI
  text
For instances with an AccessibleText interface, the text as a string.
  caretOffset
For instances with an AccessibleText interface, the caret offset as an integer.
  position
A tuple containing the position of the Accessible: (x, y)
  size
A tuple containing the size of the Accessible: (w, h)
  extents
A tuple containing the location and size of the Accessible: (x, y, w, h)
  labeler
'labeller' (read-only list of Node instances): The node(s) that is/are a label for this node.
  labeller
See labeler
  labelee
'labellee' (read-only list of Node instances): The node(s) that this node is a label for.
  labellee
See labelee
  sensitive
Is the Accessible sensitive (i.e.
  showing
  focusable
Is the Accessible capable of having keyboard focus?
  focused
Does the Accessible have keyboard focus?
  checked
Is the Accessible a checked checkbox?
  isSelected
Is the Accessible selected?
  selectedChildren
Returns a list of children that are selected.
  value
  minValue
  minValueIncrement
  maxValue
Method Details [hide private]

doAction(self, name)

source code 

Perform the action with the specified name. For a list of actions supported by this instance, check the 'actions' property.

click(self, button=1)

source code 

Generates a raw mouse click event, using the specified button.

  • 1 is left,
  • 2 is middle,
  • 3 is right.

getAbsoluteSearchPath(self)

source code 

FIXME: this needs rewriting... Generate a SearchPath instance giving the 'best' way to find the Accessible wrapped by this node again, starting at the root and applying each search in turn.

This is somewhat analagous to an absolute path in a filesystem, except that some of searches may be recursive, rather than just searching direct children.

Used by the recording framework for identifying nodes in a persistent way, independent of the style of script being written.

FIXME: try to ensure uniqueness FIXME: need some heuristics to get 'good' searches, whatever that means

getRelativeSearch(self)

source code 

Get a (ancestorNode, predicate, isRecursive) triple that identifies the best way to find this Node uniquely. FIXME: or None if no such search exists? FIXME: may need to make this more robust FIXME: should this be private?

findChild(self, pred, recursive=True, debugName=None, retry=True, requireResult=True)

source code 

Search for a node satisyfing the predicate, returning a Node.

If retry is True (the default), it makes multiple attempts, backing off and retrying on failure, and eventually raises a descriptive exception if the search fails.

If retry is False, it gives up after one attempt.

If requireResult is True (the default), an exception is raised after all attempts have failed. If it is false, the function simply returns None.

child(self, name='', roleName='', description='', label='', recursive=True, debugName=None)

source code 

Finds a child satisying the given criteria.

This is implemented using findChild, and hence will automatically retry if no such child is found, and will eventually raise an exception. It also logs the search.

menu(self, menuName, recursive=True)

source code 

Search below this node for a menu with the given name.

This is implemented using findChild, and hence will automatically retry if no such child is found, and will eventually raise an exception. It also logs the search.

menuItem(self, menuItemName, recursive=True)

source code 

Search below this node for a menu item with the given name.

This is implemented using findChild, and hence will automatically retry if no such child is found, and will eventually raise an exception. It also logs the search.

textentry(self, textEntryName, recursive=True)

source code 

Search below this node for a text entry with the given name.

This is implemented using findChild, and hence will automatically retry if no such child is found, and will eventually raise an exception. It also logs the search.

button(self, buttonName, recursive=True)

source code 

Search below this node for a button with the given name.

This is implemented using findChild, and hence will automatically retry if no such child is found, and will eventually raise an exception. It also logs the search.

childLabelled(self, labelText, recursive=True)

source code 

Search below this node for a child labelled with the given text.

This is implemented using findChild, and hence will automatically retry if no such child is found, and will eventually raise an exception. It also logs the search.

childNamed(self, childName, recursive=True)

source code 

Search below this node for a child with the given name.

This is implemented using findChild, and hence will automatically retry if no such child is found, and will eventually raise an exception. It also logs the search.

tab(self, tabName, recursive=True)

source code 

Search below this node for a tab with the given name.

This is implemented using findChild, and hence will automatically retry if no such child is found, and will eventually raise an exception. It also logs the search.

getUserVisibleStrings(self)

source code 

Get all user-visible strings in this node and its descendents.

(Could be implemented as an attribute)


Property Details [hide private]

debugName

debug name assigned during search operations

Get Method:
_getDebugName(self)
Set Method:
_setDebugName(self, debugName)

dead

Is the node dead (defunct) ?

Get Method:
_getDead(self)

children

a list of this Accessible's children

Get Method:
_getChildren(self)

roleName

Gets the unlocalized role name of the accessible from the cache if it is available, otherwise, fetches it remotely.

Get Method:
unreachable.getRoleName(self) - Gets the unlocalized role name of the accessible from the cache if it is available, otherwise, fetches it remotely.
Type:
string

role

Gets the role of the accessible from the cache if it is available, otherwise, fetches it remotely.

Get Method:
unreachable.getRole(self) - Gets the role of the accessible from the cache if it is available, otherwise, fetches it remotely.
Type:
Accessibility.Role

indexInParent

Gets the index of this accessible in its parent. Uses the implementation of this method provided by the Accessibility.Accessible object, but checks the bound of the value to ensure it is not outside the range of childCount reported by this accessible's parent.

Get Method:
unreachable.getIndexInParent(self) - Gets the index of this accessible in its parent.
Type:
integer

actions

A dictionary of supported action names as keys, with Action objects as values. Common action names include:

'click' 'press' 'release' 'activate' 'jump' 'check' 'dock' 'undock' 'open' 'menu'

Get Method:
_getActions(self)

combovalue

The value (as a string) currently selected in the combo box.

Get Method:
_getComboValue(self)
Set Method:
_setComboValue(self, value)

URI

Get Method:
_getURI(self)

text

For instances with an AccessibleText interface, the text as a string. This is read-only, unless the instance also has an AccessibleEditableText interface. In this case, you can write values to the attribute. This will get logged in the debug log, and a delay will be added.

If this instance corresponds to a password entry, use the passwordText property instead.

Get Method:
_getText(self)
Set Method:
_setText(self, text)

caretOffset

For instances with an AccessibleText interface, the caret offset as an integer.

Get Method:
_getCaretOffset(self)
Set Method:
_setCaretOffset(self, offset)

position

A tuple containing the position of the Accessible: (x, y)

Get Method:
_getPosition(self)

size

A tuple containing the size of the Accessible: (w, h)

Get Method:
_getSize(self)

extents

A tuple containing the location and size of the Accessible: (x, y, w, h)

Get Method:
_getExtents(self)

labeler

'labeller' (read-only list of Node instances): The node(s) that is/are a label for this node. Generated from 'relations'.

Get Method:
_labeler(self)

labeller

See labeler

Get Method:
_labeler(self)

labelee

'labellee' (read-only list of Node instances): The node(s) that this node is a label for. Generated from 'relations'.

Get Method:
_labelee(self)

labellee

See labelee

Get Method:
_labelee(self)

sensitive

Is the Accessible sensitive (i.e. not greyed out)?

Get Method:
_isSensitive(self)

showing

Get Method:
_isShowing(self)

focusable

Is the Accessible capable of having keyboard focus?

Get Method:
_isFocusable(self)

focused

Does the Accessible have keyboard focus?

Get Method:
_isFocused(self)

checked

Is the Accessible a checked checkbox?

Get Method:
_isChecked(self)

isSelected

Is the Accessible selected?

Get Method:
_getSelected(self)

selectedChildren

Returns a list of children that are selected.

Get Method:
_getSelectedChildren(self)

value

Get Method:
_getValue(self)
Set Method:
_setValue(self, value)

minValue

Get Method:
_getMinValue(self)

minValueIncrement

Get Method:
_getMinValueIncrement(self)

maxValue

Get Method:
_getMaxValue(self)