Index: src/orca/scripts/gedit.py
===================================================================
--- src/orca/scripts/gedit.py	(revision 2107)
+++ src/orca/scripts/gedit.py	(working copy)
@@ -238,7 +238,7 @@
                                event,
                                event.source.toString())
 
-        # util.printAncestry(event.source)
+        # self.printAncestry(event.source)
 
         # 1) Text area (for caching handle for spell checking purposes).
         #
@@ -313,7 +313,7 @@
                                event,
                                event.source.toString())
 
-        # util.printAncestry(event.source)
+        # self.printAncestry(event.source)
 
         # 1) check spelling dialog.
         #
@@ -402,7 +402,7 @@
                                event,
                                event.source.toString())
 
-        # util.printAncestry(event.source)
+        # 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
Index: src/orca/scripts/gnome-search-tool.py
===================================================================
--- src/orca/scripts/gnome-search-tool.py	(revision 2107)
+++ src/orca/scripts/gnome-search-tool.py	(working copy)
@@ -107,7 +107,7 @@
                                event,
                                event.source.toString())
 
-        # util.printAncestry(event.source)
+        # self.printAncestry(event.source)
 
         rolesList = [rolenames.ROLE_PUSH_BUTTON, \
                     rolenames.ROLE_FILLER, \
Index: src/orca/scripts/Evolution.py
===================================================================
--- src/orca/scripts/Evolution.py	(revision 2107)
+++ src/orca/scripts/Evolution.py	(working copy)
@@ -361,7 +361,7 @@
                                event,
                                event.source.toString())
 
-        # util.printAncestry(event.source)
+        # self.printAncestry(event.source)
 
         # 1) Mail view: current message pane: individual lines of text.
         #
Index: src/orca/scripts/StarOffice.py
===================================================================
--- src/orca/scripts/StarOffice.py	(revision 2107)
+++ src/orca/scripts/StarOffice.py	(working copy)
@@ -1161,7 +1161,7 @@
                                event,
                                event.source.toString())
 
-        # util.printAncestry(event.source)
+        # self.printAncestry(event.source)
 
         # 0) Writer: find command
         #
@@ -1418,7 +1418,7 @@
                                event,
                                event.source.toString())
 
-        # util.printAncestry(event.source)
+        # self.printAncestry(event.source)
 
         # 1) Setup dialog.
         #
@@ -1462,7 +1462,7 @@
                                event,
                                event.source.toString())
 
-        # util.printAncestry(event.source)
+        # self.printAncestry(event.source)
 
         # 1) Writer: spell checking dialog.
         #
@@ -1657,7 +1657,7 @@
                                event,
                                event.source.toString())
 
-        # util.printAncestry(event.source)
+        # self.printAncestry(event.source)
 
         # 1) Calc: spread sheet input line.
         #
Index: src/orca/util.py
===================================================================
--- src/orca/util.py	(revision 2107)
+++ src/orca/util.py	(working copy)
@@ -1181,99 +1181,3 @@
             voice =  settings.voices[settings.DEFAULT_VOICE]
         string = phonnames.getPhoneticName(character)
         speech.speak(string, voice)
-
-def printAncestry(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:
-      print ancestor.toString(indent + "+-", False)
-      indent += "  "
-
-def printHierarchy(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:
-       print root.toString(indent + "(*)", False)
-    else:
-       print root.toString(indent + "+-", False)
-
-    rootManagesDescendants = root.state.count(\
-        atspi.Accessibility.STATE_MANAGES_DESCENDANTS)
-
-    for i in range(0, root.childCount):
-        child = root.child(i)
-        if child == root:
-            print indent + "  " + "WARNING CHILD == PARENT!!!"
-        elif not child:
-            print indent + "  " + "WARNING CHILD IS NONE!!!"
-        elif child.parent != root:
-            print indent + "  " + "WARNING CHILD.PARENT != PARENT!!!"
-        else:
-            paint = (not onlyShowing) \
-                    or \
-                    (onlyShowing \
-                     and child.state.count(atspi.Accessibility.STATE_SHOWING))
-            paint = paint \
-                    and ((not omitManaged) \
-                         or (omitManaged and not rootManagesDescendants))
-
-            if paint:
-               printHierarchy(child,
-                              ooi,
-                              indent + "  ",
-                              onlyShowing,
-                              omitManaged)
-
-def printApps():
-    """Prints a list of all applications to stdout."""
-
-    level = debug.LEVEL_OFF
-
-    apps = getKnownApplications()
-    debug.println(level, "There are %d Accessible applications" % len(apps))
-    for app in apps:
-        debug.printDetails(level, "  App: ", app, False)
-        for i in range(0, app.childCount):
-            child = app.child(i)
-            debug.printDetails(level, "    Window: ", child, False)
-            if child.parent != app:
-                debug.println(level,
-                              "      WARNING: child's parent is not app!!!")
-
-    return True
-
-def printActiveApp():
-    """Prints the active application."""
-
-    level = debug.LEVEL_OFF
-
-    window = findActiveWindow()
-    if not window:
-        debug.println(level, "Active application: None")
-    else:
-        app = window.app
-        if not app:
-            debug.println(level, "Active application: None")
-        else:
-            debug.println(level, "Active application: %s" % app.name)
Index: src/orca/orca.py
===================================================================
--- src/orca/orca.py	(revision 2107)
+++ src/orca/orca.py	(working copy)
@@ -412,28 +412,6 @@
 
     return True
 
-def printApps(script=None, inputEvent=None):
-    """Prints a list of all applications to stdout."""
-    util.printApps()
-    return True
-
-def printActiveApp(script=None, inputEvent=None):
-    """Prints the currently active application."""
-    util.printActiveApp()
-    return True
-
-def printAncestry(script=None, inputEvent=None):
-    """Prints the ancestry for the current locusOfFocus"""
-    util.printAncestry(orca_state.locusOfFocus)
-    return True
-
-def printHierarchy(script=None, inputEvent=None):
-    """Prints the application for the current locusOfFocus"""
-    if orca_state.locusOfFocus:
-        util.printHierarchy(orca_state.locusOfFocus.app,
-                            orca_state.locusOfFocus)
-    return True
-
 ########################################################################
 #                                                                      #
 # METHODS FOR PRE-PROCESSING AND MASSAGING KEYBOARD EVENTS.            #
Index: src/orca/default.py
===================================================================
--- src/orca/default.py	(revision 2107)
+++ src/orca/default.py	(working copy)
@@ -311,7 +311,7 @@
 
         self.inputEventHandlers["listAppsHandler"] = \
             input_event.InputEventHandler(
-                orca.printApps,
+                Script.printAppsHandler,
                 _("Prints a debug listing of all known applications to the console where Orca is running."))
 
         self.inputEventHandlers["cycleDebugLevelHandler"] = \
@@ -321,17 +321,17 @@
 
         self.inputEventHandlers["printActiveAppHandler"] = \
             input_event.InputEventHandler(
-                orca.printActiveApp,
+                Script.printActiveAppHandler,
                 _("Prints debug information about the currently active application to the console where Orca is running."))
 
         self.inputEventHandlers["printAncestryHandler"] = \
             input_event.InputEventHandler(
-                orca.printAncestry,
+                Script.printAncestryHandler,
                 _("Prints debug information about the ancestry of the object with focus"))
 
         self.inputEventHandlers["printHierarchyHandler"] = \
             input_event.InputEventHandler(
-                orca.printHierarchy,
+                Script.printHierarchyHandler,
                 _("Prints debug information about the application with focus"))
 
         self.inputEventHandlers["nextPresentationManagerHandler"] = \
@@ -3412,10 +3412,133 @@
         else:
             orca._showFindGUI()
 
+########################################################################
+#                                                                      #
+# DEBUG support.                                                       #
+#                                                                      #
+########################################################################
+
+    def printAppsHandler(self, script=None, inputEvent=None):
+        """Prints a list of all applications to stdout."""
+        self.printApps()
+        return True
+
+    def printActiveAppHandler(self, script=None, inputEvent=None):
+        """Prints the currently active application."""
+        self.printActiveApp()
+        return True
+
+    def printAncestryHandler(self, script=None, inputEvent=None):
+        """Prints the ancestry for the current locusOfFocus"""
+        self.printAncestry(orca_state.locusOfFocus)
+        return True 
+    
+    def printHierarchyHandler(self, script=None, inputEvent=None):
+        """Prints the application for the current locusOfFocus"""
+        if orca_state.locusOfFocus:
+            self.printHierarchy(orca_state.locusOfFocus.app,
+                                orca_state.locusOfFocus)
+        return True
+
 # Routines that were previously in util.py, but that have now been moved
 # here so that they can be customized in application scripts if so desired.
 # 
 
+    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:
+          print ancestor.toString(indent + "+-", False)
+          indent += "  "
+
+    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:
+           print root.toString(indent + "(*)", False)
+        else:
+           print root.toString(indent + "+-", False)
+
+        rootManagesDescendants = root.state.count(\
+            atspi.Accessibility.STATE_MANAGES_DESCENDANTS)
+
+        for i in range(0, root.childCount):
+            child = root.child(i)
+            if child == root:
+                print indent + "  " + "WARNING CHILD == PARENT!!!"
+            elif not child:
+                print indent + "  " + "WARNING CHILD IS NONE!!!"
+            elif child.parent != root:
+                print indent + "  " + "WARNING CHILD.PARENT != PARENT!!!"
+            else:
+                paint = (not onlyShowing) or (onlyShowing and \
+                         child.state.count(atspi.Accessibility.STATE_SHOWING))
+                paint = paint \
+                        and ((not omitManaged) \
+                             or (omitManaged and not rootManagesDescendants))
+
+                if paint:
+                   self.printHierarchy(child,
+                                       ooi,
+                                       indent + "  ",
+                                       onlyShowing,
+                                       omitManaged)
+
+    def printApps(self):
+        """Prints a list of all applications to stdout."""
+
+        level = debug.LEVEL_OFF
+
+        apps = util.getKnownApplications()
+        debug.println(level, "There are %d Accessible applications" % len(apps))
+        for app in apps:
+            debug.printDetails(level, "  App: ", app, False)
+            for i in range(0, app.childCount):
+                child = app.child(i)
+                debug.printDetails(level, "    Window: ", child, False)
+                if child.parent != app:
+                    debug.println(level,
+                                  "      WARNING: child's parent is not app!!!")
+
+        return True
+
+    def printActiveApp(self):
+        """Prints the active application."""
+
+        level = debug.LEVEL_OFF
+
+        window = self.findActiveWindow()
+        if not window:
+            debug.println(level, "Active application: None")
+        else:
+            app = window.app
+            if not app:
+                debug.println(level, "Active application: None")
+            else:
+                debug.println(level, "Active application: %s" % app.name)
+
     def isInActiveApp(self, obj):
         """Returns True if the given object is from the same application that
         currently has keyboard focus.
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 2107)
+++ ChangeLog	(working copy)
@@ -1,3 +1,21 @@
+2007-03-06  Rich Burridge <rich.burridge@sun.com>
+
+        * src/orca/scripts/gedit.py:
+          src/orca/scripts/gnome-search-tool.py:
+          src/orca/scripts/Evolution.py:
+          src/orca/scripts/StarOffice.py:
+          src/orca/util.py:
+          src/orca/orca.py:
+          src/orca/default.py:
+          Another partial fix for bug #395548.
+
+          Moved:
+          def printAncestry(child):
+          def printHierarchy(root, ooi, indent="", 
+                             onlyShowing=True, omitManaged=True):
+          def printApps():
+          def printActiveApp():
+
 2007-03-05  Rich Burridge <rich.burridge@sun.com>
 
         * src/orca/debug.py:
