[orca] Remove some old and no-longer used code
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Remove some old and no-longer used code
- Date: Fri, 20 Feb 2015 23:42:23 +0000 (UTC)
commit 3a62cf8665e4e630ce35833a9b8f235d08c91113
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri Feb 20 18:41:38 2015 -0500
Remove some old and no-longer used code
src/orca/script_utilities.py | 121 ------------------------------------------
src/orca/scripts/default.py | 6 --
2 files changed, 0 insertions(+), 127 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 0b37080..d7a0da2 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -2087,127 +2087,6 @@ class Utilities:
#########################################################################
# #
- # Debugging and Reporting Utilities #
- # #
- #########################################################################
-
- def _isInterestingObj(self, obj):
- import inspect
-
- interesting = False
-
- if getattr(obj, "__class__", None):
- name = obj.__class__.__name__
- if name not in ["function",
- "type",
- "list",
- "dict",
- "tuple",
- "wrapper_descriptor",
- "module",
- "method_descriptor",
- "member_descriptor",
- "instancemethod",
- "builtin_function_or_method",
- "frame",
- "classmethod",
- "classmethod_descriptor",
- "_Environ",
- "MemoryError",
- "_Printer",
- "_Helper",
- "getset_descriptor",
- "weakref",
- "property",
- "cell",
- "staticmethod",
- "EventListener",
- "KeystrokeListener",
- "KeyBinding",
- "InputEventHandler",
- "Rolename"]:
- try:
- filename = inspect.getabsfile(obj.__class__)
- if filename.index("orca"):
- interesting = True
- except:
- pass
-
- return interesting
-
- def _detectCycle(self, obj, visitedObjs, indent=""):
- """Attempts to discover a cycle in object references."""
-
- # [[[TODO: WDW - not sure this really works.]]]
-
- import gc
- visitedObjs.append(obj)
- for referent in gc.get_referents(obj):
- try:
- if visitedObjs.index(referent):
- if self._isInterestingObj(referent):
- print(indent, "CYCLE!!!!", repr(referent))
- break
- except:
- pass
- self._detectCycle(referent, visitedObjs, " " + indent)
- visitedObjs.remove(obj)
-
- def printApps(self):
- """Prints a list of all applications to stdout."""
-
- apps = self.knownApplications()
- line = "There are %d Accessible applications" % len(apps)
- debug.println(debug.LEVEL_OFF, line)
- print(line)
- for app in apps:
- line = debug.getAccessibleDetails(
- debug.LEVEL_OFF, app, " App: ", False)
- debug.println(debug.LEVEL_OFF, line)
- print(line)
- for child in app:
- line = debug.getAccessibleDetails(
- debug.LEVEL_OFF, child, " Window: ", False)
- debug.println(debug.LEVEL_OFF, line)
- print(line)
- if child.parent != app:
- debug.println(debug.LEVEL_OFF,
- " WARNING: child's parent is not app!!!")
-
- return True
-
- def scriptInfo(self):
- """Output useful information on the current script via speech
- and braille. This information will be helpful to script writers.
- """
-
- infoString = "SCRIPT INFO: Script name='%s'" % self._script.name
- app = orca_state.locusOfFocus.getApplication()
- if orca_state.locusOfFocus and app:
- infoString += " Application name='%s'" \
- % app.name
-
- try:
- infoString += " Toolkit name='%s'" \
- % app.toolkitName
- except:
- infoString += " Toolkit unknown"
-
- try:
- infoString += " Version='%s'" \
- % app.toolkitVersion
- except:
- infoString += " Version unknown"
-
- debug.println(debug.LEVEL_OFF, infoString)
- print(infoString)
- self._script.speakMessage(infoString)
- self._script.displayBrailleMessage(infoString)
-
- return True
-
- #########################################################################
- # #
# Miscellaneous Utilities #
# #
#########################################################################
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 33fa06b..2d8178a 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -2063,12 +2063,6 @@ class Script(script.Script):
self.doWhereAmI(inputEvent, False)
- def printAppsHandler(self, inputEvent=None):
- """Prints a list of all applications to stdout."""
-
- self.utilities.printApps()
- return True
-
def cycleDebugLevel(self, inputEvent=None):
levels = [debug.LEVEL_ALL, "all",
debug.LEVEL_FINEST, "finest",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]