[orca] Move the cycleDebugLevel input event handler out of orca.py
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Move the cycleDebugLevel input event handler out of orca.py
- Date: Tue, 14 Feb 2012 19:03:40 +0000 (UTC)
commit 1767e90cce0c61065ee4264eade8339f2ee87081
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Tue Feb 14 14:03:01 2012 -0500
Move the cycleDebugLevel input event handler out of orca.py
src/orca/orca.py | 33 ---------------------------------
src/orca/scripts/default.py | 28 +++++++++++++++++++++++++++-
2 files changed, 27 insertions(+), 34 deletions(-)
---
diff --git a/src/orca/orca.py b/src/orca/orca.py
index 00b68f6..d80ade7 100644
--- a/src/orca/orca.py
+++ b/src/orca/orca.py
@@ -525,39 +525,6 @@ def setLocusOfFocus(event, obj, notifyScript=True, force=False):
orca_state.activeScript.locusOfFocusChanged(
event, oldLocusOfFocus, orca_state.locusOfFocus)
-########################################################################
-# #
-# DEBUG support. #
-# #
-########################################################################
-
-def cycleDebugLevel(script=None, inputEvent=None):
- levels = [debug.LEVEL_ALL, "all",
- debug.LEVEL_FINEST, "finest",
- debug.LEVEL_FINER, "finer",
- debug.LEVEL_FINE, "fine",
- debug.LEVEL_CONFIGURATION, "configuration",
- debug.LEVEL_INFO, "info",
- debug.LEVEL_WARNING, "warning",
- debug.LEVEL_SEVERE, "severe",
- debug.LEVEL_OFF, "off"]
-
- try:
- levelIndex = levels.index(debug.debugLevel) + 2
- except:
- levelIndex = 0
- else:
- if levelIndex >= len(levels):
- levelIndex = 0
-
- debug.debugLevel = levels[levelIndex]
-
- briefMessage = levels[levelIndex + 1]
- fullMessage = "Debug level %s." % briefMessage
- orca_state.activeScript.presentMessage(fullMessage, briefMessage)
-
- return True
-
def exitListShortcutsMode(self, inputEvent=None):
"""Turns list shortcuts mode off.
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 53e2ee3..11e5291 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -905,7 +905,7 @@ class Script(script.Script):
self.inputEventHandlers["cycleDebugLevelHandler"] = \
input_event.InputEventHandler(
- orca.cycleDebugLevel,
+ Script.cycleDebugLevel,
# Translators: this is a debug message that Orca users
# will not normally see. It describes a debug routine
# that allows the user to adjust the level of debug
@@ -2986,6 +2986,32 @@ class Script(script.Script):
return True
+ def cycleDebugLevel(self, inputEvent=None):
+ levels = [debug.LEVEL_ALL, "all",
+ debug.LEVEL_FINEST, "finest",
+ debug.LEVEL_FINER, "finer",
+ debug.LEVEL_FINE, "fine",
+ debug.LEVEL_CONFIGURATION, "configuration",
+ debug.LEVEL_INFO, "info",
+ debug.LEVEL_WARNING, "warning",
+ debug.LEVEL_SEVERE, "severe",
+ debug.LEVEL_OFF, "off"]
+
+ try:
+ levelIndex = levels.index(debug.debugLevel) + 2
+ except:
+ levelIndex = 0
+ else:
+ if levelIndex >= len(levels):
+ levelIndex = 0
+
+ debug.debugLevel = levels[levelIndex]
+ briefMessage = levels[levelIndex + 1]
+ fullMessage = "Debug level %s." % briefMessage
+ orca_state.activeScript.presentMessage(fullMessage, briefMessage)
+
+ return True
+
########################################################################
# #
# AT-SPI OBJECT EVENT HANDLERS #
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]