Orca hard code freeze break request for pychecker errors



Hi All:

In prepping for a different problem we're investigating with the Firefox
team, we've been running pychecker on the Orca sources.  

We came across two serious problems.  The first is that one of our
scripts (the one for nautilus) was importing a module that no longer
exists.  The second is that the superclass of all our scripts is
returning a non-existent value for one of its methods.  I'm not sure how
we missed either of these.  :-(

These are high-benefit low-risk fixes.  They are high-benefit because
they will avoid abnormal behavior from Orca when these particular
features are encountered (e.g., the nautilus one would be encountered
each time Orca interacted with nautilus).  They are low risk because the
changes are isolated to just the problems in question.

Patch attached.  OK to commit?

Will

PS - We are busily hammering away at our regression tests to more easily
catch things like this in the GNOME 2.21 development timeframe.
Index: src/orca/scripts/nautilus.py
===================================================================
--- src/orca/scripts/nautilus.py	(revision 2816)
+++ src/orca/scripts/nautilus.py	(working copy)
@@ -1,6 +1,6 @@
 # Orca
 #
-# Copyright 2006 Sun Microsystems Inc.
+# Copyright 2006-2007 Sun Microsystems Inc.
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Library General Public
@@ -22,7 +22,7 @@
 __id__        = "$Id:$"
 __version__   = "$Revision:$"
 __date__      = "$Date:$"
-__copyright__ = "Copyright (c) 2007 Sun Microsystems Inc."
+__copyright__ = "Copyright (c) 2006-2007 Sun Microsystems Inc."
 __license__   = "LGPL"
 
 import orca.atspi as atspi
@@ -31,7 +31,6 @@
 import orca.default as default
 import orca.rolenames as rolenames
 import orca.speech as speech
-import orca.util as util
 
 from orca.orca_i18n import _         # for gettext support
 from orca.orca_i18n import ngettext  # for ngettext support
@@ -78,7 +77,7 @@
 
         itemCount = -1
         itemCountString = " "
-        allScrollPanes = util.findByRole(frame, rolenames.ROLE_SCROLL_PANE)
+        allScrollPanes = self.findByRole(frame, rolenames.ROLE_SCROLL_PANE)
         rolesList = [rolenames.ROLE_SCROLL_PANE, \
                      rolenames.ROLE_FILLER, \
                      rolenames.ROLE_FILLER, \
@@ -93,7 +92,7 @@
         # Create a string of the number of items in the folder.
         #
         for pane in allScrollPanes:
-            if util.isDesiredFocusedItem(pane, rolesList):
+            if self.isDesiredFocusedItem(pane, rolesList):
                 for i in range(0, pane.childCount):
                     child = pane.child(i)
                     if child.role == rolenames.ROLE_LAYERED_PANE:
@@ -119,8 +118,6 @@
                                event,
                                event.source.toString())
 
-        #util.printAncestry(event.source)
-
         if event.source.role == rolenames.ROLE_FRAME:
 
             # If we've changed folders, announce the new folder name and
@@ -142,7 +139,7 @@
             allTokens = event.source.name.split(" - ")
             newFolderName = allTokens[0] 
 
-            allPanels = util.findByRole(event.source, rolenames.ROLE_PANEL)
+            allPanels = self.findByRole(event.source, rolenames.ROLE_PANEL)
             rolesList = [rolenames.ROLE_PANEL, \
                          rolenames.ROLE_FILLER, \
                          rolenames.ROLE_PANEL, \
@@ -152,7 +149,7 @@
                          rolenames.ROLE_APPLICATION]
             locationBarFound = False
             for panel in allPanels:
-                if util.isDesiredFocusedItem(panel, rolesList):
+                if self.isDesiredFocusedItem(panel, rolesList):
                     locationBarFound = True
                     break
 
@@ -162,7 +159,7 @@
                     child = panel.child(i)
                     if child.role == rolenames.ROLE_TOGGLE_BUTTON and \
                        child.state.count(atspi.Accessibility.STATE_CHECKED):
-                        if not util.isSameObject(child, self.pathChild):
+                        if not self.isSameObject(child, self.pathChild):
                             self.pathChild = child
                             shouldAnnounce = True
                             break
Index: src/orca/script.py
===================================================================
--- src/orca/script.py	(revision 2816)
+++ src/orca/script.py	(working copy)
@@ -230,7 +230,7 @@
         - pronunciations: the dictionary of pronunciations for this script.
         """
 
-        return pronunciationDict
+        return pronunciations
 
     def getAppState(self):
         """Returns an object that can be passed to setAppState.  This


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]