orca r4541 - in trunk: . src/orca



Author: wwalker
Date: Fri Feb 13 22:03:44 2009
New Revision: 4541
URL: http://svn.gnome.org/viewvc/orca?rev=4541&view=rev

Log:
Fix for bug #569343 - Speaking of indentation is misleading


Modified:
   trunk/ChangeLog
   trunk/src/orca/default.py

Modified: trunk/src/orca/default.py
==============================================================================
--- trunk/src/orca/default.py	(original)
+++ trunk/src/orca/default.py	Fri Feb 13 22:03:44 2009
@@ -2208,29 +2208,35 @@
 
         spaceCount = 0
         tabCount = 0
-        for offset in range(0, len(line)):
-            if line[offset] == ' ':
+        utterance = ""
+        offset = 0
+        while True:
+            while line[offset] == ' ':
                 spaceCount += 1
-            elif line[offset] == '\t':
+                offset += 1
+            if spaceCount:
+                # Translators: this is the number of space characters on a line
+                # of text.
+                #
+                utterance += ngettext("%d space",
+                                      "%d spaces",
+                                      spaceCount) % spaceCount + " "
+
+            while line[offset] == '\t':
                 tabCount += 1
-            else:
+                offset += 1
+
+            if tabCount:
+                # Translators: this is the number of tab characters on a line
+                # of text.
+                #
+                utterance += ngettext("%d tab",
+                                      "%d tabs",
+                                      tabCount) % tabCount + " "
+            if not (spaceCount  or tabCount):
                 break
+            spaceCount  = tabCount = 0
 
-        utterance = ""
-        if spaceCount:
-            # Translators: this is the number of space characters on a line
-            # of text.
-            #
-            utterance += ngettext("%d space",
-                                  "%d spaces",
-                                  spaceCount) % spaceCount + " "
-        if tabCount:
-            # Translators: this is the number of tab characters on a line
-            # of text.
-            #
-            utterance += ngettext("%d tab",
-                                  "%d tabs",
-                                  tabCount) % tabCount + " "
         if len(utterance):
             speech.speak(utterance)
 



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