spacepaste
new
all pastes
Help on module dogtail.tree in dogtail: NAME dogtail.tree - Makes some sense of the AT-SPI API FILE /usr/lib/pymodules/python2.5/dogtail/tree.py DESCRIPTION The tree API handles various things for you: - fixes most timing issues - can automatically generate (hopefully) highly-readable logs of what the script is doing - traps various UI malfunctions, raising exceptions for them (again, hopefully improving the logs) The most important class is Node. Each Node is an element of the desktop UI. There is a tree of nodes, starting at 'root', with applications as its children, with the top-level windows and dialogs as their children. The various widgets that make up the UI appear as descendents in this tree. All of these elements (root, the applications, the windows, and the widgets) are represented as instances of Node in a tree (provided that the program of interest is correctly exporting its user-interface to the accessibility system). The Node class is a wrapper around Accessible and the various Accessible interfaces. The Action class represents an action that the accessibility layer exports as performable on a specific node, such as clicking on it. It's a wrapper around AccessibleAction. We often want to look for a node, based on some criteria, and this is provided by the Predicate class. Dogtail implements a high-level searching system, for finding a node (or nodes) satisfying whatever criteria you are interested in. It does this with a 'backoff and retry' algorithm. This fixes most timing problems e.g. when a dialog is in the process of opening but hasn't yet done so. If a search fails, it waits 'config.searchBackoffDuration' seconds, and then tries again, repeatedly. After several failed attempts (determined by config.searchWarningThreshold) it will start sending warnings about the search to the debug log. If it still can't succeed after 'config.searchCutoffCount' attempts, it raises an exception containing details of the search. You can see all of this process in the debug log by setting 'config.debugSearching' to True We also automatically add a short delay after each action ('config.defaultDelay' gives the time in seconds). We'd hoped that the search backoff and retry code would eliminate the need for this, but unfortunately we still run into timing issues. For example, Evolution (and probably most other apps) set things up on new dialogs and wizard pages as they appear, and we can run into 'setting wars' where the app resets the widgetry to defaults after our script has already filled out the desired values, and so we lose our values. So we give the app time to set the widgetry up before the rest of the script runs. The classes trap various UI malfunctions and raise exceptions that better describe what went wrong. For example, they detects attempts to click on an insensitive UI element and raise a specific exception for this. Unfortunately, some applications do not set up the 'sensitive' state correctly on their buttons (e.g. Epiphany on form buttons in a web page). The current workaround for this is to set config.ensureSensitivity=False, which disables the sensitivity testing. Authors: Zack Cerza <zcerza@redhat.com>, David Malcolm <dmalcolm@redhat.com> CLASSES Action Node Application Link Root Window Wizard exceptions.Exception(exceptions.BaseException) ActionNotSupported NotSensitiveError SearchError exceptions.TypeError(exceptions.StandardError) ReadOnlyError class Action | Class representing an action that can be performed on a specific node | | Methods defined here: | | __getattr__(self, attr) | | __init__(self, node, action, index) | | __str__(self) | Plain-text representation of the Action. | | do(self) | Performs the given tree.Action, with appropriate delays and logging. | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | types = ('click', 'press', 'release', 'activate', 'jump', 'check', 'do... class ActionNotSupported(exceptions.Exception) | The widget does not support the requested action. | | Method resolution order: | ActionNotSupported | exceptions.Exception | exceptions.BaseException | __builtin__.object | | Methods defined here: | | __init__(self, actionName, node) | | __str__(self) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | message = "Cannot do '%s' action on %s" | | ---------------------------------------------------------------------- | Data and other attributes inherited from exceptions.Exception: | | __new__ = <built-in method __new__ of type object at 0x726020> | T.__new__(S, ...) -> a new object with type S, a subtype of T | | ---------------------------------------------------------------------- | Methods inherited from exceptions.BaseException: | | __delattr__(...) | x.__delattr__('name') <==> del x.name | | __getattribute__(...) | x.__getattribute__('name') <==> x.name | | __getitem__(...) | x.__getitem__(y) <==> x[y] | | __getslice__(...) | x.__getslice__(i, j) <==> x[i:j] | | Use of negative indices is not supported. | | __reduce__(...) | | __repr__(...) | x.__repr__() <==> repr(x) | | __setattr__(...) | x.__setattr__('name', value) <==> x.name = value | | __setstate__(...) | | ---------------------------------------------------------------------- | Data descriptors inherited from exceptions.BaseException: | | __dict__ | | args class Application(Node) | Methods defined here: | | dialog(self, dialogName, recursive=False) | Search below this node for a dialog with the given name, | returning a Window instance. | | 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. | | FIXME: should this method activate the dialog? | | getWnckApplication(self) | Get the wnck.Application instance for this application, or None | | Currently implemented via a hack: requires the app to have a | window, and looks up the application of that window | | wnck.Application can give you the pid, the icon, etc | | FIXME: untested | | window(self, windowName, recursive=False) | Search below this node for a window with the given name, | returning a Window instance. | | 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. | | FIXME: this bit isn't true: | The window will be automatically activated (raised and focused | by the window manager) if wnck bindings are available. | | ---------------------------------------------------------------------- | Methods inherited from Node: | | __getattr__(self, attr) | | __init__(self, initializer) | | __setattr__(self, attr, value) | | __str__(self) | If debugName is set on this Node, returns debugName surrounded | in curly braces. | Otherwise, returns a plain-text representation of the most | important attributes of the underlying Accessible. | | blink(self, count=2) | Blink, baby! | | button(self, buttonName, recursive=True) | 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. | | child(self, name='', roleName='', description='', label='', recursive=True, debugName=None) | 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. | | childLabelled(self, labelText, recursive=True) | 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) | 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. | | click(self) | If the Node supports an action called "click", do it, with appropriate delays and logging. | Otherwise, raise an ActionNotSupported exception. | | Note that this is just a shortcut to doAction('click'), as it is by far the most-used | action. To do any other action such as 'activate' or 'open', you must use doAction(). | | dump(self, type='plain') | | findAncestor(self, pred) | Search up the ancestry of this node, returning the first Node | satisfying the predicate, or None. | | findChild(self, pred, recursive=True, debugName=None, retry=True, requireResult=True) | 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. | | FIXME: make multiple attempts? | | findChildren(self, pred, recursive=True) | Find all children/descendents satisfying the predicate. | | getAbsoluteSearchPath(self) | 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 | | getLogString(self) | Get a string describing this node for the logs, | respecting the config.absoluteNodePaths boolean. | | getRelativeSearch(self) | 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? | | getUserVisibleStrings(self) | Get all user-visible strings in this node and its descendents. | | (Could be implemented as an attribute) | | keyCombo(self, comboString) | | menu(self, menuName, recursive=True) | 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) | 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. | | satisfies(self, pred) | Does this node satisfy the given predicate? | | tab(self, tabName, recursive=True) | 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. | | textentry(self, textEntryName, recursive=True) | 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. | | typeText(self, string) | Type the given text into the node, with appropriate delays and | logging. | | ---------------------------------------------------------------------- | Data and other attributes inherited from Node: | | contained = ('__accessible', '__action', '__component', '__text', '__e... class Link(Node) | Class representing a hyperlink | | Methods defined here: | | __getattr__(self, name) | | __init__(self, node, hyperlink, index) | | __setattr__(self, name, value) | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | contained = ('__hyperlink', '__node') | | ---------------------------------------------------------------------- | Methods inherited from Node: | | __str__(self) | If debugName is set on this Node, returns debugName surrounded | in curly braces. | Otherwise, returns a plain-text representation of the most | important attributes of the underlying Accessible. | | blink(self, count=2) | Blink, baby! | | button(self, buttonName, recursive=True) | 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. | | child(self, name='', roleName='', description='', label='', recursive=True, debugName=None) | 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. | | childLabelled(self, labelText, recursive=True) | 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) | 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. | | click(self) | If the Node supports an action called "click", do it, with appropriate delays and logging. | Otherwise, raise an ActionNotSupported exception. | | Note that this is just a shortcut to doAction('click'), as it is by far the most-used | action. To do any other action such as 'activate' or 'open', you must use doAction(). | | dump(self, type='plain') | | findAncestor(self, pred) | Search up the ancestry of this node, returning the first Node | satisfying the predicate, or None. | | findChild(self, pred, recursive=True, debugName=None, retry=True, requireResult=True) | 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. | | FIXME: make multiple attempts? | | findChildren(self, pred, recursive=True) | Find all children/descendents satisfying the predicate. | | getAbsoluteSearchPath(self) | 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 | | getLogString(self) | Get a string describing this node for the logs, | respecting the config.absoluteNodePaths boolean. | | getRelativeSearch(self) | 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? | | getUserVisibleStrings(self) | Get all user-visible strings in this node and its descendents. | | (Could be implemented as an attribute) | | keyCombo(self, comboString) | | menu(self, menuName, recursive=True) | 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) | 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. | | satisfies(self, pred) | Does this node satisfy the given predicate? | | tab(self, tabName, recursive=True) | 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. | | textentry(self, textEntryName, recursive=True) | 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. | | typeText(self, string) | Type the given text into the node, with appropriate delays and | logging. class Node | A node in the tree of UI elements. It wraps an Accessible and | exposes its useful members. It also has a debugName which is set | up automatically when doing searches. | | Node instances have various attributes synthesized, to make it easy to | get and the underlying accessible data. Many more attributes can be | added as desired. | | 'name' (read-only string): | Wraps Accessible_getName on the Node's underlying Accessible | | 'roleName' (read-only string): | Wraps Accessible_getRoleName on the Node's underlying Accessible | | 'role' (read-only atspi role enum): | Wraps Accessible_getRole on the Node's underlying Accessible | | 'description' (read-only string): | Wraps Accessible_getDescription on the Node's underlying Accessible | | 'parent' (read-only Node instance): | A Node instance wrapping the parent, or None. Wraps Accessible_getParent | | 'children' (read-only list of Node instances): | The children of this node, wrapping getChildCount and getChildAtIndex | | 'text' (string): | For instances wrapping AccessibleText, the text. This is read-only, | unless the instance wraps an AccessibleEditableText. In this case, you | can write values to the attribute. This will get logged in the debug | log, and a delay will be added. After the delay, the content of the | node will be checked to ensure that it has the expected value. If it | does not, an exception will be raised. This does not work for password | dialogs (since all we get back are * characters). In this case, set | the passwordText attribute instead. | | 'passwordText' (write-only string): | See documentation of 'text' attribute above. | | 'caretOffset' (read/write int): | For instances wrapping AccessibleText, the location of the text caret, | expressed as an offset in characters. | | 'combovalue' (write-only string): | For comboboxes. Write to this attribute to set the combobox to the | given value, with appropriate delays and logging. | | 'stateSet' (read-only StateSet instance): | Wraps Accessible_getStateSet; a set of boolean state flags | | 'relations' (read-only list of atspi.Relation instances): | Wraps Accessible_getRelationSet | | 'labellee' (read-only list of Node instances): | The node(s) that this node is a label for. Generated from 'relations'. | | 'labeller' (read-only list of Node instances): | The node(s) that is/are a label for this node. Generated from | 'relations'. | | 'checked' (read-only boolean): | Is this node checked? Only valid for checkboxes. Generated from stateSet | based on presence of atspi.SPI_STATE_CHECKED. | | 'sensitive' (read-only boolean): | Is this node sensitive (i.e. not greyed out). Generated from stateSet | based on presence of atspi.SPI_STATE_SENSITIVE | Not all applications/toolkits seem to properly set this up. | | 'showing' (read-only boolean): | Generated from stateSet based on presence of atspi.SPI_STATE_SHOWING | | 'focusable' (read-only boolean): | Generated from stateSet based on presence of atspi.SPI_STATE_FOCUSABLE | | 'focused' (read-only boolean): | Generated from stateSet based on presence of atspi.SPI_STATE_FOCUSED | | 'actions' (read-only list of Action instances): | Generated from Accessible_getAction and AccessibleAction_getNActions | | For each action that is supported by a node, a method is hooked up, | this can include the following list: | 'click' | 'press' | 'release' | 'activate' | 'jump' | 'check' | 'dock' | 'undock' | 'open' | 'menu' | | 'extents' (readonly tuple): | For instances wrapping a Component, the (x,y,w,h) screen extents of the | component. | | 'position' (readonly tuple): | For instances wrapping a Component, the (x,y) screen position of the | component. | | 'size' (readonly tuple): | For instances wrapping a Component, the (w,h) screen size of the component. | | 'grabFocus': | For instances wrapping a Component, attempt to set the keyboard input focus | to that Node. | | 'toolkit' (readonly string): | For instances wrapping an application, the name of the toolkit. | | 'version' | For instances wrapping an application. | | 'ID' | For instances wrapping an application. | | 'pause' (function) | 'resume' (function) | For instances wrapping an application; probably don't work | | Methods defined here: | | __getattr__(self, attr) | | __init__(self, initializer) | | __setattr__(self, attr, value) | | __str__(self) | If debugName is set on this Node, returns debugName surrounded | in curly braces. | Otherwise, returns a plain-text representation of the most | important attributes of the underlying Accessible. | | blink(self, count=2) | Blink, baby! | | button(self, buttonName, recursive=True) | 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. | | child(self, name='', roleName='', description='', label='', recursive=True, debugName=None) | 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. | | childLabelled(self, labelText, recursive=True) | 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) | 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. | | click(self) | If the Node supports an action called "click", do it, with appropriate delays and logging. | Otherwise, raise an ActionNotSupported exception. | | Note that this is just a shortcut to doAction('click'), as it is by far the most-used | action. To do any other action such as 'activate' or 'open', you must use doAction(). | | dump(self, type='plain') | | findAncestor(self, pred) | Search up the ancestry of this node, returning the first Node | satisfying the predicate, or None. | | findChild(self, pred, recursive=True, debugName=None, retry=True, requireResult=True) | 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. | | FIXME: make multiple attempts? | | findChildren(self, pred, recursive=True) | Find all children/descendents satisfying the predicate. | | getAbsoluteSearchPath(self) | 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 | | getLogString(self) | Get a string describing this node for the logs, | respecting the config.absoluteNodePaths boolean. | | getRelativeSearch(self) | 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? | | getUserVisibleStrings(self) | Get all user-visible strings in this node and its descendents. | | (Could be implemented as an attribute) | | keyCombo(self, comboString) | | menu(self, menuName, recursive=True) | 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) | 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. | | satisfies(self, pred) | Does this node satisfy the given predicate? | | tab(self, tabName, recursive=True) | 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. | | textentry(self, textEntryName, recursive=True) | 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. | | typeText(self, string) | Type the given text into the node, with appropriate delays and | logging. | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | contained = ('__accessible', '__action', '__component', '__text', '__e... class NotSensitiveError(exceptions.Exception) | The widget is not sensitive. | | Method resolution order: | NotSensitiveError | exceptions.Exception | exceptions.BaseException | __builtin__.object | | Methods defined here: | | __init__(self, action) | | __str__(self) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | message = 'Cannot %s %s. It is not sensitive.' | | ---------------------------------------------------------------------- | Data and other attributes inherited from exceptions.Exception: | | __new__ = <built-in method __new__ of type object at 0x726020> | T.__new__(S, ...) -> a new object with type S, a subtype of T | | ---------------------------------------------------------------------- | Methods inherited from exceptions.BaseException: | | __delattr__(...) | x.__delattr__('name') <==> del x.name | | __getattribute__(...) | x.__getattribute__('name') <==> x.name | | __getitem__(...) | x.__getitem__(y) <==> x[y] | | __getslice__(...) | x.__getslice__(i, j) <==> x[i:j] | | Use of negative indices is not supported. | | __reduce__(...) | | __repr__(...) | x.__repr__() <==> repr(x) | | __setattr__(...) | x.__setattr__('name', value) <==> x.name = value | | __setstate__(...) | | ---------------------------------------------------------------------- | Data descriptors inherited from exceptions.BaseException: | | __dict__ | | args class ReadOnlyError(exceptions.TypeError) | This attribute is not writeable. | | Method resolution order: | ReadOnlyError | exceptions.TypeError | exceptions.StandardError | exceptions.Exception | exceptions.BaseException | __builtin__.object | | Methods defined here: | | __init__(self, attr) | | __str__(self) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | message = 'Cannot set %s. It is read-only.' | | ---------------------------------------------------------------------- | Data and other attributes inherited from exceptions.TypeError: | | __new__ = <built-in method __new__ of type object at 0x726320> | T.__new__(S, ...) -> a new object with type S, a subtype of T | | ---------------------------------------------------------------------- | Methods inherited from exceptions.BaseException: | | __delattr__(...) | x.__delattr__('name') <==> del x.name | | __getattribute__(...) | x.__getattribute__('name') <==> x.name | | __getitem__(...) | x.__getitem__(y) <==> x[y] | | __getslice__(...) | x.__getslice__(i, j) <==> x[i:j] | | Use of negative indices is not supported. | | __reduce__(...) | | __repr__(...) | x.__repr__() <==> repr(x) | | __setattr__(...) | x.__setattr__('name', value) <==> x.name = value | | __setstate__(...) | | ---------------------------------------------------------------------- | Data descriptors inherited from exceptions.BaseException: | | __dict__ | | args class Root(Node) | FIXME: | | Methods defined here: | | application(self, appName) | Gets an application by name, returning an Application instance | or raising an exception. | | 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. | | applications(self) | Get all applications. | | ---------------------------------------------------------------------- | Methods inherited from Node: | | __getattr__(self, attr) | | __init__(self, initializer) | | __setattr__(self, attr, value) | | __str__(self) | If debugName is set on this Node, returns debugName surrounded | in curly braces. | Otherwise, returns a plain-text representation of the most | important attributes of the underlying Accessible. | | blink(self, count=2) | Blink, baby! | | button(self, buttonName, recursive=True) | 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. | | child(self, name='', roleName='', description='', label='', recursive=True, debugName=None) | 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. | | childLabelled(self, labelText, recursive=True) | 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) | 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. | | click(self) | If the Node supports an action called "click", do it, with appropriate delays and logging. | Otherwise, raise an ActionNotSupported exception. | | Note that this is just a shortcut to doAction('click'), as it is by far the most-used | action. To do any other action such as 'activate' or 'open', you must use doAction(). | | dump(self, type='plain') | | findAncestor(self, pred) | Search up the ancestry of this node, returning the first Node | satisfying the predicate, or None. | | findChild(self, pred, recursive=True, debugName=None, retry=True, requireResult=True) | 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. | | FIXME: make multiple attempts? | | findChildren(self, pred, recursive=True) | Find all children/descendents satisfying the predicate. | | getAbsoluteSearchPath(self) | 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 | | getLogString(self) | Get a string describing this node for the logs, | respecting the config.absoluteNodePaths boolean. | | getRelativeSearch(self) | 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? | | getUserVisibleStrings(self) | Get all user-visible strings in this node and its descendents. | | (Could be implemented as an attribute) | | keyCombo(self, comboString) | | menu(self, menuName, recursive=True) | 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) | 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. | | satisfies(self, pred) | Does this node satisfy the given predicate? | | tab(self, tabName, recursive=True) | 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. | | textentry(self, textEntryName, recursive=True) | 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. | | typeText(self, string) | Type the given text into the node, with appropriate delays and | logging. | | ---------------------------------------------------------------------- | Data and other attributes inherited from Node: | | contained = ('__accessible', '__action', '__component', '__text', '__e... class SearchError(exceptions.Exception) | Method resolution order: | SearchError | exceptions.Exception | exceptions.BaseException | __builtin__.object | | Data descriptors defined here: | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Methods inherited from exceptions.Exception: | | __init__(...) | x.__init__(...) initializes x; see x.__class__.__doc__ for signature | | ---------------------------------------------------------------------- | Data and other attributes inherited from exceptions.Exception: | | __new__ = <built-in method __new__ of type object at 0x726020> | T.__new__(S, ...) -> a new object with type S, a subtype of T | | ---------------------------------------------------------------------- | Methods inherited from exceptions.BaseException: | | __delattr__(...) | x.__delattr__('name') <==> del x.name | | __getattribute__(...) | x.__getattribute__('name') <==> x.name | | __getitem__(...) | x.__getitem__(y) <==> x[y] | | __getslice__(...) | x.__getslice__(i, j) <==> x[i:j] | | Use of negative indices is not supported. | | __reduce__(...) | | __repr__(...) | x.__repr__() <==> repr(x) | | __setattr__(...) | x.__setattr__('name', value) <==> x.name = value | | __setstate__(...) | | __str__(...) | x.__str__() <==> str(x) | | ---------------------------------------------------------------------- | Data descriptors inherited from exceptions.BaseException: | | __dict__ | | args | | message | exception message class Window(Node) | Methods defined here: | | activate(self) | Activates the wnck.Window associated with this Window. | | FIXME: doesn't yet work | | getWnckWindow(self) | Get the wnck.Window instance for this window, or None | | ---------------------------------------------------------------------- | Methods inherited from Node: | | __getattr__(self, attr) | | __init__(self, initializer) | | __setattr__(self, attr, value) | | __str__(self) | If debugName is set on this Node, returns debugName surrounded | in curly braces. | Otherwise, returns a plain-text representation of the most | important attributes of the underlying Accessible. | | blink(self, count=2) | Blink, baby! | | button(self, buttonName, recursive=True) | 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. | | child(self, name='', roleName='', description='', label='', recursive=True, debugName=None) | 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. | | childLabelled(self, labelText, recursive=True) | 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) | 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. | | click(self) | If the Node supports an action called "click", do it, with appropriate delays and logging. | Otherwise, raise an ActionNotSupported exception. | | Note that this is just a shortcut to doAction('click'), as it is by far the most-used | action. To do any other action such as 'activate' or 'open', you must use doAction(). | | dump(self, type='plain') | | findAncestor(self, pred) | Search up the ancestry of this node, returning the first Node | satisfying the predicate, or None. | | findChild(self, pred, recursive=True, debugName=None, retry=True, requireResult=True) | 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. | | FIXME: make multiple attempts? | | findChildren(self, pred, recursive=True) | Find all children/descendents satisfying the predicate. | | getAbsoluteSearchPath(self) | 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 | | getLogString(self) | Get a string describing this node for the logs, | respecting the config.absoluteNodePaths boolean. | | getRelativeSearch(self) | 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? | | getUserVisibleStrings(self) | Get all user-visible strings in this node and its descendents. | | (Could be implemented as an attribute) | | keyCombo(self, comboString) | | menu(self, menuName, recursive=True) | 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) | 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. | | satisfies(self, pred) | Does this node satisfy the given predicate? | | tab(self, tabName, recursive=True) | 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. | | textentry(self, textEntryName, recursive=True) | 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. | | typeText(self, string) | Type the given text into the node, with appropriate delays and | logging. | | ---------------------------------------------------------------------- | Data and other attributes inherited from Node: | | contained = ('__accessible', '__action', '__component', '__text', '__e... class Wizard(Window) | Note that the buttons of a GnomeDruid were not accessible until | recent versions of libgnomeui. This is | http://bugzilla.gnome.org/show_bug.cgi?id=157936 | and is fixed in gnome-2.10 and gnome-2.12 (in CVS libgnomeui); | there's a patch attached to that bug. | | This bug is known to affect FC3; fixed in FC5 | | Method resolution order: | Wizard | Window | Node | | Methods defined here: | | __init__(self, node, debugName=None) | | clickApply(self) | Click on the 'Apply' button to advance to next page of wizard. | FIXME: what if it's Finish rather than Apply ??? | | This will only work if your libgnomeui has accessible buttons; | see above. | | clickForward(self) | Click on the 'Forward' button to advance to next page of wizard. | | It will log the title of the new page that is reached. | | FIXME: what if it's Next rather than Forward ??? | | This will only work if your libgnomeui has accessible buttons; | see above. | | currentPage(self) | Get the current page of this wizard | | FIXME: this is currently a hack, supporting only GnomeDruid | | getPageTitle(self) | Get the string title of the current page of this wizard | | FIXME: this is currently a total hack, supporting only GnomeDruid | | ---------------------------------------------------------------------- | Methods inherited from Window: | | activate(self) | Activates the wnck.Window associated with this Window. | | FIXME: doesn't yet work | | getWnckWindow(self) | Get the wnck.Window instance for this window, or None | | ---------------------------------------------------------------------- | Methods inherited from Node: | | __getattr__(self, attr) | | __setattr__(self, attr, value) | | __str__(self) | If debugName is set on this Node, returns debugName surrounded | in curly braces. | Otherwise, returns a plain-text representation of the most | important attributes of the underlying Accessible. | | blink(self, count=2) | Blink, baby! | | button(self, buttonName, recursive=True) | 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. | | child(self, name='', roleName='', description='', label='', recursive=True, debugName=None) | 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. | | childLabelled(self, labelText, recursive=True) | 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) | 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. | | click(self) | If the Node supports an action called "click", do it, with appropriate delays and logging. | Otherwise, raise an ActionNotSupported exception. | | Note that this is just a shortcut to doAction('click'), as it is by far the most-used | action. To do any other action such as 'activate' or 'open', you must use doAction(). | | dump(self, type='plain') | | findAncestor(self, pred) | Search up the ancestry of this node, returning the first Node | satisfying the predicate, or None. | | findChild(self, pred, recursive=True, debugName=None, retry=True, requireResult=True) | 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. | | FIXME: make multiple attempts? | | findChildren(self, pred, recursive=True) | Find all children/descendents satisfying the predicate. | | getAbsoluteSearchPath(self) | 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 | | getLogString(self) | Get a string describing this node for the logs, | respecting the config.absoluteNodePaths boolean. | | getRelativeSearch(self) | 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? | | getUserVisibleStrings(self) | Get all user-visible strings in this node and its descendents. | | (Could be implemented as an attribute) | | keyCombo(self, comboString) | | menu(self, menuName, recursive=True) | 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) | 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. | | satisfies(self, pred) | Does this node satisfy the given predicate? | | tab(self, tabName, recursive=True) | 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. | | textentry(self, textEntryName, recursive=True) | 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. | | typeText(self, string) | Type the given text into the node, with appropriate delays and | logging. | | ---------------------------------------------------------------------- | Data and other attributes inherited from Node: | | contained = ('__accessible', '__action', '__component', '__text', '__e... FUNCTIONS sleep(...) sleep(seconds) Delay execution for a given number of seconds. The argument may be a floating point number for subsecond precision. DATA __author__ = 'Zack Cerza <zcerza@redhat.com>,\nDavid Malcolm <dmalcolm... config = <dogtail.config._Config object at 0x7f1dba850bd0> gotWnck = True logger = <dogtail.logging.Logger instance at 0x7f1dba869ab8> root = <dogtail.tree.Root instance at 0x164ffc8> AUTHOR Zack Cerza <zcerza@redhat.com>, David Malcolm <dmalcolm@redhat.com>
Paste!
ABAP
ActionScript
ActionScript 3
Ada
ANTLR
ANTLR With ActionScript Target
ANTLR With C# Target
ANTLR With CPP Target
ANTLR With Java Target
ANTLR With ObjectiveC Target
ANTLR With Perl Target
ANTLR With Python Target
ANTLR With Ruby Target
ApacheConf
AppleScript
aspx-cs
aspx-vb
Asymptote
Bash
Bash Session
Batchfile
BBCode
Befunge
Boo
Brainfuck
C
C#
C++
c-objdump
cfstatement
Cheetah
Clojure
CMake
CoffeeScript
Coldufsion HTML
Common Lisp
cpp-objdump
Creole Wiki
CSS
CSS+Django/Jinja
CSS+Genshi Text
CSS+Mako
CSS+Myghty
CSS+PHP
CSS+Ruby
CSS+Smarty
CSV
Cython
D
d-objdump
Darcs Patch
Debian Control file
Debian Sourcelist
Delphi
Django/Jinja
Dylan
Embedded Ragel
ERB
Erlang
Erlang erl session
Evoque
Felix
Fortran
GAS
GCC Messages
Genshi
Genshi Text
Gettext Catalog
Gherkin
GLSL
Gnuplot
Go
Groff
Haml
Haskell
haXe
HTML
HTML+Cheetah
HTML+Django/Jinja
HTML+Evoque
HTML+Genshi
HTML+Mako
HTML+Myghty
HTML+PHP
HTML+Smarty
INI
Io
IRC logs
Java
Java Server Page
javac Messages
JavaScript
JavaScript+Cheetah
JavaScript+Django/Jinja
JavaScript+Genshi Text
JavaScript+Mako
JavaScript+Myghty
JavaScript+PHP
JavaScript+Ruby
JavaScript+Smarty
Lighttpd configuration file
Literate Haskell
LLVM
Logtalk
Lua
Makefile
Makefile
Mako
Matlab
Matlab session
MiniD
Modelica
Modula-2
MoinMoin/Trac Wiki markup
MOOCode
Multi-File
MuPAD
MXML
Myghty
MySQL
NASM
Newspeak
Nginx configuration file
NumPy
objdump
Objective-C
Objective-J
OCaml
Ooc
Perl
PHP
POVRay
Prolog
Python
Python 3
Python 3.0 Traceback
Python console session
Python Traceback
Ragel
Ragel in C Host
Ragel in CPP Host
Ragel in D Host
Ragel in Java Host
Ragel in Objective C Host
Ragel in Ruby Host
Raw token data
RConsole
REBOL
Redcode
reStructuredText
RHTML
Ruby
Ruby irb session
S
Sass
Scala
Scheme
Smalltalk
Smarty
SQL
sqlite3con
SquidConf
Tcl
Tcsh
TeX
Text only
Unified Diff
Vala
VB.net
VimL
XML
XML+Cheetah
XML+Django/Jinja
XML+Evoque
XML+Mako
XML+Myghty
XML+PHP
XML+Ruby
XML+Smarty
XSLT
YAML
Make this paste a private paste
Tab-key inserts tabstops