From: Mark Doffman Date: Thu, 4 Dec 2008 20:16:13 +0000 (+0000) Subject: 2008-12-04 Mark Doffman X-Git-Tag: AT_SPI2_CORE_0_1_3~111 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ecbf94bc333c4d5f05dbb4d2020c8ecd4211b33;p=platform%2Fupstream%2Fat-spi2-core.git 2008-12-04 Mark Doffman * pyatspi/accessible.py * pyatspi/accessiblecache.py Modify the cache adding a stateset. Modify the getState function to use the cached values. --- diff --git a/pyatspi/accessible.py b/pyatspi/accessible.py index c9323a80..e86b73bd 100644 --- a/pyatspi/accessible.py +++ b/pyatspi/accessible.py @@ -207,9 +207,7 @@ class Accessible(BaseProxy): @return : a StateSet encapsulating the currently true states of the object. """ - func = self.get_dbus_method("getState", dbus_interface=ATSPI_ACCESSIBLE) - bitfield = func() - return _marshal_state_set(bitfield) + return _marshal_state_set(self.cached_data.state) def isEqual(self, accessible): """ diff --git a/pyatspi/accessiblecache.py b/pyatspi/accessiblecache.py index 15a3353c..fd35b857 100644 --- a/pyatspi/accessiblecache.py +++ b/pyatspi/accessiblecache.py @@ -26,6 +26,7 @@ class _CacheData(object): 'role', 'name', 'description', + 'state', ] def __init__(self, data): @@ -39,7 +40,8 @@ class _CacheData(object): self.interfaces, self.name, self.role, - self.description) = data + self.description, + self.state) = data #------------------------------------------------------------------------------