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/liveregions.pyo
z#Jc@sddkZddkZddkZddkZddkZddkZddkZddklZdZ	dZ
dZdZdZ
dZdZd	d
d
YZdddYZdS(iN(t_iiiii-i	t
PriorityQueuecBs_eZdZdZdZdZdZdZdZdZ	dZ
d	ZRS(
s This class represents a thread **UNSAFE** priority queue where priority
    is determined by the given integer priority.  The entries are also   
    maintained in chronological order. 

    TODO: experiment with Queue.Queue to make thread safe
    cCs
g|_dS(N(tqueue(tself((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyt__init__ scCs)ti|i|ti||fdS(sS Add a new element to the queue according to 1) priority and
        2) timestamp. N(tbisecttinsort_leftRttime(Rtdatatprioritytobj((s4/usr/lib/python2.6/site-packages/orca/liveregions.pytenqueue#scCs|iidS(s2get the highest priority element from the queue.  i(Rtpop(R((s4/usr/lib/python2.6/site-packages/orca/liveregions.pytdequeue(scCs
g|_dS(s Clear the queue N(R(R((s4/usr/lib/python2.6/site-packages/orca/liveregions.pytclear,scs4tifd}t||i|_dS(sL Purge items from the queue that are older than the keepalive 
        time cs|dtjS(i(tMSG_KEEPALIVE_TIME(titem(tcurrenttime(s4/usr/lib/python2.6/site-packages/orca/liveregions.pyt<lambda>4sN(RtfilterR(Rtmyfilter((Rs4/usr/lib/python2.6/site-packages/orca/liveregions.pytpurgeByKeepAlive0scs(fd}t||i|_dS(se Purge items from the queue that have a lower than or equal priority
        than the given argument cs|djS(i((R(R	(s4/usr/lib/python2.6/site-packages/orca/liveregions.pyR:sN(RR(RR	R((R	s4/usr/lib/python2.6/site-packages/orca/liveregions.pytpurgeByPriority7scCst|iog}|i|id|ddd}|ddd}x|tdt|iD]b}|i|dd|jo,|dddi|i|ddqg|i|i|qgW||_ndS(s Combines messages with the same 'label' by appending newer  
        'content' and removing the newer message.  This operation is only
        applied to the next dequeued message for performance reasons and is
        often applied in conjunction with filterContents() iitlabelstcontentiN(tlenRtappendtrangetextend(Rtnewqueuettargetlabelst
targetcontentti((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyt
clumpContents=scCs:t|iddddjo|iddd}|dg}xtdt|D]}t}xtt|D]}||i||djp||i||djo>t||t||jo||||<nt}PqyqyW|p|i||qZqZW||iddd<ndS(sr Combines utterances by eliminating repeated utterances and
        utterances that are part of other utterances. iiRiiN(RRRtFalsetfindtTrueR(Rt
oldcontentt
newcontentR tfoundtj((s4/usr/lib/python2.6/site-packages/orca/liveregions.pytfilterContentsPs""
!	cCs
t|iS(s  Return the length of the queue (RR(R((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyt__len__fs(t__name__t
__module__t__doc__RRR
RRRR!R)R*(((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyRs								tLiveRegionManagercBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZddZdZdZdZRS(cCsv||_t|_g|_d|_d|_d|_t|_	|i
|ii|i
|ii|i
dS(N(t_scriptRt	msg_queuet	msg_cachetNonet_politenessOverridest_restoreOverridestlastliveobjR$t
monitoringtbookmarkLoadHandlert	bookmarkstaddSaveObservertbookmarkSaveHandlertaddLoadObserver(Rtscript((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyRls						
cCsqh}|iii}xI|iiD]8\}}|d|jp
|tjo|||<q(q(W||_dS(Ni(R/R8t	getURIKeyR3t	iteritemst	LIVE_NONE(Rt
newpolitenesst
currenturitkeytvalue((s4/usr/lib/python2.6/site-packages/orca/liveregions.pytresetscCs |iii|idddS(sBookmark save callbacktfilenamet
politenessN(R/R8tsaveBookmarksToDiskR3(R((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyR:scCs&|iiiddph|_dS(sBookmark load callbackRERFN(R/R8treadBookmarksFromDiskR3(R((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyR7scCs|i|i}|tjodS|tjo|ipdSnT|tjonC|tjo|iitn"|t	jo|iitn|i
|}|oJt|idjoti
d|in|ii|||indS(sMain live region event handlerNiid(t_getLiveTypetsourcetLIVE_OFFR?R6tLIVE_POLITEtLIVE_ASSERTIVER0Rt	LIVE_RUDEt_getMessageRtgobjectttimeout_addtpumpMessagesR(RteventRFtmessage((s4/usr/lib/python2.6/site-packages/orca/liveregions.pythandleEvents"


	


cCst|idjotiotitiidjo|ii|ii|ii	|ii
\}}}}|d|djo|d}n|d|d}ti|||_|i
|n|ip|iint|idjotStSdS(s Main gobject callback for live region support.  Handles both 
        purging the message queue and outputting any queued messages that
        were queued up in the handleEvent() method.
        iiRRN(RR0tspeecht
isSpeakingRt
orca_statetlastInputEventRR!R)R
tspeakR5t
_cacheMessageR6R$R"(RRFt	timestampRTR
tutts((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyRRs$



	
cCssg}|iii}xT|iD]I\}}||jo0t|to |i|iii|q"q"W|S(sXReturn the live objects that are registered and have a politeness
        of LIVE_NONE. (R/R8R=R3t
isinstancettupleRt	pathToObj(RtretvalRAturitobjectid((s4/usr/lib/python2.6/site-packages/orca/liveregions.pytgetLiveNoneObjectss
$cCs]g}|i|}|iii}y|i||f}Wn"tj
o|i|}nX|tjp
|tjo*t	|i||f<|i
tdn|t	jo*t|i||f<|i
tdno|tjo*t
|i||f<|i
tdn8|t
jo*t|i||f<|i
tdnti|dS(s0Advance the politeness level of the given objectssetting live region to polites setting live region to assertivessetting live region to rudessetting live region to offN(t_getObjectIdR/R8R=R3tKeyErrort_liveStringToTypeRKR?RLRRRMRNRVRZ(RR
t
utterancesRcRbtcur_priority((s4/usr/lib/python2.6/site-packages/orca/liveregions.pytadvancePolitenesss(


cCs]|ioO|ii|id|ii|i|ii|ii|idndS(s_Move the caret to the last announced live region and speak the 
        contents of that objectiN(R5R/tsetCaretPositiontoutlineAccessiblet
speakContentstgetObjectContentsAtOffset(R((s4/usr/lib/python2.6/site-packages/orca/liveregions.pytgoLastLiveRegions

cCsF|t|ijotitdnti|i|dS(s%Speak the given number cached messagesno live message savedN(RR1RVRZR(Rtmsgnum((s4/usr/lib/python2.6/site-packages/orca/liveregions.pytreviewLiveAnnouncement%sc	Cs)|ii}|iii}|iotitd|ii	t
i
|i|_x$|ii
D]}t|i|<qpWti||i}x0|D](}|i|}t|i||f<qWt|_nJx*|iiD]\}}||i|<qWtitdt|_dS(s]User toggle to set all live regions to LIVE_OFF or back to their
        original politeness.sAll live regions set to offs'live regions politeness levels restoredN(R/tgetDocumentFrameR8R=R6RVRZRR0RtcopyR3R4tkeysRKtpyatspitfindAllDescendantstmatchLiveRegionReR"R>R$(	RtdocframeRbtoverridetmatchestmatchRcRBRC((s4/usr/lib/python2.6/site-packages/orca/liveregions.pytsetLivePolitenessOff/s(


cKsA|i|}|iii}g}x|iD]}|i}|tijor|id}yI|i	i
dd}	|	i|iijo|i
|	nWqtj
oqXq4q4Wy&|i||f}
|i|
}Wntj
o
d}nX|p
|djo|i
td|n|S(snUsed in conjuction with whereAmI to output description and 
        politeness of the given live region objectiitnonespoliteness level %s(ReR/R8R=tgetRelationSettgetRelationTypeRutRELATION_DESCRIBED_BYt	getTargett	queryTexttgetTexttstriptdescriptionRtNotImplementedR3t_liveTypeToStringRfR(RR
targsRcRbtresultstrelationtrelationtypet	targetobjRtliveprioritytliveprioritystr((s4/usr/lib/python2.6/site-packages/orca/liveregions.pytgenerateLiveRegionDescription]s,

cCs|i|}d|jS(s$Predicate used to find a live regionscontainer-live(t_getAttrDictionary(RR
tattrs((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyRwsc	
Cs|i|i}g}g}|iidoyC|ddjo|ii|i}n|ii|i}Wn.ttfj
o|ii|i}nX|o|i	|qd
Sny|ii}Wntj
od
SX|i
dd}|i|iidjod
Sy9|ddjo
|}n||i|i|i!}Wn-tj
o!||i|i|i!}nXt|djo|i	|nd
S|i|i}d|jo7|ddjo&||}titi|d
Sh|d6|d	6Sd
S(s4Gets the message associated with a given live event.sobject:children-changed:addscontainer-atomicttrueiitchanneltnotifyRRN(RRJttypet
startswithR/t
expandEOCstany_dataRft	TypeErrorRR2RtNotImplementedErrorRtcounttEMBEDDED_OBJECT_CHARACTERtdetail1tdetail2Rt_getLabelsAsUtterancesRVtstopRZ(	RRSRRRR&tsourceitextttxtR]((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyROsH



cCs|iidS(N(R0R(R((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyt
flushMessagesscCs>|ii|t|itjo|iidndS(s6Cache a message in our cache list of length CACHE_SIZEiN(R1RRt
CACHE_SIZER(RR]((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyR[scCs#|ii|}|o|igS|itijo|iidjoy_|ii}|ii	|}|i
|}|i|d}|ii|igSWnt
j
onX|i|i}d|jo7|ddjo&|ii|iidigSngS(s!Get the labels for a given objectiittagtTR(R/tgetDisplayedLabelRtgetRoleRutROLE_TABLE_CELLtparentt
childCountt
queryTabletgetCellIndext
getRowAtIndextgetAccessibleAtRRRtgetChildAtIndex(RR
t	uttstringtitabletindextrowtheadertparentattrs((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyRs$	!cCs|i|}|iii}||f|ijo|i||fS|i|}|tjo!|io||i||f<n|SdS(sReturns the live politeness setting for a given object. Also,
        registers LIVE_NONE objects in politeness overrides when monitoring.N(ReR/R8R=R3RgR?R6(RR
RcRbtlivetype((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyRIscCsZ|i|}|djo|i|Sy|dSWntj
o|i|SXdS(sRReturns the HTML 'id' or a path to the object is an HTML id is
        unavailabletidN(RR2t_getPathRf(RR
R((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyRes
cCs|p
|i|}y`|ddjotS|ddjotS|ddjotS|ddjotStSWntj
otSXdS(s.Returns the politeness enum for a given objectscontainer-livetofftpolitet	assertivetrudeN(RRKRLRMRNR?Rf(RR
t
attributesR((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyRgscCsb|tjodS|tjodS|tjodS|tjodS|tjodSdSdS(s@Returns the politeness level as a string given a politeness enumRRRRR}tunknownN(RKRLRMRNR?(RRF((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyR.s




c
CsJy;tg}|iD]}||iddq~SWnhSXdS(Nt:i(tdictt
getAttributestsplit(RR
t_[1]tattr((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyR<s;cCs|ii}g}xq|idjp
||jo|it|Sy|i|iWntj
o
t	nX|i}qdS(s` Returns, as a tuple of integers, the path from the given object 
        to the document frame.N(
R/RrRR2treverseR_RtgetIndexInParentt	ExceptiontLookupError(RR
Rxtpath((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyRBs
N(R+R,RRDR:R7RURRRdRjRoRqR|RRwRORR[RRIReR2RgRRR(((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyR.ks.	 	
				0	
	&			
	.	)		J			$				(((RRPRXRuRVRsRt	orca_i18nRRKR?RLRMRNRRRR.(((s4/usr/lib/python2.6/site-packages/orca/liveregions.pyt<module>s R

Youez - 2016 - github.com/yon3zu
LinuXploit