Skip to content

Commit f8e953e

Browse files
author
Cyrille Bougot
committed
Add cancellable speech commands
1 parent eb9ba0f commit f8e953e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source/speech/speech.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
CharacterModeCommand,
4242
WaveFileCommand,
4343
CallbackCommand,
44+
_CancellableSpeechCommand,
4445
)
4546
from .shortcutKeys import getKeyboardShortcutsSpeech
4647

@@ -152,7 +153,10 @@ def _setLastSpeechString(
152153
# Check if the speech sequence contains text to speak
153154
if any(isinstance(item, str) for item in speechSequence):
154155
global _lastSpeech
155-
_lastSpeech = [item for item in speechSequence if not isinstance(item, CallbackCommand)], symbolLevel
156+
_lastSpeech = (
157+
i [item for item in speechSequence if not isinstance(item, (CallbackCommand, _CancellableSpeechCommand))],
158+
symbolLevel,
159+
)
156160

157161

158162
def initialize():

0 commit comments

Comments
 (0)