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/pyatspi/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.6/site-packages/pyatspi/accessible.pyc
Ñò
1¡ÜJc@s×dZddkZddkZddkZddkZddkZddkZddkZddkZei	ƒZ
ei	ƒaea
dfd„ƒYZdfd„ƒYZd„Zd„Zd	„Zd
d„Zd„Zd
„Zd„Zd„Zd„Zd„Zgd„Zdefd„ƒYZdefd„ƒYZdefd„ƒYZeeei ƒeeei!gƒeei"edddgƒeei"ei ƒeei#eƒed„ei!ei#fƒdS(s¢
Creates functions at import time that are mixed into the 
Accessibility.Accessible base class to make it more Pythonic.

Based on public domain code originally posted at 
U{http://wwwx.cs.unc.edu/~parente/cgi-bin/RuntimeClassMixins}.

@var _ACCESSIBLE_CACHE: Pairs hash values for accessible objects to 
  L{_PropertyCache} bags. We do not store actual accessibles in the dictionary
  because that would +1 their ref counts and cause __del__ to never be called
  which is the method we rely on to properly invalidate cache entries.
@type _ACCESSIBLE_CACHE: dictionary
@var _CACHE_LEVEL: Current level of caching enabled. Checked dynamically by
  L{_AccessibleMixin}
@type _CACHE_LEVEL: integer

@author: Peter Parente
@organization: IBM Corporation
@copyright: Copyright (c) 2005, 2007 IBM Corporation
@license: LGPL

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Library General Public License for more details.

You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.

Portions of this code originally licensed and copyright (c) 2005, 2007
IBM Corporation under the BSD license, available at
U{http://www.opensource.org/licenses/bsd-license.php}
iÿÿÿÿNt_PropertyCachecBseZd„ZRS(cCs
h|_dS(N(t__dict__(tself((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pytwipe7s(t__name__t
__module__R(((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyR6st	_UserDatacBseZdZRS(N(RRtNonetvalue(((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyR:scCstS(s$
  Gets the current level of caching.
  
  @return: None indicating no caching is in effect. 
    L{constants.CACHE_INTERFACES} indicating all interface query results are
    cached. L{constants.CACHE_PROPERTIES} indicating all basic accessible
    properties are cached.
  @rtype: integer
  (t_CACHE_LEVEL(((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt
getCacheLevel=s
cCswt|jo`tiƒ|tijo#tiƒ}|itti	Œqmtiƒ}|i
tti	Œn|adS(s³
  Sets the desired level of caching for all accessible objects created after
  this function is invoked. Immediately clears the current accessible cache.
  
  @param val: None indicating no caching is in effect. 
    L{constants.CACHE_INTERFACES} indicating all interface query results are
    cached. L{constants.CACHE_PROPERTIES} indicating all basic accessible
    properties are cached plus all interfaces.
  @type val: integer
  N(R	t_ACCESSIBLE_CACHEtcleart	constantstCACHE_PROPERTIEStregistrytRegistrytregisterEventListenert_updateCachetCACHE_EVENTStderegisterEventListener(tvaltr((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt
setCacheLevelIs

cCstiƒdS(s#Forces a clear of the entire cache.N(RR(((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt
clearCacheass%scCs
|tGHdS(sy
  Prints the contents of the cache.
  
  @param template: Format string to use when printing
  @type template: string
  N(R(ttemplate((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt
printCacheescCs6ytt|iƒiƒWntj
odSXdS(sÖ
  Invalidates an entry in the cache when the hash value of a source of an event
  matches an entry in the cache.
  
  @param event: One of the L{constants.CACHE_EVENTS} event types
  @type event: L{event.Event}
  N(RthashtsourceRtKeyError(tevent((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyRnsc	CsÓttijo|ƒSt}t|ƒ}y
|i}WnStj
oGy||}Wn&tj
otƒ}|||<nX||_nXyt	||ƒ}Wn,tj
o |ƒ}t
|||ƒnX|S(s»
  If property caching is enabled, use the cached proprty, or get the 
  property and cache it. If property caching is disabled, simply get the 
  property.

  @param value_name: The name of the value, like 'role' or 'description'.
  @type value_name: string
  @param get_method: Method used to get the property, should not have any 
  arguments.
  @type get_method: callable
  @return: Value of property we are retrieving.
  @rtype: object
  (R	R
RRRt_property_cachetAttributeErrorRRtgetattrtsetattr(tacct
value_namet
get_methodtcachethtpcR((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt_getAndCache{s&
		cs‡fd†}|S(sæ
  Builds a function querying to a specific interface and returns it.
  
  @param interface: Class representing an AT-SPI interface
  @type interface: class
  @return: Function querying to the given interface
  @rtype: function
  c	s+tiˆƒ}y|i|}WnKtj
o
t}nOtj
o'tdj	}|o
h|_q‰nX|djo
t‚n|Sy3|i	|ƒ}|dj	o|i
ˆƒ}nWn!tj
o}t|ƒ‚nX|djo"|od|i|<nt‚n|o||i|<n|S(sÊ
    Queries an object for another interface.
  
    @return: An object with the desired interface
    @rtype: object
    @raise NotImplementedError: When the desired interface is not supported    
    N(
tutilstgetInterfaceIIDt_icacheRtTrueR R	RtNotImplementedErrortqueryInterfacet_narrowt	ExceptiontLookupError(Rtiidtitcachingte(t	interface(s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt_inner­s2





((R7R8((R7s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt
_makeQuery¤s	.cs‡fd†}|S(s±
  Builds a function calling the one it wraps in try/except statements catching
  CORBA exceptions.
  
  @return: Function calling the method being wrapped
  @rtype: function
  cshyˆ|||ŽSWnMtiij
o}t|ƒ‚n(tiij
o}t|ƒ‚nXdS(N(tORBittCORBAtNO_IMPLEMENTR.R1R2(RtargstkwargsR6(tfunc(s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyR8ås((R?R8((R?s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt_makeExceptionHandlerÝs
cCskxd|D]\}dti|ƒ}t|ƒ}ti|i|i||i|iƒ}t	|||ƒqWdS(s
  Add methods for querying to interfaces other than the base accessible to
  the given class.
  
  @param cls: Class to mix interface methods into
  @type cls: class
  @param interfaces: Classes representing AT-SPI interfaces
  @type interfaces: list of class
  squery%sN(
R*tgetInterfaceNameR9tnewtfunctiont	func_codetfunc_globalst
func_defaultstfunc_closureR"(tclst
interfacesR7tnameR?tmethod((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt_mixInterfacesñscCstiii}x|iiƒD]ñ}|i|}|idƒoqqt||ƒo t|ƒ}t	|||ƒqt|t
ƒo‡|io%t||ii
ƒ}t|ƒ}nd}|io%t||ii
ƒ}t|ƒ}nd}t	||t
||ƒƒqqWdS(s 
  Wraps all methods and properties in a class with handlers for CORBA 
  exceptions.
  
  @param cls: Class to mix interface methods into
  @type cls: class
  t_N(t
Accessibilityt
AccessibletgetRolet	__class__Rtkeyst
startswitht
isinstanceR@R"tpropertytfgetR!RRtfset(RHtmethod_typeRJtobjRKR?tgettertsetter((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt_mixExceptionss&	


cCs…x~|iiƒD]m\}}||joqnt|tiƒoxti|i|i||i	|i
ƒ}yt||ƒ}Wntj
onXt
|d||ƒt
|||ƒqt|tƒoQyt||ƒ}Wntj
onXt
|d||ƒt
|||ƒqt|tƒoQyt||ƒ}Wntj
onXt
|d||ƒt
|||ƒqqWdS(sœ
  Adds the methods in new_cls to cls. After mixing, all instances of cls will
  have the new methods. If there is a method name clash, the method already in
  cls will be prefixed with '_mix_' before the new method of the same name is 
  mixed in.
  
  @note: _ is not the prefix because if you wind up with __ in front of a 
  variable, it becomes private and mangled when an instance is created. 
  Difficult to invoke from the mixin class.

  @param cls: Existing class to mix features into
  @type cls: class
  @param new_cls: Class containing features to add
  @type new_cls: class
  @param ignore: Ignore these methods from the mixin
  @type ignore: iterable
  t_mix_N(RtitemsRTttypestFunctionTypeRBRCRDRERFRGR!R R"tstaticmethodRU(RHtnew_clstignoreRJR?RKt
old_methodtold_prop((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt	_mixClass,s6
t_AccessibleMixincBsïeZdZhZdZd„Zd„Zd„Zd„Zd„Z	d	„Z
d
„Zd„Zd„Z
eee
ƒZd
„ZeeeiiƒZd„ZeeƒZd„Zd„Zd„ZeeeiiƒZd„Zd„ZRS(s
  Defines methods to be added to the Accessibility.Accessible class. The
  features defined here will be added to the Accessible class at run time so
  that all instances of Accessible have them (i.e. there is no need to
  explicitly wrap an Accessible in this class or derive a new class from it.)
  
  @cvar SLOTTED_CLASSES: Mapping from raw Accessibility class to a new class
    having the slots defined by L{SLOTS}
  @type SLOTTED_CLASSES: dictionary
  @cvar SLOTS: All slots to create
  @type SLOTS: tuple
  R,Rt
_user_datacCssyti|}WnLtj
o@t|i|fh|id6tid6ƒ}|ti|<nX|i|ƒ}|S(s:
    Creates a new class mimicking the one requested, but with extra named 
    defined in __slots__. The _cache attribute is used internally for interface
    caching. The user_data field may be populated with whatever data structure
    a client wishes to use. Neither is set to a default value by default.
    
    Note that we can't simply mix __slots__ into this class because __slots__
    has an effect only at class creation time. 
    
    We also do not completely obliterate __slots__ to allow __dict__ to be
    instantiated as normal as reducing the initialization and memory overhead
    of the millions of accessible objects that are created is a good thing for
    many clients.
    
    @param cls: Accessibility object class
    @type cls: class
    @return: Instance of the new class
    @rtype: object
    Rt	__slots__(RgtSLOTTED_CLASSESRttypeRRtSLOTSt_mix___new__(RHRbRY((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt__new__zs
cCs(y|iƒWntj
onXdS(s
    
    Decrements the reference count on the accessible object when there are no
    Python references to this object. This provides automatic reference
    counting for AT-SPI objects. Also removes this object from the cache if
    we're caching properties. 
    N(tunrefR1(R((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt__del__šsccsKxDt|iƒD]3}y|i|ƒVWqtj
odVqXqWdS(sÉ
    Iterator that yields one accessible child per iteration. If an exception is
    encountered, None is yielded instead.
    
    @return: A child accessible
    @rtype: Accessibility.Accessible
    N(txranget
childCounttgetChildAtIndexR2R(RR4((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt__iter__¦scCs6yd|iƒ|ifSWntj
odSXdS(s“
    Gets a human readable representation of the accessible.
    
    @return: Role and name information for the accessible
    @rtype: string
    s	[%s | %s]s[DEAD]N(tgetRoleNameRJR1(R((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt__str__´scCstS(s3
    @return: True, always
    @rtype: boolean
    (R-(R((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt__nonzero__ÀscCs`|i}||jo
t‚n4||jo
t‚n|djo||7}n|i|ƒS(s¸
    Thin wrapper around getChildAtIndex.
    
    @param index: Index of desired child
    @type index: integer
    @return: Accessible child
    @rtype: Accessibility.Accessible
    i(Rrt
IndexErrorRs(Rtindextn((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt__getitem__Çs		



cCs|iS(sk
    Thin wrapper around childCount.
    
    @return: Number of child accessibles
    @rtype: integer
    (Rr(R((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt__len__ÙscCsvt|ƒ}y
|i}WnJtj
o>yt|}Wqftj
otƒ}|t|<qfXnX||_|iS(s‡
    Get user_data from global dictionay fo this accessible.

    @return: Any data the user assigned, or None.
    @rtype: object
    (RRhR t_ACCESSIBLE_USER_DATARRR(RR'tud((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt_get_user_dataâs
		cCs|t|ƒ}y
|i}WnJtj
o>yt|}Wqftj
otƒ}|t|<qfXnX||_||_dS(so
    Set arbitrary data to user_data.

    @param value: Value to set in user_data
    @type value: object
    N(RRhR R}RRR(RRR'R~((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt_set_user_dataùs
		cCst|d|iƒS(s­
    Gets the name of the accessible from the cache if it is available, 
    otherwise, fetches it remotely.
    
    @return: Name of the accessible
    @rtype: string
    RJ(R)t	_get_name(R((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyRscCst|d|iƒS(sÃ
    Gets the parent of the accessible from the cache if it is available, 
    otherwise, fetches it remotely.
    
    @return: Parent of the accessible
    @rtype: Accessibility.Accessible
    tparent(R)t_get_parent(R((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyRƒscCst|d|iƒS(sÃ
    Gets the unlocalized role name of the accessible from the cache if it is 
    available, otherwise, fetches it remotely.
    
    @return: Role name of the accessible
    @rtype: string
    trolename(R)t_mix_getRoleName(R((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyRu*scCst|d|iƒS(s¹
    Gets the role of the accessible from the cache if it is 
    available, otherwise, fetches it remotely.
    
    @return: Role of the accessible
    @rtype: Accessibility.Role
    trole(R)t_mix_getRole(R((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyRP4scCst|d|iƒS(s¾    
    Gets the description of the accessible from the cache if it is available,
    otherwise, fetches it remotely.
    
    @return: Description of the accessible
    @rtype: string
    tdescription(R)t_get_description(R((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyR‰>scCsB|iƒ}yt|iid|ƒSWntj
odSXdS(sh
    Gets the index of this accessible in its parent. Uses the implementation of
    this method provided by the Accessibility.Accessible object, but checks the
    bound of the value to ensure it is not outside the range of childCount 
    reported by this accessible's parent.
    
    @return: Index of this accessible in its parent
    @rtype: integer
    iiÿÿÿÿN(t_mix_getIndexInParenttminR‚RrR (RR4((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pytgetIndexInParentKs

cCsy|iƒ}Wntj
o
d}nX|o|S|}yPx/|idj	o|i|jo
|i}qDW|iƒ|itiƒSWndSXdS(s‰
    Gets the most-parent accessible (the application) of this
    accessible. Tries using the getApplication method introduced in
    AT-SPI 1.7.0 first before resorting to traversing parent links.
    
    @warning: Cycles involving more than the previously traversed accessible 
      are not detected by this code.
    @return: Application object
    @rtype: Accessibility.Application
    N(t_mix_getApplicationR RR‚trefR0RNtApplication(Rtapptcurr((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pytgetApplication]s!
(s_icaches_property_caches
_user_data(RRt__doc__RjRlRnRpRtRvRwR{R|RR€RUt	user_dataRRNROt	_set_nameRJRƒR‚RuRPR‰t_set_descriptionRˆRŒR’(((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyRgjs0	 										
	
	
	
	
	t_RelationMixincBseZdZd„ZRS(sq
  Defines methods to be added to the Relation class. At this time it only
  overrides L{_RelationMixin.getTarget} which by the IDL's standard is
  supposed to return CORBA.Objects but we expect LAccessibility.Accessible
  objects (see http://bugzilla.gnome.org/show_bug.cgi?id=435833). 
  This seems to be a problem especially with the Java implementation of CORBA.
  cCsF|i|ƒ}t|tiƒp|itiƒ}n|iƒ|S(s¯
    Overrides the regular getTarget to return Accessibility.Accessible
    objects.

    @return: The 'nth' target of this Relation.
    @rtype: Accessibility.Accessible
    (t_mix_getTargetRTRNROR0RŽ(RRyttarget((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt	getTarget‡s

(RRR“Rš(((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyR—st_UnrefMixincBseZdZd„ZRS(sO
  This mixin addresses the issue we have with unreferencing non-primitives.
  cCs(y|iƒWntj
onXdS(sO
    Unrefence the instance when Python GCs it. Why do we need this twice?
    N(RoR1(R((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyRp™s(RRR“Rp(((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyR›•sRR‰RƒcCs
t|tƒS((RfR›(RH((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt<lambda>®s($R“RBR_R:RNR
R*RtweakreftWeakValueDictionaryRR}RR	RRR
RRRRR)R9R@RLR\RftobjectRgR—R›tmaptALL_INTERFACEStStateSetROtRelation(((s6/usr/lib/python2.6/site-packages/pyatspi/accessible.pyt<module>(sH					
	)	9			%>ÿ	

Youez - 2016 - github.com/yon3zu
LinuXploit