KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21573/root/usr/lib/python2.4/site-packages/dogtail/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21573/root/usr/lib/python2.4/site-packages/dogtail/tree.pyo
m
]Mc@sMdZdZdklZedkZdkZdklZdklZdk	l	Z	dkl
Z
dklZdkZdk
Z
d	klZy
dkZWnej
oed
nXydkZeZWnej
o
eZnXeadefdYZd
efdYZdefdYZdefdYZdfdYZdfdYZdefdYZ defdYZ!defdYZ"defdYZ#de#fd YZ$y"e!ei%i&Z'd!e'_(Wn e)j
oei*d"nXe'i+Z+e+oei*d#n[+dS($s-Makes some sense of the AT-SPI API

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>
sDZack Cerza <zcerza@redhat.com>,
David Malcolm <dmalcolm@redhat.com>
(scheckForA11yN(sdatetime(ssleep(sconfig(sdoDelay(sBlinker(sdebugLoggers#Error importing the AT-SPI bindingstSearchErrorcBstZRS(N(t__name__t
__module__(((t0/usr/lib/python2.4/site-packages/dogtail/tree.pyR_st
ReadOnlyErrorcBs&tZdZdZdZdZRS(s*
    This attribute is not writeable.
    sCannot set %s. It is read-only.cCs
||_dS(N(tattrtself(RR((Rt__init__gscCs|i|iS(N(RtmessageR(R((Rt__str__js(RRt__doc__RRR	(((RRbs	tNotSensitiveErrorcBs&tZdZdZdZdZRS(s&
    The widget is not sensitive.
    s"Cannot %s %s. It is not sensitive.cCs
||_dS(N(tactionR(RR((RRrscCs#|i|ii|iiifS(N(RRRtnametnodetgetLogString(R((RR	us(RRR
RRR	(((RRms	tActionNotSupportedcBs&tZdZdZdZdZRS(s;
    The widget does not support the requested action.
    sCannot do '%s' action on %scCs||_||_dS(N(t
actionNameRR(RRR((RR}s	cCs|i|i|iifS(N(RRRRR(R((RR	s(RRR
RRR	(((RRxs	tActionc
Bs8tZdZdZdZdZd
ZdZRS(sO
    Class representing an action that can be performed on a specific node
    tclicktpresstreleasetactivatetjumptchecktdocktundocktopentmenucCs||_||_||_dS(N(RRRt_Action__actiontindext_Action__index(RRRR((RRs		cCs|djo|ii|iiSnR|djo|ii|iSn.|djo|ii|iSn
t|dS(NR
tdescriptiont
keyBinding(	RRRtgetNameRtlowertgetDescriptiont
getKeyBindingtAttributeError(RR((Rt__getattr__s


cCs&d|i|i|i|if}|S(s:
        Plain-text representation of the Action.
        s;Action node='%s' name='%s' description='%s' keybinding='%s'N(RRR
R R!tstring(RR(((RR	s"cCstid|i|iif|iip>tio
t	|qnt	|}tidt|ntio|ii
n|ii|i}t|S(sV
        Performs the given tree.Action, with appropriate delays and logging.
        s%s on %ss	Warning: N(tloggertlogRR
RRt	sensitivetconfigtensureSensitivityRtnSEtstrtblinkOnActionstblinkRtdoActionRtresulttdoDelay(RR.R3((Rtdos#



(
sclickRRsactivateRRRRsopensmenu(RRR
ttypesRR'R	R5(((RRs				tNodecBs:tZdZd$ZdZdZd	Zd
ZdZdZ	d
Z
dZddZdZ
dZdZeeeedZedZdZddddeedZedZedZedZedZedZedZedZd Zd!d"Zd#ZRS(%s
    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
    t__accessiblet__actiont__componentt__textt__editableTextt__selectionc
	s@t_d_t|tio
|_	n<t|t
o%|i	_	t|dd_ndi	i_
i
dj	od}|_ni	i_idj	o1d}|_dd}|_ni	i_idj	o@ii_ii_ii_ii_ni	i_idj	oii_ni	i_i	i_idj	o.d}|_ d}|_!ni"}|o8|io.d	}	|	_#d
}|	_$ndS(Nt	debugNamesUnknown Node initializercs>i}|i|o||iSnt|dS(s
                Performs the tree.Action with the given name, with appropriate delays and logging,
                or raises the ActionNotSupported exception if the node doesn't support that particular
                action.
                N(Rtactionsthas_keyR
R5R(R
R?(R(RR2Is
	csiitdS(N(Rt_Node__componentt	grabFocusR4((R(RRBYs
icsi}|d|df}|d|df}|dd|d}|dd|d}tio6ti	di
it|t|fnt
i|||dS(s
                Generates a raw mouse click event whether or not the Node has a 'click' action, using the specified button.
                1 is left,
                2 is middle,
                3 is right.
                iiiif0.5sraw click on %s %s at (%s,%s)N(RtextentstpositiontsizetclickXtclickYR,tdebugSearchingR)R*R
RR/trawinputRtbutton(RJRCRFRGRDRE(R(RtrawClick^s	
6cs
iiS(s7
                Selects all children.
                N(Rt_Node__selectiont	selectAll((R(RRMscs
iiS(sB
                Deselects all selected children.
                N(RRLtclearSelection((R(RtdeselectAllscsiiiiS(sM
                Selects the node, relative to its siblings.
                N(RtparentRLtselectChildt
indexInParent((R(RtselectscsXd}i}x6tiD]%}|i|io|d7}qqW|ii	|S(sO
                Deselects the node, relative to its siblings.
                iiN(
t
selectedIndexRRPtrangeRRtitchildrent
isSelectedRLtdeselectSelectedChild(RTRVRP(R(Rtdeselects	(%tFalseRt_Node__hideChildrentNoneR>t
isinstancetinitializertatspit
Accessiblet_Node__accessibleR7tgetattrt	getActiont
_Node__actionR2tgetComponentRARBRKtgetTextt_Node__texttaddSelectiontgetNSelectionstremoveSelectiontsetSelectiontgetEditableTextt_Node__editableTextt
setAttributestgetHypertextt_Node__hypertexttgetSelectionRLRMRORPRSRZ(
RR_RMRPROR2RBRZRKRS((RRR:sR		

	
	
		
cCsptonb|djo*t|itijo|iiSn+|djo*t|itijo|iiSn|djo*t|itijo|ii	Sn|djo't|itijo|ii
Sn|djo't|itijo|iiSnU|djo|iiSn7|djo|ii
Sn|djo|iiSn|d	jo|iiSn|d
jo.|ii}|ot|}|Sqln|djo|iiSn|djov|iodSng}|ii}
|
tijo8tp$tid
ttitanti}
nxt |
D]}
t"|t#oOy|ii$|
}Wqti&j
o#dk'}ti|i(qXn|ii$|
}|dj	o|i*t|qrqrW|i+oIxFt,|i+i-D]+}
|i*t.||i+i/|
|
q1Wn|Sn|djo|ii0Sn|djo|ii1Sn|djoKx|i2D]9}|i4ti5jo|i6}	t8t|	SqqWnm|djoKx\|i2D]9}|i4ti9jo|i6}	t8t|	SqqWn|djo|ii0i:ti;Sn|djo|ii0i:ti<Sn|djo|ii0i:ti=Sn|djo|ii0i:ti>Snm|djo|ii0i:ti?SnC|djo^h}|iAoFxCt |iAiBD](}
tC||iA|
}|||iE<q]Wn|Sn|djo|iFo|iFiGSqln|djo|iFo|iFiHSqln|djo9|iFo+|iFiG}|d|df}|Sqln:|djo%|iKo|iKiLddSqln|d jo|iKo|iKiMSqln|d!jo8|i}|o$|iNo|iiNiO|iPSqln|d"jo|iodSng}|i}|oP|iiNoCx@t |iNiRD]%}
|i*t|iNiS|
q.Wn|Sn
tT|dS(#NttoolkittversiontIDtpausetresumeR
troletroleNameR RPRRRWstOnly returning %s children. You may change config.childrenLimit if you wish. This message will only be printed once.tstateSett	relationstlabelleetlabellerR+tshowingt	focusabletfocusedtcheckedR?RCRDREiittextiitcaretOffsetRXtselectedChildren(UR[RttypeRRbR`tApplicationt
getToolkitt
getVersiontgetIDRvRwR"tgetRoletgetRoleNameR$t	getParentt	parentAccR7RPtgetIndexInParentR\RWt
getChildCountt
childCountR,t
childrenLimitthaveWarnedAboutChildrenLimitR)R*R/tTruetxrangeRVR^tRoottgetChildAtIndextatSpiExceptiont	tracebackt
format_excR]tappendRqRUt	getNLinkstLinktgetLinktgetStateSettgetRelationSetR{trelationtgetRelationTypetSPI_RELATION_LABEL_FORt
getTargetsttargetstapplytSPI_RELATION_LABELED_BYtcontainstSPI_STATE_SENSITIVEtSPI_STATE_SHOWINGtSPI_STATE_FOCUSABLEtSPI_STATE_FOCUSEDtSPI_STATE_CHECKEDR?RetgetNActionsRRR
RAt
getExtentstgetPositionRCRERhRgtgetCaretOffsetRLtisChildSelectedRRRtgetNSelectedChildrentgetSelectedChildR&(RRRCRR?RRWRERRRRPRRVRR((RR's&&&&&










	

-























	

	'cCsVtonH|idd|ijo||i|<n|dddgjo
t|n|dddd	d
ddd
dddgjo
t|n|dddddgjo
t|n|djo
t|nz|dddgjo
t|nW|djo+|ip
t|n|ii	|n|djo]|i
p
t|ntio!t
id|i|fn|i
i|tn|djoO|i
p
t|nt
id|i|f|i
i|tnY|djo>t
id |i|f|id!|itn||i|<dS("Nt_NodetRsRtRuR
RxRyR RPRRRWRzR{R|R}R+R~RRRR?RCRDRERRsSetting text of %s to '%s'tpasswordTexts Setting text %s to password '%s't
combovaluesSetting combobox %s to '%s't	childName(R[RtreplaceRt	containedtvaluet__dict__RRhtsetCaretOffsetRnR,RHR)R*RtsetTextContentsR4t
childNamedR(RRR((Rt__setattr__9sN
.











!



cCstid|i|ftoWtid|i|ii|it	|it
|7_tid|in|ioD|ip)y|i
WqtidqXnti|n$tidti	|7_	tdS(sa
        Type the given text into the node, with appropriate delays and
        logging.
        sTyping text into %s: '%s'scaret offset: %ssnew caret offset: %ss(Node is focusable but I can't grabFocus!s3Node is not focusable; falling back to setting textN(R)R*RRR(R[RRnt
insertTextRtlenRRRBRIttypeTextRR4(RR(((RRs"


cCstio!tidt|ifn|io7|ip)y|i	WqhtidqhXqyntidt
i|dS(NsPressing keys '%s' into %ss(Node is focusable but I can't grabFocus!s.Node is not focusable; trying key combo anyway(
R,RHR)R*tcomboRRRRRBRItkeyCombotcomboString(RR((RRs
!


cCs{|iod|idSn[d}|d|i}|d|i|if}|idj	o|d|i}n|SdS(s
        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.
        t{t}R7s roleName='%s's name='%s' description='%s's
 text='%s'N(RR>R(RyR
R RR](RR(((RR	s
cCs&tio|iSnt|SdS(sz
        Get a string describing this node for the logs,
        respecting the config.absoluteNodePaths boolean.
        N(R,tabsoluteNodePathsRtgetAbsoluteSearchPathR/(R((RRs
cCs
|i|S(s=
        Does this node satisfy the given predicate?
        N(tpredtsatisfiedByNodeR(RR((Rt	satisfiesstplaincCs&dk}t||}||dS(N(tdumpRcRtdumperR(RRRR((RRs	cCstiotid|n|idjo0ti}|i	t
i|it
|Snm|ioX|i\}}}tiotid|n|i}|i	|||SntiSdS(s
        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
        sgetAbsoluteSearchPath(%s)tapplicationsgot ancestor: %sN(R,tdebugSearchPathsR)R*RRytpatht
SearchPathR3Rt	predicatetIsAnApplicationNamedR
R[RPtgetRelativeSearchtancestorRtisRecursiveRtancestorPath(RRR3RRR((RRs


cCstiotid|nt}|i}x$|i	|p|i}t
}q1W|io1|iio |t
i|ii|fSqn|idjo|t
i|i|fSn|idjp|idjo|t
i|i|fSn|idjo|t
i|i|fSn|idjo|t
i|i|fSn|idjo|t
i|i|fSnY|idjo|t
i|i|fSn,t
id	|id
|i}|||fSdS(s
        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?
        sgetRelativeSearchPath(%s)Rs	menu itemscheck menu itemRspush buttontframetdialogR
RyN(R,RR)R*RR[RRPRt_Node__nodeIsIdentifiableRR|R
RtIsLabelledAsRytIsAMenuNamedtIsAMenuItemNamedtIsATextEntryNamedtIsAButtonNamedtIsAWindowNamedtIsADialogNamedtGenericPredicateR(RRRR((RRs8
		

$ cCs>|iotSn)|iotSn|iptSntSdS(N(RR|RR
RPR[(RR((Rt__nodeIsIdentifiable"s


c
s7tdd}d}x|tijo|tijp
tio*ti	d||||||fn|||}	|	o+|o
||	_
n|i|	_
|	Sq!|pPn|d7}tip
tioti	dtinttiq!W|ot|||||ndS(s
        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?
        csty
|i}WndSnXxR|D]J}|i|o|Sq"|o%|||}|o|Sqlq"q"WdS(se
            Internal helper function that does a one-shot search, recursing if need be.
            N(RPRWR]tchildRRt	recursivetfindFirstChildSatisfying(RPRRRRW(R(RR=s
cCsK|o
d}nd}|djo|i}nd||i|fS(s2
            Internal helper function
            t
descendentRs%s of %s: %sN(RtnounR>R]RtdescribeSearchResultRPR(RPRRR>R((RtdescribeSearchQs

issearching for %s (attempt %i)issleeping for %fN(RRRtnumAttemptsR,tsearchCutoffCounttsearchWarningThresholdRHR)R*RRRR>R3Rtretryt
debugSleeptsearchBackoffDurationtsleept
requireResultR(
RRRR>RRRRRR3((RRt	findChild-s0	*

cCsg}y
|i}WndSnXxu|D]m}|i|o|i|n|o?|i	||}|o"x|D]}|i|qvWqq(q(W|o|SndS(sI
        Find all children/descendents satisfying the predicate.
        N(tselfListRRWR]RRRRRtfindChildrent	childList(RRRRRRRW((RRws&
cCsC|i}x3|djo%|i|o|Sq|i}qWdS(sz
        Search up the ancestry of this node, returning the first Node
        satisfying the predicate, or None.
        N(RRPt	candidateR]RR(RRR((RtfindAncestors	
Rc
Cs7|itid|d|d|d|d|d|S(s
        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.
        R
RyR tlabelRR>N(
RRRRR
RyR RRR>(RR
RyR RRR>((RRscCs|itid||S(s
        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.
        tmenuNameN(RRRRRR(RRR((RRscCs|itid||S(s

        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.
        tmenuItemNameN(RRRRRR(RRR((RtmenuItemscCs|itid||S(s
        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.
        t
textEntryNameN(RRRRRR(RRR((Rt	textentryscCs|itid||S(s
        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.
        t
buttonNameN(RRRRRR(RRR((RRJscCs|iti||S(s
        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.
        N(RRRt
IsLabelledt	labelTextR(RRR((Rt
childLabelledscCs|iti||S(s
        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.
        N(RRRtIsNamedRR(RRR((RRscCs|itid||S(s
        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.
        ttabNameN(RRRtIsATabNamedRR(RRR((RttabscCsg}|io|i|in|io|i|iny
|i}Wn|SnXx!|D]}|i|iqdW|S(s
        Get all user-visible strings in this node and its descendents.

        (Could be implemented as an attribute)
        N(	R3RR
RR RWRtextendtgetUserVisibleStrings(RRR3RW((RRs


icCsG|iptSn2|i\}}}}t|||||}t
SdS(s
        Blink, baby!
        N(RRCR[txtytwthtBlinkertcountt	blinkDataR(RRRRRRR
((RR1s
cCs4|idj	o|idSntd|dS(sc
        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().
        RN(RReR]R2R(R((RRs(R8R9R:R;R<R=( RRR
RRR'RRRR	RRRRRRRR]RRRRRRRRJRRR
RR1R(((RR7s8{	u		L					
		'	,	J	






	RcBs/tZdZdZdZdZdZRS(s(
    Class representing a hyperlink
    t__hyperlinkt__nodecCsRd|_||_||_||_t	|ii
|i|_t|i_
dS(N(R]RR>RRPt	hyperlinkt_Link__hyperlinkRt_Link__indexR7t	getObjectt_Link__nodeRt_Link__hideChildren(RRRR((RR s				cCstons|djo|ii|iSnO|djodSnyt|i|}|SWnt	j
ot	|nXdS(NtURIRW(
R[R
RRtgetURIRRcRR3R&(RR
R3((RR')s

cCs||i|<dS(N(RRRR
(RR
R((RR7s(RR(RRR
RRR'R(((RRs
			RcBs tZdZdZdZRS(s
    FIXME:
    cCstitidddtS(s'
        Get all applications.
        RyRRN(troottfindAllChildrenSatisfyingRRR[(R((Rtapplications>scCs"ttiti|dtS(s.
        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.
        RN(RRRRRtappNameR[(RR!((RRDs(RRR
R R(((RR:s	RcBs)tZedZedZdZRS(NcCs|itid||S(sd
        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?
        t
dialogNameN(RRRRR"R(RR"R((RRPs
cCs(t|itid||}|S(s
        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.
        t
windowNameN(tWindowRRRRR#RR3(RR#RR3((Rtwindow]s$cCs4tdd}|o|i}|iSndS(s*
        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
        RyRN(RR%t
getWnckWindowt
wnckWindowtget_application(RR'R%((RtgetWnckApplicationps

(RRR[RR%R)(((RROs
R$cBstZdZdZRS(NcCsOti}|ix2|iD]$}|i|ijo|Sq#q#WdS(sG
        Get the wnck.Window instance for this window, or None
        N(	twncktscreen_get_defaulttscreentforce_updatetget_windowsR'tget_nameRR
(RR,R'((RR&s

cCs|i}|iddS(si
        Activates the wnck.Window associated with this Window.

        FIXME: doesn't yet work
        iN(RR&R'R(RR'((RRs(RRR&R(((RR$s	tWizardcBs>tZdZedZdZdZdZdZRS(sJ
    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
    cCsEti|||o
||_ntid||ifdS(Ns%s is on '%s' page(R7RRRR>R)R*tgetPageTitle(RRR>((RRs
cCsF|idd}x#|iD]}|io|SqqWd|dS(sz
        Get the current page of this wizard

        FIXME: this is currently a hack, supporting only GnomeDruid
        Rytpanels&Unable to determine current page of %sN(RRt
pageHolderRWR~(RR3R((RtcurrentPages

cCs=|i}|iddiddidddtiS(s
        Get the string title of the current page of this wizard

        FIXME: this is currently a total hack, supporting only GnomeDruid
        RyR2RRN(RR4RR[R(RR4((RR1scCs:|id}|itid||ifdS(s'
        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.
        tForwards%s is now on '%s' pageN(RRtfwdRR)R*R1(RR6((RtclickForwards

cCs|id}|idS(s
        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.
        tApplyN(RRR6R(RR6((Rt
clickApplys(	RRR
R]RR4R1R7R9(((RR0s					RsJError: AT-SPI's desktop is not visible. Do you have accessibility enabled?skWarning: AT-SPI's desktop is visible but it has no children. Are you running any AT-SPI-aware applications?(,R
t
__author__tutilstcheckForA11ytreRtdatetimettimeRR,R4RRIRtloggingtdebugLoggerR)R`tImportErrorR*RtgotWnckR[Rt	ExceptionRt	TypeErrorRRRRR7RRRR$R0tregistryt
getDesktopRR>tAssertionErrorR*RW(R0R>RRR$RRIRWR7RRRCR*R=RR)RR:RRR`RR4R,R<RRR((Rt?:s\
		




		

	
6c 3G
	

Anon7 - 2021