403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python2.6/site-packages/orca/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.6/site-packages/orca//generator.pyc
z#Jc@sdZdZdZdZdZdZddkZddkZddkZddk	Z	ddk
Z
ddkZddkZddk
lZd	d
ZdZddd
YZdS(sASuperclass of classes used to generate presentations for objects.s$Id:$s$Revision:$s$Date:$s(Copyright (c) 2009 Sun Microsystems Inc.tLGPLiN(t_icCsfti\}}}|i}y
|i}Wntj
o
d}nXti||}|||fS(Ns	<no args>(tsystexc_infot__name__targstKeyErrort	tracebackt	format_tb(t
maxTBleveltclatexcttrbktexcNametexcArgstexcTb((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_formatExceptionInfo(s	
t	_generatet	GeneratorcBsdeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&Z(RS('sTakes accessible objects and generates a presentation for those
    objects.  See the generate method, which is the primary entry
    point.c	s|_|_h_xvtdtfdtdtD]>}|itt}|di	|d}|i|<qRWi
dS(NcSs
t|S((tcallable(tz((s2/usr/lib/python2.6/site-packages/orca/generator.pyt<lambda>Jscst|iiS((tgetattrt__get__t	__class__(ty(tself(s2/usr/lib/python2.6/site-packages/orca/generator.pyRKscSs
|itS((t
startswitht
METHOD_PREFIX(tx((s2/usr/lib/python2.6/site-packages/orca/generator.pyRLsii(t_modet_scriptt_methodsDicttfiltertmaptdirRtlenRtlowert_verifyFormatting(Rtscripttmodetmethodtname((Rs2/usr/lib/python2.6/site-packages/orca/generator.pyt__init__Bs					cCs"d|d<d|d<t|d<dS(sCOther things to make available from the formatting string.
        tobjtroletpyatspiN(tNoneR.(RtglobalsDict((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_addGlobalsSs

cCsh}x!|iiD]}g||<qW|i|x`|ii|iD]K}xBddgD]4}y|ii|i||}Wn
q^q^X|pq^nxtoyt||PWqtj
ot	}|dd}|i
dd}|i
dd}|ii|p+ti
tititid|ng||<qti
tititid	||||fPqXqWq^WqKWdS(
Ntfocusedt	unfocusediisname 'ts' is not defineds!Unable to find function for '%s'
s$While processing '%s' '%s' '%s' '%s'(R tkeysR1Rt
formattingRtTruetevalt	NameErrorRtreplacethas_keytdebugtprintExceptiontLEVEL_SEVEREtprintln(RR0tkeytroleKeyt
evalStringtinfotarg((s2/usr/lib/python2.6/site-packages/orca/generator.pyR&ZsL	


	cCs |idd}||d<|S(sConvenience method to allow you to temporarily override the role in
        the args dictionary.  This changes the role in args ags
        returns the old role so you can pass it back to _restoreRole.
        R-N(tgetR/(RtnewRoleRtoldRole((s2/usr/lib/python2.6/site-packages/orca/generator.pyt
_overrideRoles
cCs |o||d<n|d=dS(sConvenience method to restore the old role back in the args
        dictionary.  The oldRole should have been obtained from
        _overrideRole.  If oldRole is None, then the 'role' key/value
        pair will be deleted from args.
        R-N((RRGR((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_restoreRolesc
Ksg}h}|i|||d<|id|i|d<y4|d|d<|i|d<|iddp/|idtod|d<qd|d<n|iii|}|idtph|id	t	oA|iii
|}|iii|}d
|||f}nt	|d<t	}nt}ti
tid|iti|t||f|ptxt	oyt||}PWq{tj
og}t}	|	dd
}
|
idd}
|
idd}
|ii|
p,tititi
tid|
Pn|i|
||||
<ti
tid|
t||
fq{Xq{WWntitig}nXti
tid|ix+|D]#}ti
tidt|qW|S(s2Returns an array of strings (and possibly voice and audio
        specifications) that represent the complete presentatin for the
        object.  The presentatin to be generated depends highly upon the
        formatting strings in formatting.py.

        args is a dictionary that may contain any of the following:
        - alreadyFocused: if True, we're getting an object
          that previously had focus
        - priorObj: if set, represents the object that had focus before
          this object
        - includeContext: boolean (default=True) which says whether
          the context for an object should be included as a prefix
          and suffix
        - role: a role to override the object's role
        - formatType: the type of formatting, such as
          'focused', 'basicWhereAmI', etc.
        - forceMnemonic: boolean (default=False) which says if we
          should ignore the settings.enableMnemonicSpeaking setting
        - forceTutorial: boolean (default=False) which says if we
          should force a tutorial to be spoken or not
        R,R-R(t
formatTypetalreadyFocusedR2R3t	recursingtincludeContexts%s + %s + %ss'generate %s for %s (args=%s) using '%s'iisname 'R4s' is not defineds!Unable to find function for '%s'
s%s=%ssgenerate %s results:s  N(R1REtgetRoleRR/tFalseRR6t	getFormatR7t	getPrefixt	getSuffixR<R?t	LEVEL_ALLtgetAccessibleDetailstreprtAssertionErrorR8R9RR:R R;R=R>tstr(RR,RtresultR0tformattprefixtsuffixtfirstTimeCalledRCRDtelement((s2/usr/lib/python2.6/site-packages/orca/generator.pytgeneratesr

	


		)
!cKsgS(sReturns the role name for the object in an array of strings, with
        the exception that the pyatspi.ROLE_UNKNOWN role will yield an
        empty array.  Note that a 'role' attribute in args will
        override the accessible role of the obj.
        ((RR,R((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateRoleName
scKsRg}|ii|}|o|i|n|io|i|in|S(s Returns an array of strings for use by speech and braille that
        represent the name of the object.  If the object is directly
        displaying any text, that text will be treated as the name.
        Otherwise, the accessible name of the object will be used.  If
        there is no accessible name, then the description of the
        object will be used.  This method will return an empty array
        if nothing can be found.  [[[WDW - I wonder if we should just
        have _generateName, _generateDescription,
        _generateDisplayedText, etc., that don't do any fallback.
        Then, we can allow the formatting to do the fallback (e.g.,
        'displayedText or name or description'). [[[JD to WDW - I
        needed a _generateDescription for whereAmI. :-) See below.
        (RtgetDisplayedTexttappendtdescription(RR,RRXR*((s2/usr/lib/python2.6/site-packages/orca/generator.pyt
_generateNames
cKsg}|i||}|i||}|i|t|p|i|n4t|o&|d|djo|i|n|S(sReturns the label and the name as an array of strings for speech
        and braille.  The name will only be present if the name is
        different from the label.
        i(t_generateLabelRctextendR$(RR,RRXtlabelR*((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateLabelAndName)s

"cKs\g}|i|i|||p2|io$t|io|i|iqXn|S(sReturns the label as an array of strings for speech and braille.
        If the label cannot be found, the name will be used instead.
        If the name cannot be found, an empty array will be returned.
        (ReRdR*R$Ra(RR,RRX((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateLabelOrName8scKsSg}|ii|}|io-|i|i|gjo|i|in|S(sReturns an array of strings fo use by speech and braille that
        represent the description of the object, if that description
        is different from that of the name and label.
        (RtgetDisplayedLabelRbR*Ra(RR,RRXRf((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateDescriptionDs
#cKs4g}|ii|}|o|i|n|S(sReturns the label for an object as an array of strings for use by
        speech and braille.  The label is determined by the
        getDisplayedLabel of the script, and an empty array will be
        returned if no label can be found.
        (RRiRa(RR,RRXRf((s2/usr/lib/python2.6/site-packages/orca/generator.pyRdOs
cKs^g}y|i}Wntj
on0X|i}|ot|o|i|n|S(sReturns an array of strings for use by speech and braille that
        represent the description of the image on the object, if it
        exists.  Otherwise, an empty array is returned.
        (t
queryImagetNotImplementedErrortimageDescriptionR$Ra(RR,RRXtimageRb((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateImageDescriptionas	cKsqg}|iddp|i|d<nd|d<|iitip |i|ii	i
|n|S(sReturns an array of strings for use by speech and braille that
        represent the grayed/sensitivity/availability state of the
        object, but only if it is insensitive (i.e., grayed out and
        inactive).  Otherwise, and empty array will be returned.
        R(tinsensitivet
stringTypeN(RER/RtgetStatetcontainsR.tSTATE_SENSITIVERaRR6t	getString(RR,RRX((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateAvailabilityws
 cKsg}|iddp|i|d<nd|d<|iitip2|itijo<|i	iitio |i
|iii
|n|S(s*Returns an array of strings for use by speech and braille that
        represent the required state of the object, but only if it is
        required (i.e., it is in a dialog requesting input and the
        user must give it a value).  Otherwise, and empty array will
        be returned.
        R(trequiredRqN(RER/RRrRsR.tSTATE_REQUIREDRNtROLE_RADIO_BUTTONtparentRaRR6Ru(RR,RRX((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateRequireds
 cKsug}|iddp|i|d<nd|d<tio3|ii|o |i|iii	|n|S(sReturns an array of strings for use by speech and braille that
        represent the read only state of this object, but only if it
        is read only (i.e., it is a text area that cannot be edited).
        R(treadonlyRqN(
RER/RtsettingstpresentReadOnlyTextRtisReadOnlyTextAreaRaR6Ru(RR,RRX((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateReadOnlys

 cKsg}y|i}Wntj
o
d}nX|oxtd|iD]j}|i|dtdgjoB|iti	|}|i
|i|||i||qLqLWn|S(sReturns an array of strings for use by speech and braille that
        represent the checked state of the object.  This is typically
        for check boxes that are in a table. An empty array will be
        returned if this is not a checkable cell.
        ittoggleN(
tqueryActionRlR/trangetnActionstgetNameRRHR.tROLE_CHECK_BOXReR^RI(RR,RRXtactiontiRG((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateCellCheckedStates"	cKsg}|iddp|i|d<nd|d<|iii|}|i}|iti	o|i
|dn:|itio|i
|dn|i
|d|S(sReturns an array of strings for use by speech and braille that
        represent the checked state of the object.  This is typically
        for check boxes. [[[WDW - should we return an empty array if
        we can guarantee we know this thing is not checkable?]]]
        R(tcheckboxRqiiiN(RER/RRR6RuRrRsR.tSTATE_INDETERMINATERat
STATE_CHECKED(RR,RRXt
indicatorststate((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateCheckedStates
cKsg}|iddp|i|d<nd|d<|iii|}|i}|iti	o|i
|dn|i
|d|S(sReturns an array of strings for use by speech and braille that
        represent the checked state of the object.  This is typically
        for check boxes. [[[WDW - should we return an empty array if
        we can guarantee we know this thing is not checkable?]]]
        R(tradiobuttonRqiiN(RER/RRR6RuRrRsR.RRa(RR,RRXRR((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateRadioStates
cKsg}|iddp|i|d<nd|d<|iii|}|i}|iti	p|iti
o|i|dn|i|d|S(sReturns an array of strings for use by speech and braille that
        represent the checked state of the object.  This is typically
        for check boxes. [[[WDW - should we return an empty array if
        we can guarantee we know this thing is not checkable?]]]
        R(ttogglebuttonRqiiN(RER/RRR6RuRrRsR.Rt
STATE_PRESSEDRa(RR,RRXRR((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateToggleStates
cKs{g}|iddp|i|d<nd|d<|iii|}|iiti	o|i
|dn|S(sReturns an array of strings for use by speech and braille that
        represent the checked state of the menu item, only if it is
        checked. Otherwise, and empty array will be returned.
        R(RRqiN(RER/RRR6RuRrRsR.RRa(RR,RRXR((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateMenuItemCheckedStates
cKsg}|iddp|i|d<nd|d<|iii|}|i}|iti	o=|iti
o|i|dq|i|dn|S(sReturns an array of strings for use by speech and braille that
        represent the expanded/collapsed state of an object, such as a
        tree node. If the object is not expandable, an empty array
        will be returned.
        R(t	expansionRqiiN(RER/RRR6RuRrRsR.tSTATE_EXPANDABLEtSTATE_EXPANDEDRa(RR,RRXRR((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateExpandableStates
cKsg}|id|i}|titigjo|S|idd
p|i|d<ny|ii}Wnn}X|i	i
|}|i|}|djoN|i|}|p0|i
|}	|	o|i	i|	}qn|ot|o|}
|ddjoOtitijo8|idd
djo|
dtitii7}
qnz|dd	johtitijoQtitijo|dtitii}
q|dtitii}
qn|i|
qn|S(sReturns an array of strings to be used in speech and braille that
        represent the row header for an object that is in a table, if
        it exists.  Otherwise, an empty array is returned.
        R-R(itspeechRJt
basicWhereAmItdetailedWhereAmIt tbrailleN(RR(RERNR.tROLE_ROW_HEADERtROLE_TABLE_ROW_HEADERR/RRzt
queryTableRtgetCellIndext
getRowAtIndextgetRowDescriptiontgetRowHeaderR`R$R}tspeechVerbosityLeveltVERBOSITY_LEVEL_VERBOSEt	rolenamesRtbrailleVerbosityLeveltbrailleRolenameStyletBRAILLE_ROLENAME_STYLE_LONGtbrailleLongtbrailleShortRa(RR,RRXR-ttabletindextrowIndextdesctheaderttext((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateRowHeadersN	






cKsg}|id|i}|titigjo|Sy|ii}Wnn}X|ii|}|i	|}|djoN|i
|}|p0|i|}	|	o|ii|	}qn|ot
|o|}
|ddjoOtitijo8|idd
djo|
dtitii7}
qnz|dd	johtitijoQtitijo|dtitii}
q|dtitii}
qn|i|
qn|S(sReturns an array of strings (and possibly voice and audio
        specifications) that represent the column header for an object
        that is in a table, if it exists.  Otherwise, an empty array
        is returned.
        R-iR(RRJRRRRN(s
basicWhereAmIsdetailedWhereAmI(RERNR.tROLE_COLUMN_HEADERtROLE_TABLE_COLUMN_HEADERRzRRRtgetColumnAtIndextgetColumnDescriptiontgetColumnHeaderR`R$R}RRR/RRRRRRRRa(RR,RRXR-RRtcolumnIndexRRR((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateColumnHeader\sJ	






c
	KsZg}|idjo@g}ttg}xt|D]\}}y|i}Wntj
o
q5q5XxKtd|iD]7}	|i|	dtdgjot	||<Pq}q}Wq5W|do|doddg}n(|do|doddg}n|oAx>|D]2}||p!|i
|i|||qqWqVn|S(sReturns an array of strings for use by speech and braille for the
        label of a toggle in a table cell that has a special 2 child
        pattern that we run into.  Otherwise, an empty array is
        returned.
        iiRi(t
childCountROt	enumerateRRlRRRRR7ReR^(
RR,RRXt	cellOrdert	hasToggleRtchildRtj((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateTableCell2ChildLabels2	
"

-c
	KsZg}|idjo@g}ttg}xt|D]\}}y|i}Wntj
o
q5q5XxKtd|iD]7}	|i|	dtdgjot	||<Pq}q}Wq5W|do|doddg}n(|do|doddg}n|oAx>|D]2}||o!|i
|i|||qqWqVn|S(sReturns an array of strings for use by speech and braille for the
        toggle value of a toggle in a table cell that has a special 2
        child pattern that we run into.  Otherwise, an empty array is
        returned.
        iiRi(RRORRRlRRRRR7ReR^(
RR,RRXRRRRRR((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateTableCell2ChildToggles2	
"

-cKsP|ddjo|idtogSg}y|ii}Wn|SXy.|i}|ii|ii|}Wntj
od}d}nX|o|djpt
|djo|ii|}|i|}xct
d|iD]K}	|i|	dtdgjo#|i|}
|i|
iqqWn|S(sIf this table cell has a "toggle" action, and doesn't have any
        label associated with it then also speak the table column
        header.  See Orca bug #455230 for more details.
        R(Rt
readingRowiRN(RERORzRRRR`tgetRealActiveDescendantRlR/R$RRRRRRRRaR*(RR,RRXtparentTableRRfRtcolumnRt	accHeader((s2/usr/lib/python2.6/site-packages/orca/generator.pyt&_generateColumnHeaderIfToggleAndNoTexts0%	'cKsEg}|id|}|i|i|||i|||S(s`Orca has a feature to automatically read an entire row of a table
        as the user arrows up/down the roles.  This leads to
        complexity in the code.  This method is used to return an
        array of strings for use by speech and braille for a single
        table cell itself.  The string, 'blank', is added for empty
        cells.
        tREAL_ROLE_TABLE_CELL(RHReR^RI(RR,RRXRG((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateRealTableCells
cKsfg}y|ii}Wn
d	}nX|idd	dj}tip|o|o|ii|io|i}|ii|}|i	|}|i
|}	t}
|o|idjo|Snd|ii
joud|ii
job|ii
}|idjp@|d|jp/|djp||idjo|d|	j}
n|
ot|d<xtd|iD]}|i||}
|
pq{n|
i}|iti}|o^|i|
|}|o4|o-|idjo|ititin|i|q{q{Wqb|i|i||n|i|i|||S(
sOrca has a feature to automatically read an entire row of a table
        as the user arrows up/down the roles.  This leads to complexity in
        the code.  This method is used to return an array of strings
        (and possibly voice and audio specifications) for an entire row
        in a table if that's what the user has requested and if the row
        has changed.  Otherwise, it will return an array for just the
        current cell.
        RJRitlastRowt
lastColumnRiRN(RzRR/RER}treadTableCellRowRtisLayoutOnlyRRRR7tnColumnstpointOfReferenceRtnRowsRtgetAccessibleAtRrRsR.t
STATE_SHOWINGRRaRtRegiontbrailleTableCellDelimiterRe(RR,RRXRtisDetailedWhereAmIRzRtrowRt
presentAllRRtcellRtshowingt
cellResult((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateTableCellRow"sR	
		!
cKs"|ii|\}}}|gS(sReturns an array of strings for use by speech and braille
        that represents the current line of text, if
        this is a text object.  [[[WDW - consider returning an empty
        array if this is not a text object.]]]
        (RtgetTextLineAtCaret(RR,RRtcaretOffsettstartOffset((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateCurrentLineTextescKs|ii|gS(sReturns an array of strings for use by speech and braille that
        represents all the text being displayed by the object. [[[WDW
        - consider returning an empty array if this is not a text
        object.]]]
        (RR`(RR,R((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateDisplayedTextnscKsg}|iddp|i|d<nd|d<|ii|}|djo(|i|iii||dn|S(sReturns an array of strings for use by speech and braille that
        represents the tree node level of the object, or an empty
        array if the object is not a tree node.
        R(t	nodelevelRqiiN(RER/RRtgetNodeLevelRaR6Ru(RR,RRXtlevel((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateNodeLevel|s

cKs|ii|gS(sMReturns an array of strings for use by speech and braille that
        represents the value of the object.  This is typically the
        numerical value, but may also be the text of the 'value'
        attribute if it exists on the object.  [[[WDW - we should
        consider returning an empty array if there is no value.
        (RtgetTextForValue(RR,R((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateValuescKs.g}y|i|iiWnnX|S(sReturns an array of strings for use by speech and braille that
        represents the name of the applicaton for the object.
        (RatgetApplicationR*(RR,RRX((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateApplicationNamescKsug}|iddp|i|d<nd|d<|ii|}|o$|i|iii||n|S(sReturns an array of strings for use by speech and braille that
        represent the nesting level of an object in a list.
        R(tnestinglevelRqN(RER/RRtgetNestingLevelRaR6Ru(RR,RRXtnestingLevel((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateNestingLevels
c	Ksg}|itijod}|i}x@|D]8}|o*|itijo|id}Pq5q5W|o|i|i	i
|q|i}xt|oh|i|joX|ititi
gjo,|i|}|o|i|Pqn|i}qWn|S(sReturns an array of strings for use by speech and braille that
        represents the radio button group label for the object, or an
        empty array if the object has no such label.
        iN(RNR.RyR/tgetRelationSettgetRelationTypetRELATION_LABELLED_BYt	getTargetRaRR`Rzt
ROLE_PANELtROLE_FILLERRgRe(	RR,RRXtradioGroupLabelt	relationstrelationRzRf((s2/usr/lib/python2.6/site-packages/orca/generator.pyt_generateRadioButtonGroups0	
		
	cKs<g}|ii|ii|}|o
|g}n|S(sNObjects, such as tables and trees, can represent individual cells
        via a complicated nested hierarchy.  This method returns an
        array of strings for use by speech and braille that represents
        the text actually being painted in the cell, if it can be
        found.  Otherwise, an empty array is returned.
        (RR`R(RR,RRXR((s2/usr/lib/python2.6/site-packages/orca/generator.pyt*_generateRealActiveDescendantDisplayedTexts	
cKs2|ii|}|i|d<|i||S(sObjects, such as tables and trees, can represent individual cells
        via a complicated nested hierarchy.  This method returns an
        array of strings for use by speech and braille that represents
        the role of the object actually being painted in the cell.
        R-(RRRNR_(RR,Rtrad((s2/usr/lib/python2.6/site-packages/orca/generator.pyt%_generateRealActiveDescendantRoleNames()Rt
__module__t__doc__R+R1R&RHRIR^R_RcRgRhRjRdRoRvR{RRRRRRRRRRRRRRRRRRRRRRR(((s2/usr/lib/python2.6/site-packages/orca/generator.pyR;sN			1				k																		>	=	*	+	&		C									((Rt__id__t__version__t__date__t
__copyright__t__license__RRR.RR<RR}t	orca_i18nRRRR(((s2/usr/lib/python2.6/site-packages/orca/generator.pyt<module>s 

Youez - 2016 - github.com/yon3zu
LinuXploit