* pyatspi/Makefile.am
Add missing files.
* pyatspi/*.py
Changes to event name translation and
equality checks neccessary to get orca to talk
using new pyatspi.
pyatspi_PYTHON = \
Accessibility.py \
accessible.py \
pyatspi_PYTHON = \
Accessibility.py \
accessible.py \
action.py \
application.py \
action.py \
application.py \
collection.py \
component.py \
constants.py \
collection.py \
component.py \
constants.py \
state.py \
streamablecontent.py \
table.py \
state.py \
streamablecontent.py \
table.py \
text.py \
utils.py \
value.py
text.py \
utils.py \
value.py
return '[DEAD]'
def __eq__(self, other):
return '[DEAD]'
def __eq__(self, other):
+ if other is None:
+ return False
+
if self._app_name == other._app_name and \
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
return True
else:
return False
'object:property-change:accessible-role',
'object:property-change:accessible-parent']
'object:property-change:accessible-role',
'object:property-change:accessible-parent']
# 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
# 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):
return self.getChildAtIndex(index)
def __eq__(self, other):
+ if other is None:
+ return False
+
if self._app_name == other._app_name and \
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
return True
else:
return False
else:
raise NotImplementedError(
"%s not supported by accessible object at path %s"
else:
raise NotImplementedError(
"%s not supported by accessible object at path %s"
- % (interface, self.path))
+ % (interface, self._acc_path))
#END----------------------------------------------------------------------------
#END----------------------------------------------------------------------------
self.minor = self._separated[2]
self.detail = self._separated[3]
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
def is_subtype(self, event_type):
"""
Determines if the passed event type is a subtype
@property
def name(self):
@property
def name(self):
@property
def value(self):
@property
def value(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,
class Event(object):
"""
Wraps an AT-SPI event with a more Pythonic interface managing exceptions,
self._source = None
self._application = None
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]
self.detail1 = event[1]
self.detail2 = event[2]