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 :  /proc/11490/root/usr/lib/python2.6/site-packages/orca/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/11490/root/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyo
Ñò
z#ÝJc@sodZdZdZdZdZdZddkZddkZddkZddk	l
Z
d	dd
„ƒYZdS(s%Utilities for obtaining tutorial utterances for objects.  In general,
there probably should be a singleton instance of the TutorialGenerator
class.  For those wishing to override the generators, however,
one can create a new instance and replace/extend the tutorial generators
as they see fit.s$Id$s
$Revision$s$Date$s-Copyright (c) 2008-2009 Sun Microsystems Inc.tLGPLiÿÿÿÿN(t_tTutorialGeneratorcBsÈeZdZd„Zd„Zdd„Zd„Zd„Zd„Z	d„Z
d„Zd	„Zd
„Z
d„Zd„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zed„ZRS(sTakes accessible objects and produces a tutorial string to speak
    for those objects.  See the getTutorialString method, which is the
    primary entry point.  Subclasses can feel free to override/extend
    the getTutorialGenerators instance field as they see fit.cCsÁ||_d|_h|_|i|iti<|i|iti<|i|iti	<|i
|iti<|i|iti
<|i|iti<|i|iti<|i|iti<|i|iti<|i|iti<|i|iti<|i|iti<|i|iti<|i|iti<|i|iti<|i|iti<|i |iti!<|i"|iti#<|i|iti$<|i|iti%<|i|iti&<|i'|iti(<dS(Nt()t_scripttlastTutorialttutorialGeneratorst_getTutorialForCheckBoxtpyatspitROLE_CHECK_BOXt_getTutorialForComboBoxtROLE_COMBO_BOXt_getTutorialForFramet
ROLE_FRAMEt_getTutorialForIcont	ROLE_ICONt_getTutorialForLayeredPanetROLE_LAYERED_PANEt_getTutorialForListt	ROLE_LISTt_getTutorialForListItemtROLE_LIST_ITEMt_getTutorialForPageTabt
ROLE_PAGE_TABt_getTutorialForTexttROLE_PARAGRAPHtROLE_PASSWORD_TEXTt
ROLE_ENTRYt_getTutorialForPushButtontROLE_PUSH_BUTTONt_getTutorialForSpinButtontROLE_SPIN_BUTTONt_getTutorialForTableCellRowtROLE_TABLE_CELLt	ROLE_TEXTtROLE_TOGGLE_BUTTONt_getTutorialForRadioButtontROLE_RADIO_BUTTONt_getTutorialForMenut	ROLE_MENUtROLE_CHECK_MENU_ITEMtROLE_MENU_ITEMtROLE_RADIO_MENU_ITEMt_getTutorialForSlidertROLE_SLIDER(tselftscript((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyt__init__,s2			cCs¤titid|ƒtitid|iƒtitid|iƒƒtitid|ƒtitidƒx%|D]}titid|ƒqWdS(s/Prints debug.LEVEL_FINER information regarding
        the tutorial generator.

        Arguments:
        - generatorName: the name of the generator
        - obj: the object being presented
        - alreadyFocused: False if object just received focus
        - utterances: the generated text
        s
GENERATOR: %ss           obj             = %ss           role            = %ss           alreadyFocused  = %ss           utterances:s               (%s)N(tdebugtprintlntLEVEL_FINERtnametgetRoleName(R-t
generatorNametobjtalreadyFocusedt
utterancesttext((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyt_debugGeneratorfscCsgS(sÔThe default tutorial generator returns the empty tutorial string
        because We have no associated tutorial function for the object.

        Arguments:
        - obj: an Accessible
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string
        - role: A role that should be used instead of the Accessible's
          possible role.

        Returns the empty list []
        ((R-R6R7t
forceTutorialtrole((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyt_getDefaultTutorialscCs_g}tdƒ}|o|i|gjp|o|i|ƒn|id|||ƒ|S(s>Get the  tutorial string for a check box.

        Arguments:
        - obj: the check box
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string

        Returns a list of tutorial utterances to be spoken for the object.
        sPress space to toggle.R(RRtappendR:(R-R6R7R;R8tmsg((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyR‘s	cCs_g}tdƒ}|o|i|gjp|o|i|ƒn|id|||ƒ|S(s=Get the  tutorial string for a combobox.

        Arguments:
        - obj: the combo box
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string

        Returns a list of tutorial utterances to be spoken for the object.
        s=Press space to expand, and use up and down to select an item.R
(RRR>R:(R-R6R7R;R8R?((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyR
«s	cCsg}|ii|ƒ}|o|io
|i}ntdƒ}|ii|ƒ}|djo|i|ƒn|id|||ƒ|S(s6Get the  tutorial string for a frame.

        Arguments:
        - obj: the frame
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string

        Returns a list of tutorial utterances to be spoken for the object.
        s,Press alt+f6 to give focus to child windows.iR(RtgetDisplayedTexttdescriptionRtgetUnfocusedAlertAndDialogCountR>R:(R-R6R7R;R8R3tchildWindowsMsgtalertAndDialogCount((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyRÆs

	cCsd|iiƒtijo|i|i||ƒ}n|i|||ƒ}|id|||ƒ|S(s5Get the  tutorial string for an icon.

        Arguments:
        - obj: the icon
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string

        Returns a list of tutorial utterances to be spoken for the object.
        R(tparenttgetRoleRRRR=R:(R-R6R7R;R8((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyRès
			c
Csèg}|ii|ƒ}|o|io
|i}ntdƒ}|i|ƒtdƒ}|ii}|iidƒ}	d|jo||	jo|i|ƒn|o|i|jp|ong}|i	d|||ƒ|S(sDGet the  tutorial string for a layered pane.

        Arguments:
        - obj: the layered pane
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string

        Returns a list of tutorial utterances to be spoken for the object.
        sDTo move to items, use either the arrow keys or type ahead searching.s0To get to the system menus press the alt+f1 key.itnautilusR(
RR@RARR>R3REtgetChildAtIndexRR:(
R-R6R7R;R8R3R?t
desktopMsgt
scriptNametsibling((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyRs(

	cCs_g}tdƒ}|o|i|gjp|o|i|ƒn|id|||ƒ|S(s4Get the  tutorial string for a list.

        Arguments:
        - obj: the list
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string

        Returns a list of tutorial utterances to be spoken for the object.
        s"Use up and down to select an item.R(RRR>R:(R-R6R7R;R8R?((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyR/s	cCsÈg}tdƒ}tdƒ}|iƒ}|itiƒoq|itiƒo/|i|gjp|o|i|ƒqªq®|i|gjp|o|i|ƒq®n|id|||ƒ|S(s<Get the  tutorial string for a listItem.

        Arguments:
        - obj: the listitem
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string

        Returns a list of tutorial utterances to be spoken for the object.
        s#To collapse, press shift plus left.s"To expand, press shift plus right.R(	RtgetStatetcontainsRtSTATE_EXPANDABLEtSTATE_EXPANDEDRR>R:(R-R6R7R;R8texpandedMsgtcollapsedMsgtstate((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyRJs	cCs`g}tdƒ}|p|o%|ii|ƒo|i|ƒn|id|||ƒ|S(sDGet the tutorial string for a text object.

        Arguments:
        - obj: the text component
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string

        Returns a list of tutorial utterances to be spoken for the object.
        s
Type in text.R(RRtisReadOnlyTextAreaR>R:(R-R6R7R;R8R?((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyRts
	cCsWg}tdƒ}|i|gjp|o|i|ƒn|id|||ƒ|S(s;Get the tutorial string for a page tab.

        Arguments:
        - obj: the page tab
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string

        Returns a list of tutorial utterances to be spoken for the object.
        s&Use left and right to view other tabs.t_getTutorialForPageTabList(RRR>R:(R-R6R7R;R8R?((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyRŽs	cCs_g}tdƒ}|o|i|gjp|o|i|ƒn|id|||ƒ|S(s7Get the tutorial string for a push button

        Arguments:
        - obj: the push button
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string

        Returns a list of utterances to be spoken for the object.
        sTo activate press space.R(RRR>R:(R-R6R7R;R8R?((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyR©s	cCs_g}tdƒ}|o|i|gjp|o|i|ƒn|id|||ƒ|S(s}Get the tutorial string for a spin button.  If the object already has
        focus, then no tutorial is given.

        Arguments:
        - obj: the spin button
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string

        Returns a list of utterances to be spoken for the object.
        sMUse up or down arrow to select value. Or type in the desired numerical value.R(RRR>R:(R-R6R7R;R8R?((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyRÃs	cCsÏg}tdƒ}tdƒ}|idjoLg}ttg}x‘t|ƒD]ƒ\}	}
y|
iƒ}Wntj
o
qMqMXxKtd|iƒD]7}|i|ƒdtdƒgjot	||	<Pq•q•WqMW|do|doddg}n(|do|doddg}n|oMxE|D]=}	|o||	oq0|i
|i||	||ƒƒq0W|Sny|iƒ}Wntj
o
d
}nX|oxxutd|iƒD]]}	t
it
idd|	ƒ|i|	ƒdtdƒgjo|i|||ƒ}PqÀqÀWn|iƒ}
|
itiƒoq|
itiƒo/|i|gjp|o|i|ƒq±qµ|i|gjp|o|i|ƒqµn|id	|||ƒ|S(s;Get the tutorial utterances for a single table cell

        Arguments:
        - obj: the table
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string

        Returns a list of utterances to be spoken for the object.
        s#To collapse, press shift plus left.s"To expand, press shift plus right.iittoggleis*tutorialgenerator._getTutorialForTableCellslooking at action %dt_getTutorialForTableCellN(Rt
childCounttFalset	enumeratetqueryActiontNotImplementedErrortrangetnActionstgetNametTruetextendRVtNoneR0R1tLEVEL_FINESTRRLRMRRNRORR>R:(R-R6R7R;R8RPRQt	cellOrdert	hasToggletitchildtactiontjRR((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyRVàsp	
"


	"	
	cCsƒg}|pGy|iiƒ}Wntj
o
d}nXtioõ|oî|ii|iƒo×|i}|ii|ƒ}|i	|ƒ}|i
|ƒ}	t}
d|iijoed|iijoR|ii}|d|jp/|djp||i
djo|d|	j}
n|i|i|||ƒƒqi|i|||ƒ}n|i|||ƒ}|id|||ƒ|S(sKGet the tutorial string for the active table cell in the table row.

        Arguments:
        - obj: the table
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string

        Returns a list of utterances to be spoken for the object.
        tlastRowt
lastColumniiR N(REt
queryTableR[RatsettingstreadTableCellRowRtisLayoutOnlytgetCellIndext
getRowAtIndextgetColumnAtIndexR_tpointOfReferencetnRowsR`RVR:(R-R6R7R;R8tparent_tableREtindextrowtcolumntspeakAllRr((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyR Ks<	!			cCs_g}tdƒ}|o|i|gjp|o|i|ƒn|id|||ƒ|S(s:Get the tutorial string for a radio button.

        Arguments:
        - obj: the radio button
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string

        Returns a list of utterances to be spoken for the object.
        sUse arrow keys to change.R$(RRR>R:(R-R6R7R;R8R?((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyR$s	cCs»g}tdƒ}tdƒ}|iidjoE|ii|ijo/|i|gjp|o|i|ƒq¡n,|i|gjp|o|i|ƒn|id|||ƒ|S(s*Get the tutorial string for a menu.

        Arguments:
        - obj: the menu
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string

        Returns a list of utterances to be spoken for the object.
        sUTo navigate, press left or right arrow. To move through items press up or down arrow.s%To enter sub menu, press right arrow.RR&(RRER3t	__class__RR>R:(R-R6R7R;R8tmainMenuMsgt
subMenuMsg((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyR&šs)	cCs_g}tdƒ}|o|i|gjp|o|i|ƒn|id|||ƒ|S(ssGet the tutorial string for a slider.  If the object already has
        focus, then no tutorial is given.

        Arguments:
        - obj: the slider
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string

        Returns a list of utterances to be spoken for the object.
        stTo decrease press left arrow, to increase press right arrow. To go to minimum press home, and for maximum press end.R+(RRR>R:(R-R6R7R;R8R?((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyR+½s	cCs«tipgS|iƒ}||ijo|i|}n
|i}||||ƒ}di|ƒg}|o
||_n|o
d|_n|id|||ƒ|S(sGet the tutorial for an Accessible object.  This will look
        first to the specific tutorial generators and if this
        does not exist then return the empty tutorial.
        This method is the primary method
        that external callers of this class should use.

        Arguments:
        - obj: the object
        - alreadyFocused: False if object just received focus
        - forceTutorial: used for when whereAmI really needs the tutorial string

        Returns a list of utterances to be spoken.
        t RtgetTutorial(RltenableTutorialMessagesRFRR=tjoinRR:(R-R6R7R;R<t	generatorR?R8((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyR}Ús"
	

	N(t__name__t
__module__t__doc__R/R:RaR=RR
RRRRRRRRRRVR R$R&R+RXR}(((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyR&s*	:				"		,		*					k	6		#	((Rƒt__id__t__version__t__date__t
__copyright__t__license__RR0Rlt	orca_i18nRR(((s:/usr/lib/python2.6/site-packages/orca/tutorialgenerator.pyt<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit