orca r4235 - in branches/phase2/src/orca: . plugins plugins/bookmarks plugins/debug_actions plugins/flat_review plugins/speech_parameters plugins/where_am_i scripts/applications scripts/toolkits



Author: wwalker
Date: Tue Sep 16 21:29:18 2008
New Revision: 4235
URL: http://svn.gnome.org/viewvc/orca?rev=4235&view=rev

Log:
Pylint'ing.


Modified:
   branches/phase2/src/orca/acss.py
   branches/phase2/src/orca/default.py
   branches/phase2/src/orca/orca.py
   branches/phase2/src/orca/plugin.py
   branches/phase2/src/orca/plugins/__init__.py
   branches/phase2/src/orca/plugins/bookmarks/plugin.py
   branches/phase2/src/orca/plugins/debug_actions/keyboard_bindings.py
   branches/phase2/src/orca/plugins/debug_actions/plugin.py
   branches/phase2/src/orca/plugins/flat_review/plugin.py
   branches/phase2/src/orca/plugins/speech_parameters/plugin.py
   branches/phase2/src/orca/plugins/where_am_i/plugin.py
   branches/phase2/src/orca/rolenames.py
   branches/phase2/src/orca/script.py
   branches/phase2/src/orca/scripts/applications/__init__.py
   branches/phase2/src/orca/scripts/toolkits/__init__.py
   branches/phase2/src/orca/settings.py
   branches/phase2/src/orca/text_attribute_names.py
   branches/phase2/src/orca/utils.py

Modified: branches/phase2/src/orca/acss.py
==============================================================================
--- branches/phase2/src/orca/acss.py	(original)
+++ branches/phase2/src/orca/acss.py	Tue Sep 16 21:29:18 2008
@@ -82,10 +82,8 @@
         """Update name if we delete a key."""
         dict.__delitem__(self, key)
 
-    def updateName(self):
-        """Update name based on settings."""
-
-    def name(self):
+    def __str__(self):
+        """Get a name for this ACSS."""
         _name = 'acss-'
         names = self.keys()
         if names:

Modified: branches/phase2/src/orca/default.py
==============================================================================
--- branches/phase2/src/orca/default.py	(original)
+++ branches/phase2/src/orca/default.py	Tue Sep 16 21:29:18 2008
@@ -51,6 +51,7 @@
         Subclasses should override this method to add their own
         plugins.
         """
+        # TODO: add user plugins
         # TODO: make the discovery of plugin classes somewhat dynamic
         #
         pluginClasses = []

Modified: branches/phase2/src/orca/orca.py
==============================================================================
--- branches/phase2/src/orca/orca.py	(original)
+++ branches/phase2/src/orca/orca.py	Tue Sep 16 21:29:18 2008
@@ -15,6 +15,10 @@
 # Free Software Foundation, Inc., Franklin Street, Fifth Floor,
 # Boston MA  02110-1301 USA.
 
+# Allow globals to be used in this module.
+#
+# pylint: disable-msg=W0603
+
 # TODO: key echo (perhaps move this to the script itself?)
 # TODO: speech stopping on mouse buttons (perhaps in script itself?)
 # TODO: learn mode (maybe in script manager?)
@@ -210,6 +214,7 @@
 def _start(commandLineSettings):
     """Starts Orca.
     """
+    # TODO: override commandLineSettings
     defaultSettings = settings.getSettings()
     userSettings = loadUserSettings(defaultSettings)
     script_manager.ScriptManager(userSettings)
@@ -293,7 +298,7 @@
                 elif feature == "main-window":
                     commandLineSettings.showMainWindow = True
                 else:
-                    usage()
+                    _usage()
                     utils.abort(2)
 
             if opt in ("-d", "--disable"):
@@ -309,7 +314,7 @@
                 elif feature == "main-window":
                     commandLineSettings.showMainWindow = False
                 else:
-                    usage()
+                    _usage()
                     utils.abort(2)
 
             if opt in ("-s", "--gui-setup", "--setup"):
@@ -321,7 +326,7 @@
             if opt in ("-n", "--no-setup"):
                 commandLineSettings.bypassSetup = True
             if opt in ("-?", "--help"):
-                usage()
+                _usage()
                 utils.abort(0)
             if opt in ("-v", "--version"):
                 print "Orca %s" % platform.version
@@ -333,7 +338,7 @@
                 utils.abort(0)
     except:
         log.exception("exception processing command line arguments:")
-        usage()
+        _usage()
         utils.abort(2)
 
     return commandLineSettings

Modified: branches/phase2/src/orca/plugin.py
==============================================================================
--- branches/phase2/src/orca/plugin.py	(original)
+++ branches/phase2/src/orca/plugin.py	Tue Sep 16 21:29:18 2008
@@ -43,6 +43,9 @@
         script.Script.__init__(self, owner, scriptSettings)
 
     def getSettingsModuleName(self):
+        """Get the name of the module that would hold the user
+	settings for this plugin.
+        """
         name = self._script.getSettingsModuleName()
         if name and len(name):
             name = name + __name__.strip("orca")

Modified: branches/phase2/src/orca/plugins/__init__.py
==============================================================================
--- branches/phase2/src/orca/plugins/__init__.py	(original)
+++ branches/phase2/src/orca/plugins/__init__.py	Tue Sep 16 21:29:18 2008
@@ -0,0 +1 @@
+"""Plugin modules for scripts."""

Modified: branches/phase2/src/orca/plugins/bookmarks/plugin.py
==============================================================================
--- branches/phase2/src/orca/plugins/bookmarks/plugin.py	(original)
+++ branches/phase2/src/orca/plugins/bookmarks/plugin.py	Tue Sep 16 21:29:18 2008
@@ -26,7 +26,6 @@
 log = logging.getLogger('orca.plugins.bookmarks.plugin')
 
 import orca.input_bindings as input_bindings
-import orca.input_event as input_event
 import orca.plugin as plugin
 
 from orca.orca_i18n import _ # for gettext support

Modified: branches/phase2/src/orca/plugins/debug_actions/keyboard_bindings.py
==============================================================================
--- branches/phase2/src/orca/plugins/debug_actions/keyboard_bindings.py	(original)
+++ branches/phase2/src/orca/plugins/debug_actions/keyboard_bindings.py	Tue Sep 16 21:29:18 2008
@@ -24,7 +24,6 @@
 
 import orca.input_bindings as input_bindings
 import orca.input_event as input_event
-import orca.plugin as plugin
 
 bindings = [
     input_bindings.KeyboardBinding(

Modified: branches/phase2/src/orca/plugins/debug_actions/plugin.py
==============================================================================
--- branches/phase2/src/orca/plugins/debug_actions/plugin.py	(original)
+++ branches/phase2/src/orca/plugins/debug_actions/plugin.py	Tue Sep 16 21:29:18 2008
@@ -26,7 +26,6 @@
 log = logging.getLogger('orca.plugins.debug_actions.plugin')
 
 import orca.input_bindings as input_bindings
-import orca.input_event as input_event
 import orca.plugin as plugin
 
 from orca.orca_i18n import _ # for gettext support

Modified: branches/phase2/src/orca/plugins/flat_review/plugin.py
==============================================================================
--- branches/phase2/src/orca/plugins/flat_review/plugin.py	(original)
+++ branches/phase2/src/orca/plugins/flat_review/plugin.py	Tue Sep 16 21:29:18 2008
@@ -26,7 +26,6 @@
 log = logging.getLogger('orca.plugins.flat_review.plugin')
 
 import orca.input_bindings as input_bindings
-import orca.input_event as input_event
 import orca.plugin as plugin
 
 from orca.orca_i18n import _ # for gettext support

Modified: branches/phase2/src/orca/plugins/speech_parameters/plugin.py
==============================================================================
--- branches/phase2/src/orca/plugins/speech_parameters/plugin.py	(original)
+++ branches/phase2/src/orca/plugins/speech_parameters/plugin.py	Tue Sep 16 21:29:18 2008
@@ -26,7 +26,6 @@
 log = logging.getLogger('orca.plugins.speech_parameters.plugin')
 
 import orca.input_bindings as input_bindings
-import orca.input_event as input_event
 import orca.plugin as plugin
 
 from orca.orca_i18n import _ # for gettext support

Modified: branches/phase2/src/orca/plugins/where_am_i/plugin.py
==============================================================================
--- branches/phase2/src/orca/plugins/where_am_i/plugin.py	(original)
+++ branches/phase2/src/orca/plugins/where_am_i/plugin.py	Tue Sep 16 21:29:18 2008
@@ -26,7 +26,6 @@
 log = logging.getLogger('orca.plugins.where_am_i.plugin')
 
 import orca.input_bindings as input_bindings
-import orca.input_event as input_event
 import orca.plugin as plugin
 
 from orca.orca_i18n import _ # for gettext support

Modified: branches/phase2/src/orca/rolenames.py
==============================================================================
--- branches/phase2/src/orca/rolenames.py	(original)
+++ branches/phase2/src/orca/rolenames.py	Tue Sep 16 21:29:18 2008
@@ -16,6 +16,10 @@
 # Free Software Foundation, Inc., Franklin Street, Fifth Floor,
 # Boston MA  02110-1301 USA.
 
+# Can't do much about reducing the size of this file.
+#
+# pylint: disable-msg=C0302
+
 """Provides methods that convert the role name of an Accessible
 object into localized strings for speech and braille."""
 

Modified: branches/phase2/src/orca/script.py
==============================================================================
--- branches/phase2/src/orca/script.py	(original)
+++ branches/phase2/src/orca/script.py	Tue Sep 16 21:29:18 2008
@@ -88,7 +88,7 @@
         # Load custom settings and also give the module a chance to
         # override our keyboard and braille bindings.
         #
-        self._loadSettings(userSettings)
+        self._settings = self._loadSettings(userSettings)
 
         # The object which has the STATE_FOCUS state.
         #
@@ -111,6 +111,8 @@
         self._completeInit()
 
     def getSettingsModuleName(self):
+        """Get the name of the user settings module for this script.
+        """
         name = script_manager.ScriptManager.getScriptModuleName(
             self.application)
         if name and len(name):
@@ -138,7 +140,7 @@
                 log.exception("handled exception importing %s:" % name)
             else:
                 try:
-                    self._settings = settingsModule.getSettings(userSettings)
+                    scriptSettings = settingsModule.getSettings(userSettings)
                 except:
                     log.exception("exception handled:")
                 else:
@@ -151,7 +153,9 @@
                         log.exception("exception handled:")
 
         if not loaded:
-            self._settings = settings.Settings(userSettings)
+            scriptSettings = settings.Settings(userSettings)
+
+        return scriptSettings
 
     def _completeInit(self):
         """Completes the __init__ step.

Modified: branches/phase2/src/orca/scripts/applications/__init__.py
==============================================================================
--- branches/phase2/src/orca/scripts/applications/__init__.py	(original)
+++ branches/phase2/src/orca/scripts/applications/__init__.py	Tue Sep 16 21:29:18 2008
@@ -0,0 +1 @@
+"""Scripts for specific applications."""

Modified: branches/phase2/src/orca/scripts/toolkits/__init__.py
==============================================================================
--- branches/phase2/src/orca/scripts/toolkits/__init__.py	(original)
+++ branches/phase2/src/orca/scripts/toolkits/__init__.py	Tue Sep 16 21:29:18 2008
@@ -0,0 +1 @@
+"""Scripts for specific toolkits."""

Modified: branches/phase2/src/orca/settings.py
==============================================================================
--- branches/phase2/src/orca/settings.py	(original)
+++ branches/phase2/src/orca/settings.py	Tue Sep 16 21:29:18 2008
@@ -650,9 +650,9 @@
                 except TypeError:
                     raise KeyError(key)
 
-    def __getattr__(self, name):
+    def __getattribute__(self, name):
         if name in ["delegate", "override"]:
-            return dict.__getattr__(self, name)
+            return dict.__getattribute__(self, name)
         else:
             return self[name]
 
@@ -663,6 +663,9 @@
             self[name] = value
 
 def getSettings():
+    """Returns a Settings object that holds the global settings
+    set in this module.
+    """
     moduleSettings = Settings()
     for key in globals().keys():
         if not key.startswith("_") \
@@ -671,6 +674,11 @@
     return moduleSettings
 
 if __name__ == "__main__":
+    # We're just experimenting below, so we don't care about
+    # the "Attribute 'x' defined outside __init__ warnings.
+    #
+    # pylint: disable-msg=W0201
+
     overrideSettings = Settings()
     overrideSettings.forceThis = 4
 

Modified: branches/phase2/src/orca/text_attribute_names.py
==============================================================================
--- branches/phase2/src/orca/text_attribute_names.py	(original)
+++ branches/phase2/src/orca/text_attribute_names.py	Tue Sep 16 21:29:18 2008
@@ -18,7 +18,7 @@
 """Provides getTextAttributeName method that maps each text attribute
 into its localized equivalent."""
 
-__id__        = "$Id$"
+__id__  = "$Id$"
 __copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
 __license__   = "LGPL"
 

Modified: branches/phase2/src/orca/utils.py
==============================================================================
--- branches/phase2/src/orca/utils.py	(original)
+++ branches/phase2/src/orca/utils.py	Tue Sep 16 21:29:18 2008
@@ -30,10 +30,13 @@
 
 import os
 import pyatspi
+import shutil
 import signal
 import sys
 import traceback
 
+import platform
+
 try:
     import gconf
     _gconfClient = gconf.client_get_default()



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