[caribou] Add a11y check



commit 7ecf906ff414a6cbe522f915c4e5d783d1381239
Author: Flavio Percoco Premoli <flaper87 gmail com>
Date:   Wed Mar 31 22:56:09 2010 +0200

    Add a11y check

 src/caribou.py |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/caribou.py b/src/caribou.py
index a1f0c13..70a9659 100755
--- a/src/caribou.py
+++ b/src/caribou.py
@@ -7,6 +7,8 @@
 # Copyright (C) 2009 Eitan Isaacson <eitan monotonous org>
 # Copyright (C) 2009 Sun Microsystems, Inc.
 #  * Contributor: Willie Walker <william walker sun com>
+# Copyright (C) 2009 Flavio Percoco <flaper87 flaper87 org>
+#  * Contributor: Flavio Percoco <flaper87 flaper87 org>
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU Lesser General Public License as published by the
@@ -28,6 +30,7 @@ import gtk
 import gtk.gdk as gdk
 import pyatspi
 import sys
+import gconf
 
 import caribou.window as window
 import caribou.keyboard as keyboard
@@ -165,6 +168,18 @@ def usage():
 if __name__ == "__main__":
 
     try:
+        gconfClient = gconf.client_get_default()
+        isAccessibilityEnabled = gconfClient.get_bool("/desktop/gnome/interface/accessibility") \
+            or gconfClient.get_bool("/desktop/gnome/interface/accessibility2")
+    except:
+        gconfClient = None
+        isAccessibilityEnabled = False
+        
+    if not isAccessibilityEnabled:
+        print "Error: GNOME a11y has to be enabled in order to work correctly"
+        sys.exit(1)
+        
+    try:
         options, xargs = getopt.getopt(sys.argv[1:], "dhv",
             ["debug", "help", "version"])
     except getopt.GetoptError, e:



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