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

Class Node

source code

object --+
         |
        Node
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
 
doActionNamed(self, name)
Perform the action with the specified name.
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
 
point(self, mouseDelay=None)
Move mouse cursor to the center of the widget.
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
 
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, isLambda=False)
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, retry=True, debugName=None)
Finds a child satisying the given criteria.
source code
 
isChild(self, name='', roleName='', description='', label='', recursive=True, retry=False, debugName=None)
Determines whether a child satisying the given criteria exists.
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)
Blink, baby!
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  debugName
debug name assigned during search operations
  dead
Is the node dead (defunct) ?
  children
a list of this Accessible's children
  roleName
get_role_name(self)
  role
get_role(self)
  indexInParent
get_index_in_parent(self)
  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
'labeller' (read-only list of Node instances): The node(s) that is/are a label for this node.
  labelee
'labellee' (read-only list of Node instances): The node(s) that this node is a label for.
  labellee
'labellee' (read-only list of Node instances): The node(s) that this node is a label for.
  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?
  isChecked
Is the Accessible a checked checkbox? Compatibility property, same as Node.checked.
  isSelected
Is the Accessible selected? Compatibility property, same as Node.selected.
  selected
Is the Accessible selected?
  selectedChildren
Returns a list of children that are selected.
  value
The value contained by the AccessibleValue interface.
  minValue
The minimum value of self.value
  minValueIncrement
The minimum value increment of self.value
  maxValue
The maximum value of self.value

Inherited from object: __class__

Method Details [hide private]

doActionNamed(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, retry=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.

isChild(self, name='', roleName='', description='', label='', recursive=True, retry=False, debugName=None)

source code 

Determines whether a child satisying the given criteria exists.

This is implemented using findChild, but will not automatically retry if no such child is found. To make the function retry multiple times set retry to True. Returns a boolean value depending on whether the child was eventually found. Similar to 'child', yet it catches SearchError exception to provide for False results, will raise any other exceptions. 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:
unreachable.fget(self)
Set Method:
unreachable.fset(self, debugName)

dead

Is the node dead (defunct) ?

Get Method:
unreachable.dead(self) - Is the node dead (defunct) ?

children

a list of this Accessible's children

Get Method:
unreachable.children(self) - a list of this Accessible's children

roleName

get_role_name(self)

Get Method:
unreachable.get_role_name(self)

role

get_role(self)

Get Method:
unreachable.get_role(self)

indexInParent

get_index_in_parent(self)

Get Method:
unreachable.get_index_in_parent(self)

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:
unreachable.actions(self) - 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.

Get Method:
unreachable.fget(self)
Set Method:
unreachable.fset(self, value)

URI

Get Method:
unreachable.URI(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:
unreachable.fget(self)
Set Method:
unreachable.fset(self, text)

caretOffset

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

Get Method:
unreachable.fget(self) - For instances with an AccessibleText interface, the caret offset as an integer.
Set Method:
unreachable.fset(self, offset)

position

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

Get Method:
unreachable.position(self) - A tuple containing the position of the Accessible: (x, y)

size

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

Get Method:
unreachable.size(self) - 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)

Get Method:
unreachable.extents(self) - 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. Generated from 'relations'.

Get Method:
unreachable.labeler(self) - 'labeller' (read-only list of Node instances): The node(s) that is/are a label for this node.

labeller

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

Get Method:
unreachable.labeler(self) - 'labeller' (read-only list of Node instances): The node(s) that is/are a label for this node.

labelee

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

Get Method:
unreachable.labelee(self) - 'labellee' (read-only list of Node instances): The node(s) that this node is a label for.

labellee

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

Get Method:
unreachable.labelee(self) - 'labellee' (read-only list of Node instances): The node(s) that this node is a label for.

sensitive

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

Get Method:
unreachable.sensitive(self) - Is the Accessible sensitive (i.e.

showing

Get Method:
unreachable.showing(self)

focusable

Is the Accessible capable of having keyboard focus?

Get Method:
unreachable.focusable(self) - Is the Accessible capable of having keyboard focus?

focused

Does the Accessible have keyboard focus?

Get Method:
unreachable.focused(self) - Does the Accessible have keyboard focus?

checked

Is the Accessible a checked checkbox?

Get Method:
unreachable.checked(self) - Is the Accessible a checked checkbox?

isChecked

Is the Accessible a checked checkbox? Compatibility property, same as Node.checked.

Get Method:
unreachable.isChecked(self) - Is the Accessible a checked checkbox? Compatibility property, same as Node.checked.

isSelected

Is the Accessible selected? Compatibility property, same as Node.selected.

Get Method:
unreachable.isSelected(self) - Is the Accessible selected? Compatibility property, same as Node.selected.

selected

Is the Accessible selected?

Get Method:
unreachable.selected(self) - Is the Accessible selected?

selectedChildren

Returns a list of children that are selected.

Get Method:
unreachable.selectedChildren(self) - Returns a list of children that are selected.

value

The value contained by the AccessibleValue interface.

Get Method:
unreachable.fget(self)
Set Method:
unreachable.fset(self, value)

minValue

The minimum value of self.value

Get Method:
unreachable.minValue(self) - The minimum value of self.value

minValueIncrement

The minimum value increment of self.value

Get Method:
unreachable.minValueIncrement(self) - The minimum value increment of self.value

maxValue

The maximum value of self.value

Get Method:
unreachable.maxValue(self) - The maximum value of self.value