[orca: 1/2] speechd: use punct level 'most' when available



commit ca0bf7e718c1685b2116a671f7dc50adcedac3a4
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Sun May 3 19:32:56 2020 +0200

    speechd: use punct level 'most' when available

 src/orca/speechdispatcherfactory.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/speechdispatcherfactory.py b/src/orca/speechdispatcherfactory.py
index 28a952c64..1abece2ab 100644
--- a/src/orca/speechdispatcherfactory.py
+++ b/src/orca/speechdispatcherfactory.py
@@ -138,9 +138,13 @@ class SpeechServer(speechserver.SpeechServer):
             return
         # The following constants must be initialized in runtime since they
         # depend on the speechd module being available.
+        try:
+            most = speechd.PunctuationMode.MOST
+        except:
+            most = speechd.PunctuationMode.SOME
         self._PUNCTUATION_MODE_MAP = {
             settings.PUNCTUATION_STYLE_ALL:  speechd.PunctuationMode.ALL,
-            settings.PUNCTUATION_STYLE_MOST: speechd.PunctuationMode.SOME,
+            settings.PUNCTUATION_STYLE_MOST: most,
             settings.PUNCTUATION_STYLE_SOME: speechd.PunctuationMode.SOME,
             settings.PUNCTUATION_STYLE_NONE: speechd.PunctuationMode.NONE,
             }


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