[orca] Remove some obsolete debugging methods



commit 78c47f152e8dad77fb48acf1713476fd69d535aa
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Dec 31 15:32:08 2012 -0500

    Remove some obsolete debugging methods

 src/orca/common_keyboardmap.py                    |   14 ---
 src/orca/script_utilities.py                      |   75 ----------------
 src/orca/scripts/apps/evolution/script.py         |    2 -
 src/orca/scripts/apps/gedit/script.py             |    6 --
 src/orca/scripts/apps/gnome-search-tool/script.py |    2 -
 src/orca/scripts/apps/soffice/script.py           |    8 --
 src/orca/scripts/default.py                       |   98 ---------------------
 7 files changed, 0 insertions(+), 205 deletions(-)
---
diff --git a/src/orca/common_keyboardmap.py b/src/orca/common_keyboardmap.py
index e60c8dc..3babc70 100644
--- a/src/orca/common_keyboardmap.py
+++ b/src/orca/common_keyboardmap.py
@@ -41,8 +41,6 @@ ORCA_CTRL_ALT_MODIFIER_MASK = settings.ORCA_CTRL_ALT_MODIFIER_MASK
 SHIFT_ALT_MODIFIER_MASK = settings.SHIFT_ALT_MODIFIER_MASK
 
 keymap = (
-    ("Num_Lock", defaultModifierMask, ORCA_MODIFIER_MASK,
-    "showZonesHandler"),
 
     ("F11", defaultModifierMask, ORCA_MODIFIER_MASK,
     "toggleTableCellReadModeHandler"),
@@ -77,18 +75,6 @@ keymap = (
     ("t", defaultModifierMask, ORCA_MODIFIER_MASK,
     "presentDateHandler", 2),
 
-    ("End", defaultModifierMask, ORCA_CTRL_ALT_MODIFIER_MASK,
-    "listAppsHandler"),
-    ("Home", defaultModifierMask, ORCA_CTRL_ALT_MODIFIER_MASK,
-    "reportScriptInfoHandler"),
-
-
-    ("Page_Up", defaultModifierMask, ORCA_CTRL_ALT_MODIFIER_MASK,
-    "printAncestryHandler"),
-
-    ("Page_Down", defaultModifierMask, ORCA_CTRL_ALT_MODIFIER_MASK,
-    "printHierarchyHandler"),
-
     #####################################################################
     #                                                                   #
     #  Bookmark key bindings                                            #
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index cb03eaf..38670a3 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -2288,26 +2288,6 @@ class Utilities:
             self._detectCycle(referent, visitedObjs, " " + indent)
         visitedObjs.remove(obj)
 
-    def printAncestry(self, child):
-        """Prints a hierarchical view of a child's ancestry."""
-
-        if not child:
-            return
-
-        ancestorList = [child]
-        parent = child.parent
-        while parent and (parent.parent != parent):
-            ancestorList.insert(0, parent)
-            parent = parent.parent
-
-        indent = ""
-        for ancestor in ancestorList:
-            line = indent + "+- " + \
-                debug.getAccessibleDetails(debug.LEVEL_OFF, ancestor)
-            debug.println(debug.LEVEL_OFF, line)
-            print(line)
-            indent += "  "
-
     def printApps(self):
         """Prints a list of all applications to stdout."""
 
@@ -2331,61 +2311,6 @@ class Utilities:
 
         return True
 
-    def printHierarchy(self, root, ooi, indent="",
-                       onlyShowing=True, omitManaged=True):
-        """Prints the accessible hierarchy of all children
-
-        Arguments:
-        -indent:      Indentation string
-        -root:        Accessible where to start
-        -ooi:         Accessible object of interest
-        -onlyShowing: If True, only show children painted on the screen
-        -omitManaged: If True, omit children that are managed descendants
-        """
-
-        if not root:
-            return
-
-        if root == ooi:
-            line = indent + "(*) " + debug.getAccessibleDetails(
-                debug.LEVEL_OFF, root)
-        else:
-            line = indent + "+- " + debug.getAccessibleDetails(
-                debug.LEVEL_OFF, root)
-
-        debug.println(debug.LEVEL_OFF, line)
-        print(line)
-
-        rootManagesDescendants = root.getState().contains(
-            pyatspi.STATE_MANAGES_DESCENDANTS)
-
-        for child in root:
-            if child == root:
-                line = indent + "  " + "WARNING CHILD == PARENT!!!"
-                debug.println(debug.LEVEL_OFF, line)
-                print(line)
-            elif not child:
-                line = indent + "  " + "WARNING Child IS NONE!!!"
-                debug.println(debug.LEVEL_OFF, line)
-                print(line)
-            elif self.validParent(child) != root:
-                line = indent + "  " + "WARNING CHILD.PARENT != PARENT!!!"
-                debug.println(debug.LEVEL_OFF, line)
-                print(line)
-            else:
-                paint = (not onlyShowing) or (onlyShowing and \
-                         child.getState().contains(pyatspi.STATE_SHOWING))
-                paint = paint \
-                        and ((not omitManaged) \
-                             or (omitManaged and not rootManagesDescendants))
-
-                if paint:
-                    self.printHierarchy(child,
-                                        ooi,
-                                        indent + "  ",
-                                        onlyShowing,
-                                        omitManaged)
-
     def scriptInfo(self):
         """Output useful information on the current script via speech
         and braille.  This information will be helpful to script writers.
diff --git a/src/orca/scripts/apps/evolution/script.py b/src/orca/scripts/apps/evolution/script.py
index 5abcd3f..bb057f2 100644
--- a/src/orca/scripts/apps/evolution/script.py
+++ b/src/orca/scripts/apps/evolution/script.py
@@ -236,8 +236,6 @@ class Script(default.Script):
         if self.flatReviewContext:
             self.toggleFlatReviewMode()
 
-        # self.printAncestry(event.source)
-
         # 1) Mail view: current message pane: individual lines of text.
         #
         # When the focus is in the pane containing the lines of an
diff --git a/src/orca/scripts/apps/gedit/script.py b/src/orca/scripts/apps/gedit/script.py
index 68bc302..69f4769 100644
--- a/src/orca/scripts/apps/gedit/script.py
+++ b/src/orca/scripts/apps/gedit/script.py
@@ -339,8 +339,6 @@ class Script(default.Script):
         details = debug.getAccessibleDetails(self.debugLevel, event.source)
         debug.printObjectEvent(self.debugLevel, event, details)
 
-        # self.printAncestry(event.source)
-
         # 1) Text area (for caching handle for spell checking purposes).
         #
         # This works in conjunction with code in section 2). Check to see if
@@ -438,8 +436,6 @@ class Script(default.Script):
         details = debug.getAccessibleDetails(self.debugLevel, event.source)
         debug.printObjectEvent(self.debugLevel, event, details)
 
-        # self.printAncestry(event.source)
-
         # 1) check spelling dialog.
         #
         # Check to see if if we've had a property-change event for the
@@ -537,8 +533,6 @@ class Script(default.Script):
         details = debug.getAccessibleDetails(self.debugLevel, event.source)
         debug.printObjectEvent(self.debugLevel, event, details)
 
-        # self.printAncestry(event.source)
-
         # If we've received a text caret moved event and the current locus
         # of focus is on the Find button on the Find dialog or the combo
         # box in the Find dialog and the last input event was a Return,
diff --git a/src/orca/scripts/apps/gnome-search-tool/script.py b/src/orca/scripts/apps/gnome-search-tool/script.py
index 51e4553..92703c0 100644
--- a/src/orca/scripts/apps/gnome-search-tool/script.py
+++ b/src/orca/scripts/apps/gnome-search-tool/script.py
@@ -112,8 +112,6 @@ class Script(default.Script):
         details = debug.getAccessibleDetails(self.debugLevel, event.source)
         debug.printObjectEvent(self.debugLevel, event, details)
 
-        # self.printAncestry(event.source)
-
         rolesList = [pyatspi.ROLE_PUSH_BUTTON, \
                     pyatspi.ROLE_FILLER, \
                     pyatspi.ROLE_FILLER, \
diff --git a/src/orca/scripts/apps/soffice/script.py b/src/orca/scripts/apps/soffice/script.py
index de185cf..e4b783d 100644
--- a/src/orca/scripts/apps/soffice/script.py
+++ b/src/orca/scripts/apps/soffice/script.py
@@ -1391,8 +1391,6 @@ class Script(default.Script):
         details = debug.getAccessibleDetails(self.debugLevel, event.source)
         debug.printObjectEvent(self.debugLevel, event, details)
 
-        # self.printAncestry(event.source)
-
         # Check to see if this is this is for the find command. See
         # comment #18 of bug #354463.
         #
@@ -1683,8 +1681,6 @@ class Script(default.Script):
         details = debug.getAccessibleDetails(self.debugLevel, event.source)
         debug.printObjectEvent(self.debugLevel, event, details)
 
-        # self.printAncestry(event.source)
-
         # Check to see if the Setup dialog window has just been activated.
         # If it has, then find the panel within it that has no name and
         # speak all the labels within that panel.
@@ -1733,8 +1729,6 @@ class Script(default.Script):
         details = debug.getAccessibleDetails(self.debugLevel, event.source)
         debug.printObjectEvent(self.debugLevel, event, details)
 
-        # self.printAncestry(event.source)
-
         # Check to see if if we've had a property-change event for the
         # accessible name for the option pane in the spell check dialog.
         # This (hopefully) means that the user has just corrected a
@@ -2097,8 +2091,6 @@ class Script(default.Script):
         details = debug.getAccessibleDetails(self.debugLevel, event.source)
         debug.printObjectEvent(self.debugLevel, event, details)
 
-        # self.printAncestry(event.source)
-
         # If this "object:selection-changed" is for the spread sheet Name
         # Box, then check to see if the current locus of focus is a spread
         # sheet cell. If it is, and the contents of the input line are
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 15b6353..e3f0867 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -275,17 +275,6 @@ class Script(script.Script):
                 #
                 _("Searches for the previous instance of a string."))
 
-        self.inputEventHandlers["showZonesHandler"] = \
-            input_event.InputEventHandler(
-                Script.showZones,
-                # Translators: this is a debug message that Orca users
-                # will not normally see. It describes a debug routine that
-                # paints rectangles around the interesting (e.g., text)
-                # zones in the active window for the application that
-                # currently has focus.
-                #
-                _("Paints and prints the visible zones in the active window."))
-
         self.inputEventHandlers["toggleFlatReviewModeHandler"] = \
             input_event.InputEventHandler(
                 Script.toggleFlatReviewMode,
@@ -653,17 +642,6 @@ class Script(script.Script):
                 _("Reads the attributes associated with the current text " \
                   "character."))
 
-        self.inputEventHandlers["reportScriptInfoHandler"] = \
-            input_event.InputEventHandler(
-                Script.reportScriptInfo,
-                # Translators: this is a debug message that Orca users
-                # will not normally see. It describes a debug routine
-                # that outputs useful information on the current script
-                #  via speech and braille. This information will be
-                # helpful to script writers.
-                #
-                _("Reports information on current script."))
-
         self.inputEventHandlers["panBrailleLeftHandler"] = \
             input_event.InputEventHandler(
                 Script.panBrailleLeft,
@@ -921,17 +899,6 @@ class Script(script.Script):
                 #
                 _("Cycles to the next key echo level."))
 
-        self.inputEventHandlers["listAppsHandler"] = \
-            input_event.InputEventHandler(
-                Script.printAppsHandler,
-                # Translators: this is a debug message that Orca users
-                # will not normally see. It describes a debug routine
-                # that prints a list of all known applications currently
-                # running on the desktop, to stdout.
-                #
-                _("Prints a debug listing of all known applications to the " \
-                "console where Orca is running."))
-
         self.inputEventHandlers["cycleDebugLevelHandler"] = \
             input_event.InputEventHandler(
                 Script.cycleDebugLevel,
@@ -942,32 +909,6 @@ class Script(script.Script):
                 #
                 _("Cycles the debug level at run time."))
 
-        self.inputEventHandlers["printAncestryHandler"] = \
-            input_event.InputEventHandler(
-                Script.printAncestryHandler,
-                # Translators: this is a debug message that Orca users
-                # will not normally see. It describes a debug routine
-                # that will take the component in the currently running
-                # application that has focus, and print debug information
-                # to the console giving its component ancestry (i.e. all
-                # the components that are its descendants in the component
-                # tree).
-                #
-                _("Prints debug information about the ancestry of the object " \
-                "with focus."))
-
-        self.inputEventHandlers["printHierarchyHandler"] = \
-            input_event.InputEventHandler(
-                Script.printHierarchyHandler,
-                # Translators: this is a debug message that Orca users
-                # will not normally see. It describes a debug routine
-                # that will take the currently running application, and
-                # print debug information to the console giving its
-                # component hierarchy (i.e. all the components and all
-                # their descendants in the component tree).
-                #
-                _("Prints debug information about the application with focus."))
-
         self.inputEventHandlers["bookmarkCurrentWhereAmI"] = \
             input_event.InputEventHandler(
                 Script.bookmarkCurrentWhereAmI,
@@ -2081,13 +2022,6 @@ class Script(script.Script):
 
         return True
 
-    def reportScriptInfo(self, inputEvent=None):
-        """Output useful information on the current script via speech
-        and braille.  This information will be helpful to script writers.
-        """
-
-        return self.utilities.scriptInfo()
-
     def leftClickReviewItem(self, inputEvent=None):
         """Performs a left mouse button click on the current item."""
 
@@ -2565,22 +2499,6 @@ class Script(script.Script):
 
         return True
 
-    def showZones(self, inputEvent):
-        """Debug routine to paint rectangles around the discrete
-        interesting (e.g., text)  zones in the active window for
-        this application.
-        """
-
-        flatReviewContext = self.getFlatReviewContext()
-        lines = flatReviewContext.lines
-        for line in lines:
-            lineString = ""
-            for zone in line.zones:
-                lineString += " '%s' [%s]" % \
-                          (zone.string, zone.accessible.getRoleName())
-            debug.println(debug.LEVEL_OFF, lineString)
-        self.flatReviewContext = None
-
     def sayAll(self, inputEvent):
         try:
             clickCount = inputEvent.getClickCount()
@@ -3172,22 +3090,6 @@ class Script(script.Script):
         self.utilities.printApps()
         return True
 
-    def printAncestryHandler(self, inputEvent=None):
-        """Prints the ancestry for the current locusOfFocus"""
-
-        self.utilities.printAncestry(orca_state.locusOfFocus)
-        return True
-
-    def printHierarchyHandler(self, inputEvent=None):
-        """Prints the application for the current locusOfFocus"""
-
-        if orca_state.locusOfFocus:
-            self.utilities.printHierarchy(
-                orca_state.locusOfFocus.getApplication(),
-                orca_state.locusOfFocus)
-
-        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]