[pyatspi2/p2p: 7/8] Do not reinitialize shared bus instances
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pyatspi2/p2p: 7/8] Do not reinitialize shared bus instances
- Date: Fri, 1 Oct 2010 23:44:17 +0000 (UTC)
commit 2bad2c9e821fddf73506459844df568210b51a96
Author: Mike Gorse <mgorse novell com>
Date: Fri Oct 1 18:15:19 2010 -0400
Do not reinitialize shared bus instances
pyatspi/busutils/bus.py | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/pyatspi/busutils/bus.py b/pyatspi/busutils/bus.py
index 6d84c50..5338f79 100644
--- a/pyatspi/busutils/bus.py
+++ b/pyatspi/busutils/bus.py
@@ -136,6 +136,11 @@ class AsyncAccessibilityBus (_AccessibilityBus):
return AsyncAccessibilityBus._shared_instances[address]
def __init__ (self, registry, address = None):
+ try:
+ if self.inited:
+ return
+ except:
+ self.inited = True
if address is None:
try:
address = _get_accessibility_bus_address()
@@ -169,6 +174,11 @@ class SyncAccessibilityBus (_bus.BusConnection):
def __init__ (self, registry):
try:
+ if self.inited:
+ return
+ except:
+ self.inited = True
+ try:
_bus.BusConnection.__init__ (self, _get_accessibility_bus_address(), None)
except AttributeError:
_bus.BusConnection.__init__ (self, _bus.BusConnection.TYPE_SESSION, None)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]