After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 667462 - Implementation of updatePunctuationLevel for espeechfactory.SpeechServer.
Implementation of updatePunctuationLevel for espeechfactory.SpeechServer.
Status: RESOLVED OBSOLETE
Product: orca
Classification: Applications
Component: speech
unspecified
Other All
: Normal normal
: ---
Assigned To: Orca Maintainers
Orca Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-01-07 10:04 UTC by Dmitri Paduchikh
Modified: 2012-08-14 20:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
It is a patch (30 bytes, patch)
2012-01-07 10:04 UTC, Dmitri Paduchikh
none Details | Review
Second attempt on adding a patch. (1.67 KB, patch)
2012-01-07 10:56 UTC, Dmitri Paduchikh
committed Details | Review
Corrected patch (third attempt) (1.46 KB, patch)
2012-01-08 16:18 UTC, Dmitri Paduchikh
none Details | Review

Description Dmitri Paduchikh 2012-01-07 10:04:40 UTC
Created attachment 204802 [details] [review]
It is a patch

The method updatePunctuationLevel has been introduced for
speechdispatcherfactory.SpeechServer but was being used as a part of general
SpeechServer interface. This has broken espeechfactory.SpeechServer. To fix
this problem the patch adds empty updatePunctuationLevel method to
speechserver.SpeechServer and provides implementation for
espeechfactory.SpeechServer.
Comment 1 Dmitri Paduchikh 2012-01-07 10:29:12 UTC
Comment on attachment 204802 [details] [review]
It is a patch

diff --git a/src/orca/espeechfactory.py b/src/orca/espeechfactory.py
index 0f53d92..2376518 100644
--- a/src/orca/espeechfactory.py
+++ b/src/orca/espeechfactory.py
@@ -204,7 +204,9 @@ class SpeechServer(speechserver.SpeechServer):
         self._settings = {}
         if initial:
             self._settings.update(initial)
-            self.configure(self._settings)
+        self._settings['punctuations'] = self._punc_map.get(
+            settings.verbalizePunctuationStyle, 'all')
+        self.configure(self._settings)
 
     def configure(self, engineSettings):
         """Configure engine with settings."""
@@ -404,6 +406,16 @@ class SpeechServer(speechserver.SpeechServer):
             self._output.write("tts_set_punctuations %s\n" % mode)
             self._output.flush()
 
+    _punc_map = {
+        settings.PUNCTUATION_STYLE_ALL:  'all',
+        settings.PUNCTUATION_STYLE_SOME: 'some',
+        settings.PUNCTUATION_STYLE_NONE: 'none',
+        }
+
+    def updatePunctuationLevel(self):
+        """Punctuation level changed, inform this speechServer."""
+        self.punctuations(self._punc_map.get(settings.verbalizePunctuationStyle, 'all'))
+
     def rate(self, r):
         """Set speech rate."""
         self._settings['rate'] = r
diff --git a/src/orca/speechserver.py b/src/orca/speechserver.py
index 2c7ed76..82972f5 100644
--- a/src/orca/speechserver.py
+++ b/src/orca/speechserver.py
@@ -281,6 +281,10 @@ class SpeechServer(object):
         """
         pass
 
+    def updatePunctuationLevel(self):
+        """Punctuation level changed, inform this speechServer."""
+        pass
+
     def stop(self):
         """Stops ongoing speech and flushes the queue."""
         pass
Comment 2 Dmitri Paduchikh 2012-01-07 10:56:41 UTC
Created attachment 204804 [details] [review]
Second attempt on adding a patch.
Comment 3 Joanmarie Diggs (IRC: joanie) 2012-01-07 16:49:05 UTC
Comment on attachment 204804 [details] [review]
Second attempt on adding a patch.

Thanks! Committed to master.

http://git.gnome.org/browse/orca/commit/?id=fb40f7c52ca845eb2b3f1915007af7cc07214220
Comment 4 Joanmarie Diggs (IRC: joanie) 2012-01-07 20:59:32 UTC
Seems like we're getting tracebacks from this fix:

Traceback (most recent call last):
  • File "/data/software/orca/dev/lib/python2.7/site-packages/orca/speech.py", line 68 in getSpeechServerFactories
    [''])
  • File "/data/software/orca/dev/lib/python2.7/site-packages/orca/espeechfactory.py", line 58 in <module>
    class SpeechServer(speechserver.SpeechServer):
  • File "/data/software/orca/dev/lib/python2.7/site-packages/orca/espeechfactory.py", line 410 in SpeechServer
    settings.PUNCTUATION_STYLE_ALL:  'all',
AttributeError: 'function' object has no attribute 'PUNCTUATION_STYLE_ALL'

Comment 5 Joanmarie Diggs (IRC: joanie) 2012-01-07 21:30:50 UTC
I have just reversed the changes from this patch which were made in espeechfactory.py. NOTE that I have left the empty method added to speechserver.py. So hopefully that will cause Orca to not be broken for anyone.

http://git.gnome.org/browse/orca/commit/?id=ebf1232affbd29685855258f2b06e0f609883f23
Comment 6 Dmitri Paduchikh 2012-01-08 16:02:38 UTC
Sorry for breakage. I've created a new variant of patch, and this time
I've tested it by loading espeechfactory into Python REPL. It loads
and speaks without errors in my system.
Comment 7 Dmitri Paduchikh 2012-01-08 16:18:58 UTC
Created attachment 204834 [details] [review]
Corrected patch (third attempt)
Comment 8 Joanmarie Diggs (IRC: joanie) 2012-08-14 20:43:11 UTC
See https://mail.gnome.org/archives/orca-list/2012-March/msg00297.html.