projects
/
platform
/
core
/
uifw
/
at-spi2-atk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* Fixed bug #436949, Need util to list all supported interfaces
[platform/core/uifw/at-spi2-atk.git]
/
pyatspi
/
accessible.py
diff --git
a/pyatspi/accessible.py
b/pyatspi/accessible.py
index
803bdad
..
17f4916
100644
(file)
--- a/
pyatspi/accessible.py
+++ b/
pyatspi/accessible.py
@@
-162,9
+162,6
@@
def _makeQuery(iid):
self._icache[iid] = None
raise NotImplementedError
self._icache[iid] = None
raise NotImplementedError
- # not needed according to ORBit2 spec, but makes Java queries work
- # more reliably according to Orca experience
- i = i._narrow(i.__class__)
if caching:
# cache the narrow'ed result, but only if we're caching for this object
self._icache[iid] = i
if caching:
# cache the narrow'ed result, but only if we're caching for this object
self._icache[iid] = i
@@
-222,6
+219,8
@@
def _mixExceptions(cls):
@param cls: Class to mix interface methods into
@type cls: class
'''
@param cls: Class to mix interface methods into
@type cls: class
'''
+ # get a method type as a reference from a known method
+ method_type = Accessibility.Accessible.getRole.__class__
# loop over all names in the new class
for name in cls.__dict__.keys():
obj = cls.__dict__[name]
# loop over all names in the new class
for name in cls.__dict__.keys():
obj = cls.__dict__[name]
@@
-229,10
+228,10
@@
def _mixExceptions(cls):
if name.startswith('_'):
continue
# check if we're on a method
if name.startswith('_'):
continue
# check if we're on a method
- elif isinstance(obj,
types.FunctionT
ype):
+ elif isinstance(obj,
method_t
ype):
# wrap the function in an exception handler
method = _makeExceptionHandler(obj)
# wrap the function in an exception handler
method = _makeExceptionHandler(obj)
- # add the wrpped function to the class
+ # add the wr
a
pped function to the class
setattr(cls, name, method)
# check if we're on a property
elif isinstance(obj, property):
setattr(cls, name, method)
# check if we're on a property
elif isinstance(obj, property):
@@
-413,6
+412,13
@@
class _AccessibleMixin(object):
@return: Accessible child
@rtype: Accessibility.Accessible
'''
@return: Accessible child
@rtype: Accessibility.Accessible
'''
+ n = self.childCount
+ if index >= n:
+ raise IndexError
+ elif index < -n:
+ raise IndexError
+ elif index < 0:
+ index += n
return self.getChildAtIndex(index)
def __len__(self):
return self.getChildAtIndex(index)
def __len__(self):