[pyatspi2] Call gconftool-2 rather than importing gconf



commit 6346fecca3840b2eee90c0a91e732de767c5b5be
Author: Mike Gorse <mgorse novell com>
Date:   Thu Jan 27 15:49:58 2011 -0600

    Call gconftool-2 rather than importing gconf
    
    Importing gconf caused problems if pyatspi imported the pygi-based binding
    while an app tried to use the pygtk-based binding.  See
    http://mail.gnome.org/archives/gnome-accessibility-devel/2011-January/msg00019.html
    and its follow-ups.

 pyatspi/__init__.py |   18 +++---------------
 1 files changed, 3 insertions(+), 15 deletions(-)
---
diff --git a/pyatspi/__init__.py b/pyatspi/__init__.py
index c7fea6d..879018b 100644
--- a/pyatspi/__init__.py
+++ b/pyatspi/__init__.py
@@ -18,23 +18,11 @@
 import sys
 if not sys.modules.has_key('pyatspi_dbus'):
     try:
-        gconf = None
-        gconfClient = None
-        try:
-            from gi.repository import GConf as gconf
-            gconfClient = gconf.Client.get_default()
-        except:
-            import gconf
-            gconfClient = gconf.client_get_default()
-        useCorba = \
-            gconfClient.get_bool("/desktop/gnome/interface/at-spi-corba")
+        import subprocess
+        o = subprocess.check_output (("gconftool-2", "--get", "/desktop/gnome/interface/at-spi-corba"))
+        useCorba = (o == "true\n")
     except:
         useCorba = False
-    finally:
-        del gconfClient
-        del gconf
-else:
-    useCorba = False
 
 if useCorba:
     import pyatspi_corba



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]