dogtail r391 - in trunk: . dogtail sniff
- From: zcerza svn gnome org
- To: svn-commits-list gnome org
- Subject: dogtail r391 - in trunk: . dogtail sniff
- Date: Tue, 19 Feb 2008 21:24:33 +0000 (GMT)
Author: zcerza
Date: Tue Feb 19 21:24:33 2008
New Revision: 391
URL: http://svn.gnome.org/viewvc/dogtail?rev=391&view=rev
Log:
* dogtail/config.py: Add new parameter: checkForA11y, which defaults
to True. If set to False, we assume accessibility is enabled.
* dogtail/utils.py: Don't import gconf until necessary.
* dogtail/tree.py, sniff/sniff: Don't check for accessibility unless
config.config.checkForA11y is True.
Modified:
trunk/ChangeLog
trunk/dogtail/config.py
trunk/dogtail/tree.py
trunk/dogtail/utils.py
trunk/sniff/sniff
Modified: trunk/dogtail/config.py
==============================================================================
--- trunk/dogtail/config.py (original)
+++ trunk/dogtail/config.py Tue Feb 19 21:24:33 2008
@@ -89,6 +89,10 @@
fatal. If True, exceptions will be raised. If False, warnings will be
passed to the debug logger.
+ checkForA11y (boolean):
+ Whether to check if accessibility is enabled. If not, just assume it is
+ (default True).
+
logDebugToFile (boolean):
Whether to write debug output to a log file.
@@ -134,6 +138,7 @@
'debugTranslation' : False,
'blinkOnActions' : False,
'fatalErrors' : False,
+ 'checkForA11y' : True,
# Logging
'logDebugToFile' : True
Modified: trunk/dogtail/tree.py
==============================================================================
--- trunk/dogtail/tree.py (original)
+++ trunk/dogtail/tree.py Tue Feb 19 21:24:33 2008
@@ -60,14 +60,15 @@
David Malcolm <dmalcolm redhat com>
"""
-from utils import checkForA11y
-checkForA11y()
+from config import config
+if config.checkForA11y:
+ from utils import checkForA11y
+ checkForA11y()
import re
import predicate
from datetime import datetime
from time import sleep
-from config import config
from utils import doDelay
from utils import Blinker
import rawinput
Modified: trunk/dogtail/utils.py
==============================================================================
--- trunk/dogtail/utils.py (original)
+++ trunk/dogtail/utils.py Tue Feb 19 21:24:33 2008
@@ -11,6 +11,7 @@
"""
import os
+import sys
import subprocess
import re
from config import config
@@ -148,16 +149,14 @@
return True
-import sys
-import gconf
-gconfClient = gconf.client_get_default()
a11yGConfKey = '/desktop/gnome/interface/accessibility'
def isA11yEnabled():
"""
Checks if accessibility is enabled via gconf.
"""
- gconfEnabled = gconfClient.get_bool(a11yGConfKey)
+ import gconf
+ gconfEnabled = gconf.client_get_default().get_bool(a11yGConfKey)
if os.environ.get('GTK_MODULES','').find('gail:atk-bridge') == -1:
envEnabled = False
else: envEnabled = True
@@ -171,7 +170,8 @@
"""
Enables accessibility via gconf.
"""
- return gconfClient.set_bool(a11yGConfKey, True)
+ import gconf
+ return gconf.client_get_default().set_bool(a11yGConfKey, True)
def checkForA11y():
"""
Modified: trunk/sniff/sniff
==============================================================================
--- trunk/sniff/sniff (original)
+++ trunk/sniff/sniff Tue Feb 19 21:24:33 2008
@@ -9,9 +9,11 @@
There is no SniffView class; we just use a GtkTreeView.
Data display is handled by the SniffController class.
"""
-from dogtail.utils import checkForA11yInteractively
-checkForA11yInteractively()
from dogtail.config import config
+if config.checkForA11y:
+ from dogtail.utils import checkForA11yInteractively
+ checkForA11yInteractively()
+
config.logDebugToFile = False
config.childrenLimit = 100000
from dogtail import tree
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]