[pyatspi2] Use pyatspi_corba if /desktop/gnome/interface/at-spi-corba is True
- From: William Walker <wwalker src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pyatspi2] Use pyatspi_corba if /desktop/gnome/interface/at-spi-corba is True
- Date: Thu, 7 Jan 2010 16:41:34 +0000 (UTC)
commit dca73eb4051d4c56601da757e98deb60c1af6deb
Author: Willie Walker <william walker sun com>
Date: Wed Jan 6 13:44:46 2010 -0500
Use pyatspi_corba if /desktop/gnome/interface/at-spi-corba is True
pyatspi/__init__.py | 44 +++++++++++++++++++++++++++++++-------------
1 files changed, 31 insertions(+), 13 deletions(-)
---
diff --git a/pyatspi/__init__.py b/pyatspi/__init__.py
index 9b508e3..5106df2 100644
--- a/pyatspi/__init__.py
+++ b/pyatspi/__init__.py
@@ -12,20 +12,38 @@
#along with this program; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-__version__ = (1, 9, 0)
+try:
+ import gconf
+ gconfClient = gconf.client_get_default()
+ useCorba = gconfClient.get_bool("/desktop/gnome/interface/at-spi-corba")
+except:
+ useCorba = False
+finally:
+ del gconfClient
+ del gconf
-import constants
-from Accessibility import *
+if useCorba:
+ import sys
+ import pyatspi_corba
+ sys.modules['pyatspi'] = pyatspi_corba
+ del sys
+else:
+ __version__ = (1, 9, 0)
-from dbus.mainloop.glib import DBusGMainLoop
-DBusGMainLoop (set_as_default=True)
-del DBusGMainLoop
+ import constants
+ from Accessibility import *
-#This is a re-creation of the namespace pollution implemented
-#by PyORBit.
-import sys
-import Accessibility
-sys.modules['Accessibility'] = Accessibility
-del sys
+ from dbus.mainloop.glib import DBusGMainLoop
+ DBusGMainLoop (set_as_default=True)
+ del DBusGMainLoop
-import appevent as event
+ #This is a re-creation of the namespace pollution implemented
+ #by PyORBit.
+ import sys
+ import Accessibility
+ sys.modules['Accessibility'] = Accessibility
+ del sys
+
+ import appevent as event
+
+del useCorba
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]