Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions source/sayAllHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

from speech.commands import CallbackCommand, EndUtteranceCommand


speakWithoutPauses = speech.SpeechWithoutPauses(speakFunc=speech.speak).speakWithoutPauses


CURSOR_CARET = 0
CURSOR_REVIEW = 1

Expand Down Expand Up @@ -150,7 +154,7 @@ def nextLine(self):
if isinstance(self.reader.obj, textInfos.DocumentWithPageTurns):
# Once the last line finishes reading, try turning the page.
cb = CallbackCommand(self.turnPage, name="say-all:turnPage")
speech.speakWithoutPauses([cb, EndUtteranceCommand()])
speakWithoutPauses([cb, EndUtteranceCommand()])
else:
self.finish()
return
Expand Down Expand Up @@ -182,7 +186,7 @@ def _onLineReached(obj=self.reader.obj, state=state):
seq = list(speech._flattenNestedSequences(speechGen))
seq.insert(0, cb)
# Speak the speech sequence.
spoke = speech.speakWithoutPauses(seq)
spoke = speakWithoutPauses(seq)
# Update the textInfo state ready for when speaking the next line.
self.speakTextInfoState = state.copy()

Expand All @@ -204,7 +208,7 @@ def _onLineReached(obj=self.reader.obj, state=state):
else:
# We don't want to buffer too much.
# Force speech. lineReached will resume things when speech catches up.
speech.speakWithoutPauses(None)
speakWithoutPauses(None)
# The first buffered line has now started speaking.
self.numBufferedLines -= 1

Expand Down Expand Up @@ -241,7 +245,7 @@ def finish(self):
# we might switch synths too early and truncate the final speech.
# We do this by putting a CallbackCommand at the start of a new utterance.
cb = CallbackCommand(self.stop, name="say-all:stop")
speech.speakWithoutPauses([
speakWithoutPauses([
EndUtteranceCommand(),
cb,
EndUtteranceCommand()
Expand Down
6 changes: 0 additions & 6 deletions source/speech/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
Generator,
Union,
Callable,
Iterator,
Tuple,
)
from logHandler import log
Expand Down Expand Up @@ -466,7 +465,6 @@ def getObjectSpeech( # noqa: C901
reason: OutputReason = OutputReason.QUERY,
_prefixSpeechCommand: Optional[SpeechCommand] = None,
):
from NVDAObjects import NVDAObjectTextInfo
role=obj.role
# Choose when we should report the content of this object's textInfo, rather than just the object's value
import browseMode
Expand Down Expand Up @@ -2538,10 +2536,6 @@ def _getSpeech(

_speakWithoutPauses = SpeechWithoutPauses(speakFunc=speak)

#: Alias for class SpeakWithoutPauses.speakWithoutPauses. Kept for backwards compatibility
speakWithoutPauses = _speakWithoutPauses.speakWithoutPauses
#: Kept for backwards compatibility.
re_last_pause = _speakWithoutPauses.re_last_pause

#: The singleton _SpeechManager instance used for speech functions.
#: @type: L{manager.SpeechManager}
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_SpeechWithoutPauses.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from speech.types import SpeechSequence
from speech.commands import EndUtteranceCommand, LangChangeCommand, CallbackCommand
from speech import re_last_pause, SpeechWithoutPauses
from speech import SpeechWithoutPauses
from logHandler import log


Expand Down Expand Up @@ -89,7 +89,7 @@ def old_speakWithoutPauses( # noqa: C901
for index in range(len(speechSequence) - 1, -1, -1):
item = speechSequence[index]
if isinstance(item, str):
m = re_last_pause.match(item)
m = SpeechWithoutPauses.re_last_pause.match(item)
if m:
before, after = m.groups()
if after:
Expand Down
2 changes: 2 additions & 0 deletions user_docs/en/changes.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ What's New in NVDA
- `autoSettingsUtils.driverSetting` classes are removed from `driverHandler` - please use them from `autoSettingUtils.driverSetting`. (#12168)
- `autoSettingsUtils.utils` classes are removed from `driverHandler` - please use them from `autoSettingUtils.utils`. (#12168)
- Support of `TextInfo`s that do not inherit from `contentRecog.BaseContentRecogTextInfo` is removed. (#12157)
- `speech.speakWithoutPauses` has been removed - please use `speech.SpeechWithoutPauses(speakFunc=speech.speak).speakWithoutPauses` instead. (#12195)
- `speech.re_last_pause` has been removed - please use `speech.SpeechWithoutPauses.re_last_pause` instead. (#12195)


= 2020.4 =
Expand Down