'object:property-change:accessible-role',
'object:property-change:accessible-parent']
+CACHE_PROPERTIES = ""
+
# Dictionary used to correct the bug of not being able to register for all the
# subevents given only an AT-SPI event class (i.e. first part of the event
# name) keys are event names having subevents and values are the subevents
return self.getChildAtIndex(index)
def __eq__(self, other):
+ if other is None:
+ return False
+
if self._app_name == other._app_name and \
- self._acc_path == other._app_path:
+ self._acc_path == other._acc_path:
return True
else:
return False
else:
raise NotImplementedError(
"%s not supported by accessible object at path %s"
- % (interface, self.path))
+ % (interface, self._acc_path))
#END----------------------------------------------------------------------------
self.minor = self._separated[2]
self.detail = self._separated[3]
- self._name = ":".join(separated)
-
def is_subtype(self, event_type):
"""
Determines if the passed event type is a subtype
@property
def name(self):
- return self._name
+ return str(self)
@property
def value(self):
- return self._name
+ return str(self)
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
+def signal_spec_to_event_string (interface, name, minor):
+ interface = _interface_to_klass[interface]
+ name = name.replace('_', '-')
+
+ if interface == "focus":
+ return "focus:"
+
+ result = interface + ':'
+ if name:
+ result += name + ':'
+ if minor:
+ result += minor
+ return result
+
+#------------------------------------------------------------------------------
+
class Event(object):
"""
Wraps an AT-SPI event with a more Pythonic interface managing exceptions,
self._source = None
self._application = None
- self._klass = _interface_to_klass[interface]
- # The replace is neccessary as '-' not legal as signal name
- # so translated on the server side.
- self._major = name.replace('_', '-')
- self._minor = event[0]
- self.type = EventType(':'.join([self._klass, self._major, self._minor]))
+ self.type = EventType(signal_spec_to_event_string(interface, name, event[0]))
+
self.detail1 = event[1]
self.detail2 = event[2]