[orca/570658] Un-DOSify (i.e., remove ^M's) and pylint



commit 20ea89188b9a68edc6a5d5f00cf828259720a39a
Author: Willie Walker <william walker sun com>
Date:   Fri May 15 22:04:25 2009 -0400

    Un-DOSify (i.e., remove ^M's) and pylint
---
 src/orca/scripts/apps/evolution/formatting.py      |  108 ++++++++++----------
 .../scripts/apps/evolution/speech_generator.py     |    8 +-
 .../scripts/apps/gcalctool/speech_generator.py     |    4 +-
 .../apps/gnome-window-properties/formatting.py     |   88 ++++++++--------
 .../scripts/apps/gnome-window-properties/script.py |    5 +-
 src/orca/scripts/apps/planner/formatting.py        |   92 ++++++++--------
 src/orca/scripts/apps/planner/speech_generator.py  |   10 +--
 7 files changed, 153 insertions(+), 162 deletions(-)

diff --git a/src/orca/scripts/apps/evolution/formatting.py b/src/orca/scripts/apps/evolution/formatting.py
index 2066daf..8b179e4 100644
--- a/src/orca/scripts/apps/evolution/formatting.py
+++ b/src/orca/scripts/apps/evolution/formatting.py
@@ -1,55 +1,53 @@
-# Orca
-#
-# Copyright 2006-2008 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
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
-# Boston MA  02110-1301 USA.
-
-"""Custom formatting for evolution."""
-
-__id__ = "$Id$"
-__version__   = "$Revision$"
-__date__      = "$Date$"
-__copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc."
-__license__   = "LGPL"
-
-import pyatspi
-
-import orca.formatting as defaultFormatting
-
-unfocusedWithCount = '((tableCell2ChildLabel + tableCell2ChildToggle) or cellCheckedState + (realActiveDescendantDisplayedText or imageDescription + image) + (expandableState and (expandableState + numberOfChildren)) + required)'
-unfocusedWithoutCount = '((tableCell2ChildLabel + tableCell2ChildToggle) or cellCheckedState + (realActiveDescendantDisplayedText or imageDescription + image) + (expandableState and expandableState ) + required)'
-focusedWithCount = '((tableCell2ChildLabel + tableCell2ChildToggle) or cellCheckedState + (realActiveDescendantDisplayedText or imageDescription + image) + (expandableState and (expandableState + numberOfChildren)) + required)'
-focusedWithoutCount = '((tableCell2ChildLabel + tableCell2ChildToggle) or cellCheckedState + (realActiveDescendantDisplayedText or imageDescription + image) + (expandableState and expandableState ) + required)'
-            
-scriptFormatting = {
-    'speech': {
-        'REAL_ROLE_TABLE_CELL': {
-            # the real cell information
-            # note that pyatspi.ROLE_TABLE_CELL is used to work out if we need to
-            # read a whole row. It calls REAL_ROLE_TABLE_CELL internally.
-            #
-            'focused': '(isDesiredFocusedItem and ' + focusedWithoutCount + ') or ' + focusedWithCount
-            'unfocused': '(isDesiredFocusedItem and (' + unfocusedWithoutCount + ' ) or " + unfocusedWithCount 
-            },
-    }
-}
-
-class Formatting(defaultFormatting.Formatting):
-
-    def __init__(self, script):
-        defaultFormatting.Formatting.__init__(self, script)
-        self.update(scriptFormatting)
-
+# Orca
+#
+# Copyright 2006-2009 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
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA  02110-1301 USA.
+
+"""Custom formatting for evolution."""
+
+__id__ = "$Id$"
+__version__   = "$Revision$"
+__date__      = "$Date$"
+__copyright__ = "Copyright (c) 2005-2009 Sun Microsystems Inc."
+__license__   = "LGPL"
+
+# pylint: disable-msg=C0301
+
+import orca.formatting
+
+unfocusedWithCount = '((tableCell2ChildLabel + tableCell2ChildToggle) or cellCheckedState + (realActiveDescendantDisplayedText or imageDescription + image) + (expandableState and (expandableState + numberOfChildren)) + required)'
+unfocusedWithoutCount = '((tableCell2ChildLabel + tableCell2ChildToggle) or cellCheckedState + (realActiveDescendantDisplayedText or imageDescription + image) + (expandableState and expandableState ) + required)'
+focusedWithCount = '((tableCell2ChildLabel + tableCell2ChildToggle) or cellCheckedState + (realActiveDescendantDisplayedText or imageDescription + image) + (expandableState and (expandableState + numberOfChildren)) + required)'
+focusedWithoutCount = '((tableCell2ChildLabel + tableCell2ChildToggle) or cellCheckedState + (realActiveDescendantDisplayedText or imageDescription + image) + (expandableState and expandableState ) + required)'
+
+formatting = {
+    'speech': {
+        'REAL_ROLE_TABLE_CELL': {
+            # the real cell information
+            # note that pyatspi.ROLE_TABLE_CELL is used to work out if we need to
+            # read a whole row. It calls REAL_ROLE_TABLE_CELL internally.
+            #
+            'focused': '(isDesiredFocusedItem and ' + focusedWithoutCount + ') or ' + focusedWithCount,
+            'unfocused': '(isDesiredFocusedItem and (' + unfocusedWithoutCount + ' ) or ' + unfocusedWithCount
+            },
+    }
+}
+
+class Formatting(orca.formatting.Formatting):
+    def __init__(self, script):
+        orca.formatting.Formatting.__init__(self, script)
+        self.update(formatting)
diff --git a/src/orca/scripts/apps/evolution/speech_generator.py b/src/orca/scripts/apps/evolution/speech_generator.py
index 635004c..e5cf696 100644
--- a/src/orca/scripts/apps/evolution/speech_generator.py
+++ b/src/orca/scripts/apps/evolution/speech_generator.py
@@ -1,6 +1,6 @@
 # Orca
 #
-# Copyright 2005-2008 Sun Microsystems Inc.
+# Copyright 2005-2009 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) 2005-2008 Sun Microsystems Inc."
+__copyright__ = "Copyright (c) 2005-2009 Sun Microsystems Inc."
 __license__   = "LGPL"
 
 import pyatspi
@@ -30,7 +30,7 @@ import pyatspi
 import orca.speechgenerator as speechgenerator
 
 class SpeechGenerator(speechgenerator.SpeechGenerator):
-    """Overrides _getSpeechForTableCell so that, if this is an expanded 
+    """Overrides _getSpeechForTableCell so that, if this is an expanded
        table cell,  we can strip off the "0 items".
     """
 
@@ -48,7 +48,7 @@ class SpeechGenerator(speechgenerator.SpeechGenerator):
 
         # Check that we are in a table cell in the mail message header list.
         # If we are and this table cell has an expanded state, and the first
-        # token of the last utterances is "0", then strip off that last 
+        # token of the last utterances is "0", then strip off that last
         # utterance ("0 items"). See bug #432308 for more details.
         #
         rolesList = [pyatspi.ROLE_TABLE_CELL, \
diff --git a/src/orca/scripts/apps/gcalctool/speech_generator.py b/src/orca/scripts/apps/gcalctool/speech_generator.py
index 0336c46..a196bdc 100644
--- a/src/orca/scripts/apps/gcalctool/speech_generator.py
+++ b/src/orca/scripts/apps/gcalctool/speech_generator.py
@@ -1,6 +1,6 @@
 # Orca
 #
-# Copyright 2004-2008 Sun Microsystems Inc.
+# Copyright 2004-2009 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) 2005-2008 Sun Microsystems Inc."
+__copyright__ = "Copyright (c) 2005-2009 Sun Microsystems Inc."
 __license__   = "LGPL"
 
 import orca.speechgenerator as speechgenerator
diff --git a/src/orca/scripts/apps/gnome-window-properties/formatting.py b/src/orca/scripts/apps/gnome-window-properties/formatting.py
index c92c596..815d461 100644
--- a/src/orca/scripts/apps/gnome-window-properties/formatting.py
+++ b/src/orca/scripts/apps/gnome-window-properties/formatting.py
@@ -1,45 +1,43 @@
-# Orca
-#
-# Copyright 2006-2008 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
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
-# Boston MA  02110-1301 USA.
-
-"""Custom formatting for gnome-window-properties."""
-
-__id__ = "$Id$"
-__version__   = "$Revision$"
-__date__      = "$Date$"
-__copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc."
-__license__   = "LGPL"
-
-import pyatspi
-
-import orca.formatting as defaultFormatting
-
-scriptFormatting = {
-    'speech': {
-        pyatspi.ROLE_ALERT: {
-            'unfocused': 'labelAndName + roleName '
-            },
-    }
-}
-
-class Formatting(defaultFormatting.Formatting):
-
-    def __init__(self, script):
-        defaultFormatting.Formatting.__init__(self, script)
-        self.update(scriptFormatting)
-
+# Orca
+#
+# Copyright 2006-2009 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
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA  02110-1301 USA.
+
+"""Custom formatting for gnome-window-properties."""
+
+__id__ = "$Id$"
+__version__   = "$Revision$"
+__date__      = "$Date$"
+__copyright__ = "Copyright (c) 2005-2009 Sun Microsystems Inc."
+__license__   = "LGPL"
+
+import pyatspi
+
+import orca.formatting
+
+formatting = {
+    'speech': {
+        pyatspi.ROLE_ALERT: {
+            'unfocused': 'labelAndName + roleName'
+            },
+    }
+}
+
+class Formatting(orca.formatting.Formatting):
+    def __init__(self, script):
+        orca.formatting.Formatting.__init__(self, script)
+        self.update(formatting)
diff --git a/src/orca/scripts/apps/gnome-window-properties/script.py b/src/orca/scripts/apps/gnome-window-properties/script.py
index 99a0413..531aa4a 100644
--- a/src/orca/scripts/apps/gnome-window-properties/script.py
+++ b/src/orca/scripts/apps/gnome-window-properties/script.py
@@ -1,6 +1,6 @@
 # Orca
 #
-# Copyright 2006-2008 Sun Microsystems Inc.
+# Copyright 2006-2009 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) 2005-2008 Sun Microsystems Inc."
+__copyright__ = "Copyright (c) 2005-2009 Sun Microsystems Inc."
 __license__   = "LGPL"
 
 import orca.default as default
@@ -35,7 +35,6 @@ from formatting import Formatting
 #                                                                      #
 ########################################################################
 
-
 class Script(default.Script):
 
     def __init__(self, app):
diff --git a/src/orca/scripts/apps/planner/formatting.py b/src/orca/scripts/apps/planner/formatting.py
index da8090c..ca9c074 100644
--- a/src/orca/scripts/apps/planner/formatting.py
+++ b/src/orca/scripts/apps/planner/formatting.py
@@ -1,46 +1,46 @@
-# Orca
-#
-# Copyright 2006-2008 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
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
-# Boston MA  02110-1301 USA.
-
-"""Custom formatting for planner."""
-
-__id__ = "$Id$"
-__version__   = "$Revision$"
-__date__      = "$Date$"
-__copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc."
-__license__   = "LGPL"
-
-import pyatspi
-
-import orca.formatting as defaultFormatting
-
-scriptFormatting = {
-    'speech': {
-        pyatspi.ROLE_TOGGLE_BUTTON: {
-            'unfocused': '(isDesiredFocusedItem and _("Display more options") + labelAndName + allTextSelection + roleName + toggleState + availability) or label'
-            'focused': '(isDesiredFocusedItem and toggleState) or label'
-            },
-    }
-}
-
-class Formatting(defaultFormatting.Formatting):
-
-    def __init__(self, script):
-        defaultFormatting.Formatting.__init__(self, script)
-        self.update(scriptFormatting)
-
+# Orca
+#
+# Copyright 2006-2009 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
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA  02110-1301 USA.
+
+"""Custom formatting for planner."""
+
+__id__ = "$Id$"
+__version__   = "$Revision$"
+__date__      = "$Date$"
+__copyright__ = "Copyright (c) 2005-2009 Sun Microsystems Inc."
+__license__   = "LGPL"
+
+# pylint: disable-msg=C0301
+
+import pyatspi
+
+import orca.formatting
+
+formatting = {
+    'speech': {
+        pyatspi.ROLE_TOGGLE_BUTTON: {
+            'unfocused': '(isDesiredFocusedItem and _("Display more options") + labelAndName + allTextSelection + roleName + toggleState + availability) or label',
+            'focused': '(isDesiredFocusedItem and toggleState) or label'
+            },
+    }
+}
+
+class Formatting(orca.formatting.Formatting):
+    def __init__(self, script):
+        orca.formatting.Formatting.__init__(self, script)
+        self.update(formatting)
diff --git a/src/orca/scripts/apps/planner/speech_generator.py b/src/orca/scripts/apps/planner/speech_generator.py
index dcfd4dd..23f2b99 100644
--- a/src/orca/scripts/apps/planner/speech_generator.py
+++ b/src/orca/scripts/apps/planner/speech_generator.py
@@ -1,6 +1,6 @@
 # Orca
 #
-# Copyright 2006-2008 Sun Microsystems Inc.
+# Copyright 2006-2009 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,14 +22,12 @@
 __id__        = "$Id$"
 __version__   = "$Revision$"
 __date__      = "$Date$"
-__copyright__ = "Copyright (c) 2006-2008 Sun Microsystems Inc."
+__copyright__ = "Copyright (c) 2006-2009 Sun Microsystems Inc."
 __license__   = "LGPL"
 
 import orca.speechgenerator as speechgenerator
 import pyatspi
 
-from orca.orca_i18n import _ # for gettext support
-
 class SpeechGenerator(speechgenerator.SpeechGenerator):
 
     def __init__(self, script):
@@ -39,7 +37,7 @@ class SpeechGenerator(speechgenerator.SpeechGenerator):
     # toolbar used to display in a menu those options that doesn fill
     # in toolbar when the application is resized.
     #
-    # Also for each one of the grphics buttons in the main window
+    # Also for each one of the graphics buttons in the main window
     #
     def _getIsDesiredFocusedItem(self, obj, **args):
         # Application should implement an accessible name in this
@@ -47,10 +45,8 @@ class SpeechGenerator(speechgenerator.SpeechGenerator):
         # more options" when the focus is in one of these toggle
         # buttons.
         #
-
         roleList = [pyatspi.ROLE_TOGGLE_BUTTON, \
                     pyatspi.ROLE_TOOL_BAR]
-
         if self._script.isDesiredFocusedItem(obj, roleList) and not obj.name:
             return True
         else:



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