Skip to content

Commit 359295c

Browse files
authored
Merge f80bffb into 3c1693d
2 parents 3c1693d + f80bffb commit 359295c

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

source/sayAllHandler.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616

1717
from speech.commands import CallbackCommand, EndUtteranceCommand
1818

19+
20+
speakWithoutPauses = speech.SpeechWithoutPauses(speakFunc=speech.speak).speakWithoutPauses
21+
22+
1923
CURSOR_CARET = 0
2024
CURSOR_REVIEW = 1
2125

@@ -150,7 +154,7 @@ def nextLine(self):
150154
if isinstance(self.reader.obj, textInfos.DocumentWithPageTurns):
151155
# Once the last line finishes reading, try turning the page.
152156
cb = CallbackCommand(self.turnPage, name="say-all:turnPage")
153-
speech.speakWithoutPauses([cb, EndUtteranceCommand()])
157+
speakWithoutPauses([cb, EndUtteranceCommand()])
154158
else:
155159
self.finish()
156160
return
@@ -182,7 +186,7 @@ def _onLineReached(obj=self.reader.obj, state=state):
182186
seq = list(speech._flattenNestedSequences(speechGen))
183187
seq.insert(0, cb)
184188
# Speak the speech sequence.
185-
spoke = speech.speakWithoutPauses(seq)
189+
spoke = speakWithoutPauses(seq)
186190
# Update the textInfo state ready for when speaking the next line.
187191
self.speakTextInfoState = state.copy()
188192

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

@@ -241,7 +245,7 @@ def finish(self):
241245
# we might switch synths too early and truncate the final speech.
242246
# We do this by putting a CallbackCommand at the start of a new utterance.
243247
cb = CallbackCommand(self.stop, name="say-all:stop")
244-
speech.speakWithoutPauses([
248+
speakWithoutPauses([
245249
EndUtteranceCommand(),
246250
cb,
247251
EndUtteranceCommand()

source/speech/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
Generator,
5252
Union,
5353
Callable,
54-
Iterator,
5554
Tuple,
5655
)
5756
from logHandler import log
@@ -466,7 +465,6 @@ def getObjectSpeech( # noqa: C901
466465
reason: OutputReason = OutputReason.QUERY,
467466
_prefixSpeechCommand: Optional[SpeechCommand] = None,
468467
):
469-
from NVDAObjects import NVDAObjectTextInfo
470468
role=obj.role
471469
# Choose when we should report the content of this object's textInfo, rather than just the object's value
472470
import browseMode
@@ -2538,10 +2536,6 @@ def _getSpeech(
25382536

25392537
_speakWithoutPauses = SpeechWithoutPauses(speakFunc=speak)
25402538

2541-
#: Alias for class SpeakWithoutPauses.speakWithoutPauses. Kept for backwards compatibility
2542-
speakWithoutPauses = _speakWithoutPauses.speakWithoutPauses
2543-
#: Kept for backwards compatibility.
2544-
re_last_pause = _speakWithoutPauses.re_last_pause
25452539

25462540
#: The singleton _SpeechManager instance used for speech functions.
25472541
#: @type: L{manager.SpeechManager}

tests/unit/test_SpeechWithoutPauses.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from speech.types import SpeechSequence
1212
from speech.commands import EndUtteranceCommand, LangChangeCommand, CallbackCommand
13-
from speech import re_last_pause, SpeechWithoutPauses
13+
from speech import SpeechWithoutPauses
1414
from logHandler import log
1515

1616

@@ -89,7 +89,7 @@ def old_speakWithoutPauses( # noqa: C901
8989
for index in range(len(speechSequence) - 1, -1, -1):
9090
item = speechSequence[index]
9191
if isinstance(item, str):
92-
m = re_last_pause.match(item)
92+
m = SpeechWithoutPauses.re_last_pause.match(item)
9393
if m:
9494
before, after = m.groups()
9595
if after:

user_docs/en/changes.t2t

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ What's New in NVDA
8181
- `autoSettingsUtils.driverSetting` classes are removed from `driverHandler` - please use them from `autoSettingUtils.driverSetting`. (#12168)
8282
- `autoSettingsUtils.utils` classes are removed from `driverHandler` - please use them from `autoSettingUtils.utils`. (#12168)
8383
- Support of `TextInfo`s that do not inherit from `contentRecog.BaseContentRecogTextInfo` is removed. (#12157)
84+
- `speech.speakWithoutPauses` has been removed - please use `speech.SpeechWithoutPauses(speakFunc=speech.speak).speakWithoutPauses` instead (#12195)
85+
- `speech.re_last_pause` has been removed - please use `speech.SpeechWithoutPauses.re_last_pause` instead. (#12195)
8486

8587

8688
= 2020.4 =

0 commit comments

Comments
 (0)