Hello community,
here is the log from the commit of package python-atspi for openSUSE:Factory
checked in at Wed Dec 30 00:29:21 CET 2009.
--------
--- python-atspi/python-atspi.changes 2009-12-02 19:37:16.000000000 +0100
+++ /mounts/work_src_done/STABLE/python-atspi/python-atspi.changes 2009-12-22 17:48:32.000000000 +0100
@@ -1,0 +2,40 @@
+Tue Dec 22 17:42:01 CET 2009 - vuntz@opensuse.org
+
+- Update to version 0.1.4:
+ + For a full list of changes, see
+ http://git.gnome.org/browse/pyatspi2/log/?id=PYATSPI_0_1_4
+ + Fix 100% CPU usage. The event dispatcher funtion was running
+ continuously.
+ + Addition of new 'Accessibility' D-Bus bus. The bus address is
+ located using X properties.
+ + Do not rely on cache for children of MANAGES_DESCENDANTS
+ objects
+ + Fixes to the Test desktop allowing the unit tests to be run in
+ non-cached mode.
+ + Fix the getAttributes method of the text api to return
+ semicolon delimited string as required by accerciser.
+ + Fix problem with children changed signal when adding or
+ removing applications.
+ + Change name of exception to new merged
+ AccessibleObjectNoLongerAvailable exception.
+ + Correct wrong method name in the 'Selection' interface.
+ + Remove reference to 'interfaces' module that was causing error
+ in orca test suite.
+ + Modify selection interface to use the new out-of-process
+ protocol for transferring accessible objects.
+ + Added collection support
+ + Perform type checking on Enumeration equality.
+ + Fix inconsistencies in Table interface introduced by
+ out-of-process and method name changes in the protocol.
+ + Fix get_application errors. A check was not made to see if the
+ application name was the Registry.
+ + Fix name errors in table.py - use of 'interfaces' module.
+ + Up the recursion limit. The '15' limit was met while running
+ the orca test suite.
+ + Fix name error in create_application method of the
+ CachedDesktop.
+ + Add a missing 'unref' function to the StateSet api. This
+ function does nothing and is needed for compatibility with the
+ CORBA class.
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
pyatspi-0.1.3.tar.bz2
New:
----
pyatspi-0.1.4.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-atspi.spec ++++++
--- /var/tmp/diff_new_pack.BMaj5g/_old 2009-12-30 00:29:07.000000000 +0100
+++ /var/tmp/diff_new_pack.BMaj5g/_new 2009-12-30 00:29:07.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package python-atspi (Version 0.1.3)
+# spec file for package python-atspi (Version 0.1.4)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,7 +19,7 @@
Name: python-atspi
%define _name pyatspi
-Version: 0.1.3
+Version: 0.1.4
Release: 1
Summary: Assistive Technology Service Provider Interface - Python bindings
License: LGPLv2.0
++++++ pyatspi-0.1.3.tar.bz2 -> pyatspi-0.1.4.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyatspi-0.1.3/configure new/pyatspi-0.1.4/configure
--- old/pyatspi-0.1.3/configure 2009-11-30 17:21:28.000000000 +0100
+++ new/pyatspi-0.1.4/configure 2009-12-18 17:28:18.000000000 +0100
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.64 for pyatspi 0.1.3.
+# Generated by GNU Autoconf 2.64 for pyatspi 0.1.4.
#
# Report bugs to .
#
@@ -698,8 +698,8 @@
# Identity of this package.
PACKAGE_NAME='pyatspi'
PACKAGE_TARNAME='pyatspi'
-PACKAGE_VERSION='0.1.3'
-PACKAGE_STRING='pyatspi 0.1.3'
+PACKAGE_VERSION='0.1.4'
+PACKAGE_STRING='pyatspi 0.1.4'
PACKAGE_BUGREPORT='accessibility-atspi@lists.linux-foundation.org'
PACKAGE_URL=''
@@ -1474,7 +1474,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures pyatspi 0.1.3 to adapt to many kinds of systems.
+\`configure' configures pyatspi 0.1.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1548,7 +1548,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of pyatspi 0.1.3:";;
+ short | recursive ) echo "Configuration of pyatspi 0.1.4:";;
esac
cat <<\_ACEOF
@@ -1676,7 +1676,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-pyatspi configure 0.1.3
+pyatspi configure 0.1.4
generated by GNU Autoconf 2.64
Copyright (C) 2009 Free Software Foundation, Inc.
@@ -1954,7 +1954,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by pyatspi $as_me 0.1.3, which was
+It was created by pyatspi $as_me 0.1.4, which was
generated by GNU Autoconf 2.64. Invocation command line was
$ $0 $@
@@ -2774,7 +2774,7 @@
# Define the identity of the package.
PACKAGE='pyatspi'
- VERSION='0.1.3'
+ VERSION='0.1.4'
cat >>confdefs.h <<_ACEOF
@@ -12784,7 +12784,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by pyatspi $as_me 0.1.3, which was
+This file was extended by pyatspi $as_me 0.1.4, which was
generated by GNU Autoconf 2.64. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -12848,7 +12848,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-pyatspi config.status 0.1.3
+pyatspi config.status 0.1.4
configured by $0, generated by GNU Autoconf 2.64,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyatspi-0.1.3/configure.ac new/pyatspi-0.1.4/configure.ac
--- old/pyatspi-0.1.3/configure.ac 2009-11-30 17:19:47.000000000 +0100
+++ new/pyatspi-0.1.4/configure.ac 2009-12-18 17:22:43.000000000 +0100
@@ -1,4 +1,4 @@
-AC_INIT([pyatspi], [0.1.3], [accessibility-atspi@lists.linux-foundation.org])
+AC_INIT([pyatspi], [0.1.4], [accessibility-atspi@lists.linux-foundation.org])
AC_CONFIG_AUX_DIR(config)
LT_RELEASE=$AT_SPI_MAJOR_VERSION.$AT_SPI_MINOR_VERSION
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyatspi-0.1.3/pyatspi/accessible.py new/pyatspi-0.1.4/pyatspi/accessible.py
--- old/pyatspi-0.1.3/pyatspi/accessible.py 2009-11-27 16:55:13.000000000 +0100
+++ new/pyatspi-0.1.4/pyatspi/accessible.py 2009-12-18 14:54:42.000000000 +0100
@@ -15,7 +15,8 @@
from interfaces import *
from enum import Enum
-from state import StateSet, _marshal_state_set
+from state import *
+from state import _marshal_state_set
from relation import _marshal_relation_set
from role import Role, ROLE_NAMES
@@ -222,8 +223,10 @@
if index >= count:
raise IndexError
func = self.get_dbus_method("GetChildAtIndex", dbus_interface=ATSPI_ACCESSIBLE)
- path = func (index)
- return self.acc_factory.create_accessible(self._app_name, path, ATSPI_ACCESSIBLE)
+ (name, path) = func (index)
+ if (name == ""):
+ name = self._app_name
+ return self.acc_factory.create_accessible(name, path, ATSPI_ACCESSIBLE)
def getLocalizedRoleName(self):
func = self.get_dbus_method("GetLocalizedRoleName", dbus_interface=ATSPI_ACCESSIBLE)
@@ -260,8 +263,9 @@
return self._pgetter(self.dbus_interface, "Name")
def get_parent(self):
+ name, path = self._pgetter (self.dbus_interface, "Parent")
return self.acc_factory.create_accessible(self._app_name,
- self._pgetter (self.dbus_interface, "Parent"),
+ path,
ATSPI_ACCESSIBLE)
def get_interfaces (self):
@@ -287,10 +291,17 @@
return self.cache(self.app_name, self.acc_path)
def getChildAtIndex(self, index):
- (name, path) = self.cached_data.children[index]
- if (name == ""):
- name = self._app_name
- return self.acc_factory.create_accessible(name, path, ATSPI_ACCESSIBLE)
+ if (self.cached_data.state[0] & (1 << STATE_MANAGES_DESCENDANTS)):
+ func = self.get_dbus_method("GetChildAtIndex", dbus_interface=ATSPI_ACCESSIBLE)
+ (name, path) = func (index)
+ if (name == ""):
+ name = self._app_name
+ return self.acc_factory.create_accessible(name, path, ATSPI_ACCESSIBLE)
+ else:
+ (name, path) = self.cached_data.children[index]
+ if (name == ""):
+ name = self._app_name
+ return self.acc_factory.create_accessible(name, path, ATSPI_ACCESSIBLE)
def getRelationSet(self):
if self._relation_set is not None:
@@ -321,7 +332,10 @@
return _marshal_state_set(self.cached_data.state)
def get_childCount(self):
- return len(self.cached_data.children)
+ if (self.cached_data.state[0] & (1 << STATE_MANAGES_DESCENDANTS)):
+ return Int32(self._pgetter(self.dbus_interface, "ChildCount"))
+ else:
+ return len(self.cached_data.children)
def get_description(self):
return self.cached_data.description
@@ -395,7 +409,7 @@
or raises a NotImplemented error if the given interface
is not supported.
"""
- if interface in self.interfaces:
+ if interface in self.interfaces or interface == "org.freedesktop.atspi.Collection":
return self.acc_factory.create_accessible(self.app_name,
self.acc_path,
interface,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyatspi-0.1.3/pyatspi/appevent.py new/pyatspi-0.1.4/pyatspi/appevent.py
--- old/pyatspi-0.1.3/pyatspi/appevent.py 2009-11-30 16:46:05.000000000 +0100
+++ new/pyatspi-0.1.4/pyatspi/appevent.py 2009-12-18 13:47:43.000000000 +0100
@@ -267,7 +267,7 @@
if not self._application:
try:
return self._acc_factory.create_application(self._source_application)
- except AccessibleObjectNotAvailable:
+ except AccessibleObjectNoLongerExists:
pass
return self._application
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyatspi-0.1.3/pyatspi/busutils/bus.py new/pyatspi-0.1.4/pyatspi/busutils/bus.py
--- old/pyatspi-0.1.3/pyatspi/busutils/bus.py 2009-11-30 16:46:05.000000000 +0100
+++ new/pyatspi-0.1.4/pyatspi/busutils/bus.py 2009-12-10 10:41:16.000000000 +0100
@@ -17,10 +17,34 @@
import dbus.bus as _bus
import dbus.connection as _connection
+import os as _os
+
import gobject
from proxy import AccessibilityProxy
+import sys
+import traceback
+
+def _get_accessibility_bus_address ():
+
+ from Xlib import display, Xatom
+
+ if "AT_SPI_DISPLAY" in _os.environ.keys():
+ dname = _os.environ["AT_SPI_DISPLAY"]
+ else:
+ dname = None
+
+ if dname:
+ d = display.Display(dname)
+ else:
+ d = display.Display()
+ a = d.get_atom ("AT_SPI_BUS")
+ s = d.screen().root
+ p = s.get_property (a, Xatom.STRING, 0, 100)
+
+ return p.value
+
class _AccessibilityBus (_bus.BusConnection):
"""
The bus used for accessibility
@@ -37,23 +61,24 @@
normal during signal delivery.
"""
- def __init__ (self):
- _bus.BusConnection.__init__(self, _bus.BusConnection.TYPE_SESSION, mainloop=None)
+ def __new__ (cls, address, mainloop):
+ return _bus.BusConnection.__new__(cls, address, mainloop)
+ def __init__ (self, address, mainloop):
+ _bus.BusConnection.__init__(self, address, mainloop)
self._signal_queue = _queue.Queue ()
- gobject.idle_add(self._event_dispatch)
-
def _event_dispatch (self):
while not self._signal_queue.empty():
(func, args, kwargs) = self._signal_queue.get (False)
func (*args, **kwargs)
- return True
+ return False
def add_signal_receiver (self, func, *args, **kwargs):
def wrapper (*iargs, **ikwargs):
self._signal_queue.put ((func, iargs, ikwargs))
+ gobject.idle_add(self._event_dispatch)
return _bus.BusConnection.add_signal_receiver (self, wrapper, *args, **kwargs)
@@ -73,5 +98,15 @@
if AccessibilityBus._shared_instance:
return AccessibilityBus._shared_instance
else:
- AccessibilityBus._shared_instance = _AccessibilityBus.__new__ (cls)
+ try:
+ AccessibilityBus._shared_instance = _AccessibilityBus.__new__ (cls, _get_accessibility_bus_address(), None)
+ except Exception:
+ AccessibilityBus._shared_instance = _AccessibilityBus.__new__ (cls, _bus.BusConnection.TYPE_SESSION, None)
+
return AccessibilityBus._shared_instance
+
+ def __init__ (self):
+ try:
+ _AccessibilityBus.__init__ (self, _get_accessibility_bus_address(), None)
+ except Exception:
+ _AccessibilityBus.__init__ (self, _bus.BusConnection.TYPE_SESSION, None)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyatspi-0.1.3/pyatspi/busutils/proxy.py new/pyatspi-0.1.4/pyatspi/busutils/proxy.py
--- old/pyatspi-0.1.3/pyatspi/busutils/proxy.py 2009-11-30 16:46:05.000000000 +0100
+++ new/pyatspi-0.1.4/pyatspi/busutils/proxy.py 2009-12-18 16:31:28.000000000 +0100
@@ -14,12 +14,11 @@
import dbus.connection as _connection
import gobject
-import gtk
import Queue
class _MainLoopPool (Queue.Queue):
- _RE_ENTRANCY_LIMIT = 15
+ _RE_ENTRANCY_LIMIT = 100
def __init__ (self):
Queue.Queue.__init__(self)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyatspi-0.1.3/pyatspi/cache.py new/pyatspi-0.1.4/pyatspi/cache.py
--- old/pyatspi-0.1.3/pyatspi/cache.py 2009-11-30 16:49:22.000000000 +0100
+++ new/pyatspi-0.1.4/pyatspi/cache.py 2009-12-10 13:17:48.000000000 +0100
@@ -138,26 +138,17 @@
self._application_list.append(bus_name)
self._application_cache[bus_name] = AccessibleCache(self._event_dispatcher,
bus_name)
- event = Event(("add", 0, 0, ""),
- self._factory,
- ATSPI_DESKTOP_PATH,
- ATSPI_REGISTRY_NAME,
- "org.freedesktop.atspi.Event.Object",
- "children-changed")
+ self._event_dispatcher.notifyChildrenChange(ATSPI_REGISTRY_NAME,
+ ATSPI_DESKTOP_PATH,
+ True)
elif update_type == ApplicationCache._APPLICATIONS_REMOVE:
#TODO Fail safely if app does not exist
self._application_list.remove(bus_name)
del(self._application_cache[bus_name])
- event = Event(("remove", 0, 0, ""),
- self._factory,
- ATSPI_DESKTOP_PATH,
- ATSPI_REGISTRY_NAME,
- "org.freedesktop.atspi.Event.Object",
- "children-changed")
-
-
- self._event_dispatcher.notifyChildrenChange(event)
+ self._event_dispatcher.notifyChildrenChange(ATSPI_REGISTRY_NAME,
+ ATSPI_DESKTOP_PATH,
+ False)
def _refresh(self):
new = self._app_register.getApplications()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyatspi-0.1.3/pyatspi/collection.py new/pyatspi-0.1.4/pyatspi/collection.py
--- old/pyatspi-0.1.3/pyatspi/collection.py 2009-11-25 13:27:58.000000000 +0100
+++ new/pyatspi-0.1.4/pyatspi/collection.py 2009-12-18 14:54:42.000000000 +0100
@@ -16,51 +16,49 @@
from enum import Enum
from accessible import Accessible
+from dbus.types import UInt32
+
__all__ = [
- "Collection",
+ "Collection",
+ "MatchRule",
+ "SortOrder",
+ "MatchType",
+ "TreeTraversalType",
]
#------------------------------------------------------------------------------
-class Collection(Accessible):
-
- def createMatchRule(self, *args, **kwargs):
- func = self.get_dbus_method("CreateMatchRule", dbus_interface=ATSPI_COLLECTION)
- return func(*args, **kwargs)
-
- def freeMatchRule(self, *args, **kwargs):
- func = self.get_dbus_method("FreeMatchRule", dbus_interface=ATSPI_COLLECTION)
- return func(*args, **kwargs)
-
- def getActiveDescendant(self, *args, **kwargs):
- func = self.get_dbus_method("GetActiveDescendant", dbus_interface=ATSPI_COLLECTION)
- return func(*args, **kwargs)
-
- def getMatches(self, *args, **kwargs):
- func = self.get_dbus_method("GetMatches", dbus_interface=ATSPI_COLLECTION)
- return func(*args, **kwargs)
-
- def getMatchesFrom(self, *args, **kwargs):
- func = self.get_dbus_method("GetMatchesFrom", dbus_interface=ATSPI_COLLECTION)
- return func(*args, **kwargs)
+class MatchType(Enum):
+ _enum_lookup = {
+ 0:'MATCH_INVALID',
+ 1:'MATCH_ALL',
+ 2:'MATCH_ANY',
+ 3:'MATCH_NONE',
+ 4:'MATCH_EMPTY',
+ 5:'MATCH_LAST_DEFINED',
+ }
+
+class SortOrder(Enum):
+ _enum_lookup = {
+ 0:'SORT_ORDER_INVALID',
+ 1:'SORT_ORDER_CANONICAL',
+ 2:'SORT_ORDER_FLOW',
+ 3:'SORT_ORDER_TAB',
+ 4:'SORT_ORDER_REVERSE_CANONICAL',
+ 5:'SORT_ORDER_REVERSE_FLOW',
+ 6:'SORT_ORDER_REVERSE_TAB',
+ 7:'SORT_ORDER_LAST_DEFINED',
+ }
+
+class TreeTraversalType(Enum):
+ _enum_lookup = {
+ 0:'TREE_RESTRICT_CHILDREN',
+ 1:'TREE_RESTRICT_SIBLING',
+ 2:'TREE_INORDER',
+ 3:'TREE_LAST_DEFINED',
+ }
- def getMatchesTo(self, *args, **kwargs):
- func = self.get_dbus_method("GetMatchesTo", dbus_interface=ATSPI_COLLECTION)
- return func(*args, **kwargs)
-
- def isAncestorOf(self, *args, **kwargs):
- func = self.get_dbus_method("IsAncestorOf", dbus_interface=ATSPI_COLLECTION)
- return func(*args, **kwargs)
-
- class MatchType(Enum):
- _enum_lookup = {
- 0:'MATCH_INVALID',
- 1:'MATCH_ALL',
- 2:'MATCH_ANY',
- 3:'MATCH_NONE',
- 4:'MATCH_EMPTY',
- 5:'MATCH_LAST_DEFINED',
- }
+class Collection(Accessible):
MATCH_ALL = MatchType(1)
MATCH_ANY = MatchType(2)
@@ -69,18 +67,6 @@
MATCH_LAST_DEFINED = MatchType(5)
MATCH_NONE = MatchType(3)
- class SortOrder(Enum):
- _enum_lookup = {
- 0:'SORT_ORDER_INVALID',
- 1:'SORT_ORDER_CANONICAL',
- 2:'SORT_ORDER_FLOW',
- 3:'SORT_ORDER_TAB',
- 4:'SORT_ORDER_REVERSE_CANONICAL',
- 5:'SORT_ORDER_REVERSE_FLOW',
- 6:'SORT_ORDER_REVERSE_TAB',
- 7:'SORT_ORDER_LAST_DEFINED',
- }
-
SORT_ORDER_CANONICAL = SortOrder(1)
SORT_ORDER_FLOW = SortOrder(2)
SORT_ORDER_INVALID = SortOrder(0)
@@ -90,17 +76,105 @@
SORT_ORDER_REVERSE_TAB = SortOrder(6)
SORT_ORDER_TAB = SortOrder(3)
- class TreeTraversalType(Enum):
- _enum_lookup = {
- 0:'TREE_RESTRICT_CHILDREN',
- 1:'TREE_RESTRICT_SIBLING',
- 2:'TREE_INORDER',
- 3:'TREE_LAST_DEFINED',
- }
-
TREE_INORDER = TreeTraversalType(2)
TREE_LAST_DEFINED = TreeTraversalType(3)
TREE_RESTRICT_CHILDREN = TreeTraversalType(0)
TREE_RESTRICT_SIBLING = TreeTraversalType(1)
+ def isAncestorOf(self, object):
+ print "isAncestorOf unimplemented"
+ return False
+
+ def createMatchRule(self, states, stateMatchType, attributes, attributeMatchType, roles, roleMatchType, interfaces, interfaceMatchType, invert):
+ attributes_rule = str.join("\n", attributes)
+ roles_rule = [0, 0, 0, 0]
+ for role in roles:
+ roles_rule[role/32] |= (1<<(role%32))
+ for i in range(0,4):
+ roles_rule[i] = int(roles_rule[i])
+ return MatchRule(states, stateMatchType, attributes_rule, attributeMatchType, roles_rule, roleMatchType, interfaces, interfaceMatchType, invert)
+
+ def freeMatchRule(self, rule):
+ pass
+
+ def getAccessibles(self, ret):
+ for i in range(0, len(ret)):
+ (name, path) = ret[i]
+ if (name == ""):
+ name = self._app_name
+ ret[i] = self.acc_factory.create_accessible(name, path,
+ ATSPI_ACCESSIBLE)
+ return ret;
+
+ def getMatches(self, rule, sortby, count, traverse):
+ func = self.get_dbus_method("GetMatches", dbus_interface=ATSPI_COLLECTION)
+ ret = func(rule, sortby, count, traverse)
+ return self.getAccessibles (ret)
+
+ def getMatchesTo(self, current_object, rule, sortby, tree, recurse, count, traverse):
+ func = self.get_dbus_method("GetMatchesTo", dbus_interface=ATSPI_COLLECTION)
+ ret = func(current_object._acc_path, rule, sortby, tree, recurse, count, traverse)
+ return self.getAccessibles (ret)
+
+ def getMatchesFrom(self, current_object, rule, sortby, tree, count, traverse):
+ func = self.get_dbus_method("GetMatchesFrom", dbus_interface=ATSPI_COLLECTION)
+ ret = func(current_object._acc_path, rule, sortby, tree, count, traverse)
+ return self.getAccessibles (ret)
+
+ def getActiveDescendant(self):
+ print "getActiveDescendant unimplemented"
+ return
+
+class MatchRule(tuple):
+ def __new__(cls, states, stateMatchType, attributes, attributeMatchType, roles, roleMatchType, interfaces, interfaceMatchType, invert):
+ return tuple.__new__(cls, (states, int(stateMatchType), attributes, int(attributeMatchType), roles, int(roleMatchType), interfaces, int(interfaceMatchType), invert))
+ #def __init__(self, states, stateMatchType, attributes, attributeMatchType, roles, roleMatchType, interfaces, interfaceMatchType, invert):
+ #tuple.__init__(self, (states, int(stateMatchType), attributes, int(attributeMatchType), roles, int(roleMatchType), interfaces, int(interfaceMatchType), invert))
+
+ def _get_states(self):
+ return self[0]
+ def _set_states(self, val):
+ self[0] = val
+ states = property(fget=_get_states, fset=_set_states)
+ def _get_stateMatchType(self):
+ return self[1]
+ def _set_stateMatchType(self, val):
+ self[1] = val
+ stateMatchType = property(fget=_get_stateMatchType, fset=_set_stateMatchType)
+ def _get_attributes(self):
+ return self[2]
+ def _set_attributes(self, val):
+ self[2] = val
+ attributes = property(fget=_get_attributes, fset=_set_attributes)
+ def _get_attributeMatchType(self):
+ return self[3]
+ def _set_attributeMatchType(self, val):
+ self[3] = val
+ attributeMatchType = property(fget=_get_attributeMatchType, fset=_set_attributeMatchType)
+ def _get_roles(self):
+ return self[4]
+ def _set_roles(self, val):
+ self[4] = val
+ roles = property(fget=_get_roles, fset=_set_roles)
+ def _get_roleMatchType(self):
+ return self[5]
+ def _set_roleMatchType(self, val):
+ self[5] = val
+ roleMatchType = property(fget=_get_roleMatchType, fset=_set_roleMatchType)
+ def _get_interfaces(self):
+ return self[6]
+ def _set_interfaces(self, val):
+ self[6] = val
+ interfaces = property(fget=_get_interfaces, fset=_set_interfaces)
+ def _get_interfaceMatchType(self):
+ return self[7]
+ def _set_interfaceMatchType(self, val):
+ self[7] = val
+ interfaceMatchType = property(fget=_get_interfaceMatchType, fset=_set_interfaceMatchType)
+ def _get_invert(self):
+ return self[8]
+ def _set_invert(self, val):
+ self[8] = val
+ invert = property(fget=_get_invert, fset=_set_invert)
+
#END----------------------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyatspi-0.1.3/pyatspi/desktop.py new/pyatspi-0.1.4/pyatspi/desktop.py
--- old/pyatspi-0.1.3/pyatspi/desktop.py 2009-11-30 16:46:05.000000000 +0100
+++ new/pyatspi-0.1.4/pyatspi/desktop.py 2009-12-18 15:18:08.000000000 +0100
@@ -413,22 +413,26 @@
_TREE_PATH = '/org/freedesktop/atspi/tree'
_TREE_INTERFACE = 'org.freedesktop.atspi.Tree'
- def __init__(self, app_name):
- Accessible.__init__(self, *args);
+ def __init__(self, app_name, factory):
+ BaseDesktop.__init__(self, factory);
obj = AccessibilityBus().get_object (app_name,
self._TREE_PATH)
tree = dbus.Interface (obj, self._TREE_INTERFACE)
self._single_app = app_name
- self._root = self.tree.getRoot ()
+ self._root = tree.GetRoot ()
def getChildAtIndex(self, index):
- return self.create_application (self._root)
+ #TODO - Check index
+ return self._acc_factory.create_accessible (self._single_app,
+ self._root,
+ interfaces.ATSPI_APPLICATION)
def create_application (self, app_name):
- return self.acc_factory.create_accessible (app_name,
- self._root,
- interfaces.ATSPI_APPLICATION)
+ #TODO - Check name
+ return self._acc_factory.create_accessible (self._single_app,
+ self._root,
+ interfaces.ATSPI_APPLICATION)
def get_childCount(self):
return 1
@@ -445,32 +449,30 @@
_TREE_PATH = '/org/freedesktop/atspi/tree'
_TREE_INTERFACE = 'org.freedesktop.atspi.Tree'
- def __init__(self, connection, *args):
+ def __init__(self, *args):
BaseDesktop.__init__(self, *args);
- self._connection = connection
- obj = connection.get_object(interfaces.ATSPI_REGISTRY_NAME,
- interfaces.ATSPI_REGISTRY_PATH,
- introspect=False)
+ self._connection = AccessibilityBus()
+ obj = self._connection.get_object(interfaces.ATSPI_REGISTRY_NAME,
+ interfaces.ATSPI_REGISTRY_PATH)
self._app_register = dbus.Interface(obj, interfaces.ATSPI_REGISTRY_INTERFACE)
def create_application (self, app_name):
obj = self._connection.get_object (app_name,
- self._TREE_PATH,
- introspect=False)
+ self._TREE_PATH)
tree = dbus.Interface (obj, self._TREE_INTERFACE)
- root = tree.getRoot ()
+ root = tree.GetRoot ()
return self.acc_factory.create_accessible (app_name,
root,
interfaces.ATSPI_APPLICATION)
def getChildAtIndex(self, index):
- applications = self._app_register.getApplications()
+ applications = self._app_register.GetApplications()
return self.acc_factory.create_application(applications[index])
def get_childCount(self):
- applications = self._app_register.getApplications()
+ applications = self._app_register.GetApplications()
return len (applications)
#------------------------------------------------------------------------------
@@ -485,7 +487,10 @@
self.cache = cache
def create_application (self, app_name):
- acc_path = self.cache.get_app_root(app_name)
+ if app_name == interfaces.ATSPI_REGISTRY_NAME:
+ acc_path = interfaces.ATSPI_DESKTOP_PATH
+ else:
+ acc_path = self.cache.get_app_root(app_name)
return self.acc_factory.create_accessible (app_name,
acc_path,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyatspi-0.1.3/pyatspi/enum.py new/pyatspi-0.1.4/pyatspi/enum.py
--- old/pyatspi-0.1.3/pyatspi/enum.py 2009-11-17 19:29:23.000000000 +0100
+++ new/pyatspi-0.1.4/pyatspi/enum.py 2009-12-18 14:56:57.000000000 +0100
@@ -27,9 +27,12 @@
def __eq__(self, other):
if other is None:
return False
- if int(self) == int(other):
- return True
- else:
+ try:
+ if int(self) == int(other):
+ return True
+ else:
+ return False
+ except ValueError:
return False
def __hash__(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyatspi-0.1.3/pyatspi/selection.py new/pyatspi-0.1.4/pyatspi/selection.py
--- old/pyatspi-0.1.3/pyatspi/selection.py 2009-11-25 13:27:58.000000000 +0100
+++ new/pyatspi-0.1.4/pyatspi/selection.py 2009-12-18 14:20:55.000000000 +0100
@@ -81,9 +81,12 @@
@return a pointer to a selected Accessible child object, specified
by selectedChildIndex.
"""
- func = self.get_dbus_method("getSelectedChild", dbus_interface=ATSPI_SELECTION)
- return self.acc_factory.create_accessible(self._app_name, func(index),
- interfaces.ATSPI_ACCESSIBLE)
+ func = self.get_dbus_method("GetSelectedChild", dbus_interface=ATSPI_SELECTION)
+ (name, path) = func (index)
+ if (name == ""):
+ name = self._app_name
+ return self.acc_factory.create_accessible(name, path,
+ ATSPI_ACCESSIBLE)
def isChildSelected(self, index):
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyatspi-0.1.3/pyatspi/state.py new/pyatspi-0.1.4/pyatspi/state.py
--- old/pyatspi-0.1.3/pyatspi/state.py 2009-11-17 19:29:23.000000000 +0100
+++ new/pyatspi-0.1.4/pyatspi/state.py 2009-12-18 16:27:40.000000000 +0100
@@ -253,4 +253,23 @@
"""
return list(self.states)
+ def raw(self):
+ """
+ Gets the sequence of all states in this set as a pair of
+ 32-bit flags, suitable for transmitting via dbus..
+
+ @return: List of two 32-bit flags representing the states
+ @rtype: list
+ """
+ lower = upper = 0
+ for i in range (0, 32):
+ if (self.contains(i)):
+ lower |= (1 << i)
+ for i in range (32, 64):
+ if (self.contains(i)):
+ upper |= (1 << (i - 32))
+ return [lower, upper]
+
+ def unref(self):
+ pass
#END----------------------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyatspi-0.1.3/pyatspi/table.py new/pyatspi-0.1.4/pyatspi/table.py
--- old/pyatspi-0.1.3/pyatspi/table.py 2009-11-25 13:27:58.000000000 +0100
+++ new/pyatspi-0.1.4/pyatspi/table.py 2009-12-18 15:07:48.000000000 +0100
@@ -71,12 +71,12 @@
@return an Accessible object representing the specified table
cell.
"""
- func = self.get_dbus_method("getAccessibleAt", dbus_interface=ATSPI_TABLE)
+ func = self.get_dbus_method("GetAccessibleAt", dbus_interface=ATSPI_TABLE)
(name, path) = func(row, column)
if (name == ""):
name = self._app_name
return self.acc_factory.create_accessible(name, path,
- interfaces.ATSPI_ACCESSIBLE)
+ ATSPI_ACCESSIBLE)
def getColumnAtIndex(self, index):
"""
@@ -127,9 +127,9 @@
@return an Accessible representatin of the specified table column,
if available.
"""
- func = self.get_dbus_method("getColumnHeader", dbus_interface=ATSPI_TABLE)
+ func = self.get_dbus_method("GetColumnHeader", dbus_interface=ATSPI_TABLE)
return self.acc_factory.create_accessible(self._app_name, func(index),
- interfaces.ATSPI_ACCESSIBLE)
+ ATSPI_ACCESSIBLE)
def getIndexAt(self, row, column):
"""
@@ -232,9 +232,12 @@
@return an Accessible representatin of the specified table row,
if available.
"""
- func = self.get_dbus_method("getRowHeader", dbus_interface=ATSPI_TABLE)
- return self.acc_factory.create_accessible(self._app_name, func(row),
- interfaces.ATSPI_ACCESSIBLE)
+ func = self.get_dbus_method("GetRowHeader", dbus_interface=ATSPI_TABLE)
+ (name, path) = func (row)
+ if (name == ""):
+ name = self._app_name
+ return self.acc_factory.create_accessible(name, path,
+ ATSPI_ACCESSIBLE)
def getSelectedColumns(self):
"""
@@ -316,7 +319,7 @@
if (name == ""):
name = self._app_name
return self.acc_factory.create_accessible(name, path,
- interfaces.ATSPI_ACCESSIBLE)
+ ATSPI_ACCESSIBLE)
_captionDoc = \
"""
An Accessible which represents of a caption for a Table.
@@ -367,7 +370,7 @@
if (name == ""):
name = self._app_name
return self.acc_factory.create_accessible(name, path,
- interfaces.ATSPI_ACCESSIBLE)
+ ATSPI_ACCESSIBLE)
_summaryDoc = \
"""
An accessible object which summarizes the contents of a Table.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyatspi-0.1.3/pyatspi/text.py new/pyatspi-0.1.4/pyatspi/text.py
--- old/pyatspi-0.1.3/pyatspi/text.py 2009-11-25 13:27:58.000000000 +0100
+++ new/pyatspi-0.1.4/pyatspi/text.py 2009-12-10 11:44:19.000000000 +0100
@@ -202,8 +202,9 @@
"""
func = self.get_dbus_method("GetAttributes", dbus_interface=ATSPI_TEXT)
[attrs, startOffset, endOffset] = func(Int32(offset))
- dict = [key + ':' + attrs[key] for key in attrs]
- return [dict, startOffset, endOffset]
+ arr = [key + ':' + value for key, value in attrs.items()]
+ str = ';'.join (arr)
+ return [str, startOffset, endOffset]
def getBoundedRanges(self, x, y, width, height, coordType, xClipType, yClipType):
#TODO Return a list of range structures
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyatspi-0.1.3/tests/apps/test-application.c new/pyatspi-0.1.4/tests/apps/test-application.c
--- old/pyatspi-0.1.3/tests/apps/test-application.c 2009-11-25 13:27:58.000000000 +0100
+++ new/pyatspi-0.1.4/tests/apps/test-application.c 2009-12-08 23:29:54.000000000 +0100
@@ -250,7 +250,7 @@
{"test-module", 0, 0, G_OPTION_ARG_STRING, &tmodule_path, "Module containing test scenario", NULL},
{"test-atspi-library", 0, 0, G_OPTION_ARG_STRING, &amodule_path, "Gtk module with atk-atspi adaptor", NULL},
{"test-data-directory", 0, 0, G_OPTION_ARG_STRING, &tdata_path, "Path to directory of test data", NULL},
- {"atspi-dbus-name", 0, 0, G_OPTION_ARG_STRING, &bus_name, "Bus name", NULL},
+ {"test-dbus-name", 0, 0, G_OPTION_ARG_STRING, &bus_name, "Bus name", NULL},
{NULL}
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyatspi-0.1.3/tests/pyatspi/runtests.sh new/pyatspi-0.1.4/tests/pyatspi/runtests.sh
--- old/pyatspi-0.1.3/tests/pyatspi/runtests.sh 2009-11-17 19:29:23.000000000 +0100
+++ new/pyatspi-0.1.4/tests/pyatspi/runtests.sh 2009-12-18 14:54:42.000000000 +0100
@@ -7,6 +7,7 @@
$PYTHON $top_srcdir/tests/pyatspi/testrunner -l libaccessibleapp.so -m accessibletest -n AccessibleTest
$PYTHON $top_srcdir/tests/pyatspi/testrunner -l libactionapp.so -m actiontest -n ActionTest
+$PYTHON $top_srcdir/tests/pyatspi/testrunner -l libaccessibleapp.so -m collectiontest -n AccessibleTest
$PYTHON $top_srcdir/tests/pyatspi/testrunner -l libcomponentapp.so -m componenttest -n ComponentTest
$PYTHON $top_srcdir/tests/pyatspi/testrunner -l librelationapp.so -m relationtest -n RelationTest
$PYTHON $top_srcdir/tests/pyatspi/testrunner -l libaccessibleapp.so -m statetest -n StateTest
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyatspi-0.1.3/tests/pyatspi/testrunner new/pyatspi-0.1.4/tests/pyatspi/testrunner
--- old/pyatspi-0.1.3/tests/pyatspi/testrunner 2009-11-17 19:29:24.000000000 +0100
+++ new/pyatspi-0.1.4/tests/pyatspi/testrunner 2009-12-08 23:31:55.000000000 +0100
@@ -28,11 +28,15 @@
if (dbus_name):
print " ".join([test_application,
"--atspi-dbus-name", dbus_name,
+ "--atspi-no-register",
+ "--test-dbus-name", dbus_name,
"--test-atspi-library", test_atspi_library,
"--test-module", test_module,
"--test-data-directory", test_data_directory,])
pop = Popen([test_application,
"--atspi-dbus-name", dbus_name,
+ "--atspi-no-register",
+ "--test-dbus-name", dbus_name,
"--test-atspi-library", test_atspi_library,
"--test-module", test_module,
"--test-data-directory", test_data_directory,])
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org