orca r3934 - in trunk: . src/orca test/keystrokes/gtk-demo



Author: joanied
Date: Wed May 28 18:39:58 2008
New Revision: 3934
URL: http://svn.gnome.org/viewvc/orca?rev=3934&view=rev

Log:
* src/orca/default.py:
  test/keystrokes/gtk-demo/role_text_multiline_navigation.py:
  Reversed the fix for bug #529784 - Speech cannot always be
  interrupted with flat review.  Further investigation done by
  Rich and Will indicate that the bug in question is an espeak
  bug and this "fix" introduces more problems than it solves
  (see, for instance, bug #532982).



Modified:
   trunk/ChangeLog
   trunk/src/orca/default.py
   trunk/test/keystrokes/gtk-demo/role_text_multiline_navigation.py

Modified: trunk/src/orca/default.py
==============================================================================
--- trunk/src/orca/default.py	(original)
+++ trunk/src/orca/default.py	Wed May 28 18:39:58 2008
@@ -1961,9 +1961,6 @@
 
         return script.Script.processKeyboardEvent(self, keyboardEvent)
 
-    def __spellItemProgressCallback(self, context, progressType):
-        return
-
     def __sayAllProgressCallback(self, context, progressType):
         # [[[TODO: WDW - this needs work.  Need to be able to manage
         # the monitoring of progress and couple that with both updating
@@ -4611,7 +4608,6 @@
         # the Braille display as an input device.
         #
         if not isinstance(inputEvent, input_event.BrailleEvent):
-            speech.stop()
             if (not lineString) \
                or (not len(lineString)) \
                or (lineString == "\n"):
@@ -4733,6 +4729,20 @@
 
         return True
 
+    def spellCurrentItem(self, itemString):
+        """Spell the current flat review word or line.
+
+        Arguments:
+        - itemString: the string to spell.
+        """
+
+        for (charIndex, character) in enumerate(itemString.decode("UTF-8")):
+            if character.isupper():
+                speech.speak(character.encode("UTF-8"),
+                             self.voices[settings.UPPERCASE_VOICE])
+            else:
+                speech.speak(character.encode("UTF-8"))
+
     def _reviewCurrentItem(self, inputEvent, targetCursorCell=0,
                            speechType=1):
         """Presents the current item to the user.
@@ -4753,7 +4763,6 @@
         # the Braille display as an input device.
         #
         if not isinstance(inputEvent, input_event.BrailleEvent):
-            speech.stop()
             if (not wordString) \
                or (not len(wordString)) \
                or (wordString == "\n"):
@@ -6592,64 +6601,21 @@
 
         return sortedLabels
 
-    def spellingGenerator(self, itemString, phonetic=False):
-        """ Returns an iterator that produces elements of the form:
-        [SayAllContext, acss], where SayAllContext has the text to be
-        spoken and acss is an ACSS instance for speaking the text.
+    def phoneticSpellCurrentItem(self, itemString):
+        """Phonetically spell the current flat review word or line.
 
         Arguments:
-        - itemString: the string to spell
-        - phonetic: whether or not the string should be spelled
-          phonetically.
-
+        - itemString: the string to phonetically spell.
         """
 
-        context = self.getFlatReviewContext()
-        obj = context.getCurrentAccessible()
-        zone = context.lines[context.lineIndex].zones[context.zoneIndex]
-        if isinstance(zone, flat_review.TextZone):
-            startOffset = zone.startOffset
-        else:
-            startOffset = 0
-
         for (charIndex, character) in enumerate(itemString.decode("UTF-8")):
             if character.isupper():
                 voice = settings.voices[settings.UPPERCASE_VOICE]
-            else:
-                voice =  settings.voices[settings.DEFAULT_VOICE]
-
-            if character == " ":
-                string = chnames.getCharacterName(character)
-            elif phonetic:
                 character = character.lower()
-                string = phonnames.getPhoneticName(character)
             else:
-                string = character.encode("UTF-8")
-
-            yield [speechserver.SayAllContext(obj, string,
-                                              startOffset, startOffset + 1),
-                   voice]
-            startOffset += 1
-
-    def spellCurrentItem(self, itemString):
-        """Spell the current item.
-
-        Arguments:
-        - itemString: the string to spell.
-        """
-
-        speech.sayAll(self.spellingGenerator(itemString),
-                      self.__spellItemProgressCallback)
-
-    def phoneticSpellCurrentItem(self, itemString):
-        """Phonetically spell the current item.
-
-        Arguments:
-        - itemString: the string to phonetically spell.
-        """
-
-        speech.sayAll(self.spellingGenerator(itemString, True),
-                      self.__spellItemProgressCallback)
+                voice =  settings.voices[settings.DEFAULT_VOICE]
+            phoneticString = phonnames.getPhoneticName(character)
+            speech.speak(phoneticString, voice)
 
     def printAncestry(self, child):
         """Prints a hierarchical view of a child's ancestry."""

Modified: trunk/test/keystrokes/gtk-demo/role_text_multiline_navigation.py
==============================================================================
--- trunk/test/keystrokes/gtk-demo/role_text_multiline_navigation.py	(original)
+++ trunk/test/keystrokes/gtk-demo/role_text_multiline_navigation.py	Wed May 28 18:39:58 2008
@@ -791,15 +791,15 @@
      "SPEECH OUTPUT: 'h'",
      "SPEECH OUTPUT: 'i'",
      "SPEECH OUTPUT: 's'",
-     "SPEECH OUTPUT: 'space'",
+     "SPEECH OUTPUT: ' '",
      "SPEECH OUTPUT: 'i'",
      "SPEECH OUTPUT: 's'",
-     "SPEECH OUTPUT: 'space'",
+     "SPEECH OUTPUT: ' '",
      "SPEECH OUTPUT: 'o'",
      "SPEECH OUTPUT: 'n'",
      "SPEECH OUTPUT: 'l'",
      "SPEECH OUTPUT: 'y'",
-     "SPEECH OUTPUT: 'space'",
+     "SPEECH OUTPUT: ' '",
      "SPEECH OUTPUT: '",
      "'"]))
 
@@ -823,30 +823,30 @@
      "SPEECH OUTPUT: 'h'",
      "SPEECH OUTPUT: 'i'",
      "SPEECH OUTPUT: 's'",
-     "SPEECH OUTPUT: 'space'",
+     "SPEECH OUTPUT: ' '",
      "SPEECH OUTPUT: 'i'",
      "SPEECH OUTPUT: 's'",
-     "SPEECH OUTPUT: 'space'",
+     "SPEECH OUTPUT: ' '",
      "SPEECH OUTPUT: 'o'",
      "SPEECH OUTPUT: 'n'",
      "SPEECH OUTPUT: 'l'",
      "SPEECH OUTPUT: 'y'",
-     "SPEECH OUTPUT: 'space'",
+     "SPEECH OUTPUT: ' '",
      "SPEECH OUTPUT: '",
      "'",
      "SPEECH OUTPUT: 'tango'",
      "SPEECH OUTPUT: 'hotel'",
      "SPEECH OUTPUT: 'india'",
      "SPEECH OUTPUT: 'sierra'",
-     "SPEECH OUTPUT: 'space'",
+     "SPEECH OUTPUT: ' '",
      "SPEECH OUTPUT: 'india'",
      "SPEECH OUTPUT: 'sierra'",
-     "SPEECH OUTPUT: 'space'",
+     "SPEECH OUTPUT: ' '",
      "SPEECH OUTPUT: 'oscar'",
      "SPEECH OUTPUT: 'november'",
      "SPEECH OUTPUT: 'lima'",
      "SPEECH OUTPUT: 'yankee'",
-     "SPEECH OUTPUT: 'space'",
+     "SPEECH OUTPUT: ' '",
      "SPEECH OUTPUT: '",
      "'"]))
 



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