[pyatspi2] Remove some redundant event code
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pyatspi2] Remove some redundant event code
- Date: Sun, 2 May 2010 22:13:34 +0000 (UTC)
commit d1b99e255f12fa9337d44a707f4763ec38978d15
Author: Mike Gorse <mgorse novell com>
Date: Sun May 2 18:13:27 2010 -0400
Remove some redundant event code
pyatspi/accessible.py | 7 +------
pyatspi/appevent.py | 2 +-
pyatspi/cache.py | 2 --
pyatspi/registry.py | 22 ----------------------
4 files changed, 2 insertions(+), 31 deletions(-)
---
diff --git a/pyatspi/accessible.py b/pyatspi/accessible.py
index f13168e..0f968d8 100644
--- a/pyatspi/accessible.py
+++ b/pyatspi/accessible.py
@@ -507,12 +507,7 @@ class Accessible(BaseProxy):
try:
return self.extraData[name]
except (KeyError):
- r = registry.Registry()
- r.freezeEvents()
- try:
- self.extraData[name] = dbus.String(self._pgetter(interface, name))
- finally:
- r.thawEvents()
+ self.extraData[name] = dbus.String(self._pgetter(interface, name))
return self.extraData[name]
return dbus.String(self._pgetter(interface, name))
diff --git a/pyatspi/appevent.py b/pyatspi/appevent.py
index 4ebbba3..ff83dae 100644
--- a/pyatspi/appevent.py
+++ b/pyatspi/appevent.py
@@ -225,7 +225,7 @@ def event_type_to_signal_reciever(bus, factory, event_handler, event_type):
source)
depth = gobject.main_depth()
r = registry.Registry()
- if (r.asyncInternal() and depth > 1):
+ if (r.async):
r.enqueueEvent(event_handler, event)
else:
return event_handler(event)
diff --git a/pyatspi/cache.py b/pyatspi/cache.py
index 3f66de8..ec6418d 100644
--- a/pyatspi/cache.py
+++ b/pyatspi/cache.py
@@ -169,9 +169,7 @@ class ApplicationCacheManager (object):
cache_obj = bus.get_object (bus_name, _ATSPI_CACHE_PATH, introspect=False)
cache_itf = dbus.Interface (cache_obj, _ATSPI_CACHE_INTERFACE)
r = registry.Registry()
- r.freezeEvents()
self._add_objects(cache_itf.GetItems())
- r.thawEvents()
self._property_change = \
bus.add_signal_receiver(self._property_change_handler,
diff --git a/pyatspi/registry.py b/pyatspi/registry.py
index 6884876..7e80e80 100644
--- a/pyatspi/registry.py
+++ b/pyatspi/registry.py
@@ -125,7 +125,6 @@ class Registry(object):
"""
self.queue = Queue.Queue()
- self.frozen = 0
# Set up the cache
cache = None
@@ -353,27 +352,6 @@ class Registry(object):
"""
self.queue = Queue.QUeue()
- def asyncInternal (self):
- """
- Tests whether events should currently be delivered
- asynchronously
- """
- return self.async or self.frozen
-
- def freezeEvents (self):
- """
- Temporarily stop delivering events, queueing them until thaw() is called
- """
- self.frozen = self.frozen + 1
-
- def thawEvents (self):
- """
- Start delivering events again
- """
- self.frozen = self.frozen - 1
- if (self.frozen == 0):
- self.pumpQueuedEvents ()
-
# -------------------------------------------------------------------------------
def generateKeyboardEvent(self, keycode, keysym, kind):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]