[orca] Re-enable the "interrupt" option in speechdispatcher factory
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Re-enable the "interrupt" option in speechdispatcher factory
- Date: Fri, 8 Jan 2021 11:50:04 +0000 (UTC)
commit ce033c086bb886479b5097d8ecb5a838f94728c7
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri Jan 8 12:41:59 2021 +0100
Re-enable the "interrupt" option in speechdispatcher factory
speak() and speakUtterances() had the use of the interrupt argument
commented out back in 2007 due to unspecified issues. In 2013, we
enabled this and then immediately re-disabled it due to regressions.
Most of the code handles interruption via explicitly calling the
script's presentationInterrupt method which calls speech.stop,
which causes _cancel to be called in speechdispatcher factory. That
said, there may be downstream/external scripts/functionality that
for some reason isn't calling presentationInterrupt or stop. And
having this option in place but non functioning seems silly. So we'll
re-enable it but set the default value to False in the hopes that we
minimize the number of regressions that may be unexpectedly introduced
by this change.
src/orca/speechdispatcherfactory.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/orca/speechdispatcherfactory.py b/src/orca/speechdispatcherfactory.py
index 53e1888c0..2391dabc4 100644
--- a/src/orca/speechdispatcherfactory.py
+++ b/src/orca/speechdispatcherfactory.py
@@ -585,9 +585,9 @@ class SpeechServer(speechserver.SpeechServer):
return families
- def speak(self, text=None, acss=None, interrupt=True):
- #if interrupt:
- # self._cancel()
+ def speak(self, text=None, acss=None, interrupt=False):
+ if interrupt:
+ self._cancel()
# "We will not interrupt a key echo in progress." (Said the comment in
# speech.py where these next two lines used to live. But the code here
@@ -599,9 +599,10 @@ class SpeechServer(speechserver.SpeechServer):
if text:
self._speak(text, acss)
- def speakUtterances(self, utteranceList, acss=None, interrupt=True):
- #if interrupt:
- # self._cancel()
+ def speakUtterances(self, utteranceList, acss=None, interrupt=False):
+ if interrupt:
+ self._cancel()
+
for utterance in utteranceList:
if utterance:
self._speak(utterance, acss)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]