Skip to content

Commit 88e9d8f

Browse files
authored
Merge 53473dd into 62eaba5
2 parents 62eaba5 + 53473dd commit 88e9d8f

23 files changed

Lines changed: 3231 additions & 2906 deletions

appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ build_script:
9999
- if ERRORLEVEL 1 exit %ERRORLEVEL%
100100
# We don't need launcher to run checkPot, so run the checkPot before launcher.
101101
- scons checkPot %sconsArgs%
102+
- if ERRORLEVEL 1 Add-AppveyorMessage "Translator comments are missing"
102103
- if ERRORLEVEL 1 exit %ERRORLEVEL%
103104
# The pot gets built by tests, but we don't actually need it as a build artifact.
104105
- 'echo scons output targets: %sconsOutTargets%'

source/NVDAHelper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,9 @@ def nvdaControllerInternal_inputLangChangeNotify(threadID,hkl,layoutString):
386386
#But threadIDs for console windows are always wrong so don't ignore for those.
387387
if not isinstance(focus,NVDAObjects.window.Window) or (threadID!=focus.windowThreadID and focus.windowClassName!="ConsoleWindowClass"):
388388
return 0
389-
import sayAllHandler
389+
from speech import sayAll
390390
#Never announce changes while in sayAll (#1676)
391-
if sayAllHandler.isRunning():
391+
if sayAll.SayAllHandler.isRunning():
392392
return 0
393393
import queueHandler
394394
import ui

source/NVDAObjects/IAccessible/winword.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from ..behaviors import EditableTextWithoutAutoSelectDetection
2323
from NVDAObjects.window.winword import *
2424
from NVDAObjects.window.winword import WordDocumentTreeInterceptor
25+
from speech import sayAll
2526

2627

2728
class WordDocument(IAccessible,EditableTextWithoutAutoSelectDetection,WordDocument):
@@ -365,15 +366,15 @@ def script_nextParagraph(self,gesture):
365366
info._rangeObj.move(wdParagraph,1)
366367
info.updateCaret()
367368
self._caretScriptPostMovedHelper(textInfos.UNIT_PARAGRAPH,gesture,None)
368-
script_nextParagraph.resumeSayAllMode=sayAllHandler.CURSOR_CARET
369+
script_nextParagraph.resumeSayAllMode = sayAll.CURSOR_CARET
369370

370371
def script_previousParagraph(self,gesture):
371372
info=self.makeTextInfo(textInfos.POSITION_CARET)
372373
# #4375: keeping cemetrical with nextParagraph script.
373374
info._rangeObj.move(wdParagraph,-1)
374375
info.updateCaret()
375376
self._caretScriptPostMovedHelper(textInfos.UNIT_PARAGRAPH,gesture,None)
376-
script_previousParagraph.resumeSayAllMode=sayAllHandler.CURSOR_CARET
377+
script_previousParagraph.resumeSayAllMode = sayAll.CURSOR_CARET
377378

378379
def focusOnActiveDocument(self, officeChartObject):
379380
rangeStart=officeChartObject.Parent.Range.Start
@@ -465,4 +466,3 @@ def event_gainFocus(self):
465466
ctypes.windll.user32.AttachThreadInput(curThreadID,document.windowThreadID,False)
466467
if not document.WinwordWindowObject.active:
467468
document.WinwordWindowObject.activate()
468-

source/NVDAObjects/window/winword.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import locale
1515
import collections
1616
import colorsys
17-
import sayAllHandler
1817
import eventHandler
1918
import braille
2019
from scriptHandler import script
@@ -946,7 +945,7 @@ def collapse(self,end=False):
946945
newEndOffset = self._rangeObj.end
947946
# the new endOffset should not have become smaller than the old endOffset, this could cause an infinite loop in
948947
# a case where you called move end then collapse until the size of the range is no longer being reduced.
949-
# For an example of this see sayAll (specifically readTextHelper_generator in sayAllHandler.py)
948+
# For an example of this see sayAll (specifically readTextHelper_generator in sayAll.py)
950949
if newEndOffset < oldEndOffset :
951950
raise RuntimeError
952951

source/appModules/eclipse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import braille
1313
import ui
1414
import api
15-
import sayAllHandler
15+
from speech import sayAll
1616
import eventHandler
1717
import keyboardHandler
1818
from scriptHandler import script
@@ -98,7 +98,7 @@ def script_readDocumentation(self, gesture):
9898
if documentObj.role == controlTypes.ROLE_DOCUMENT:
9999
api.setNavigatorObject(documentObj)
100100
braille.handler.handleReviewMove()
101-
sayAllHandler.readText(sayAllHandler.CURSOR_REVIEW)
101+
sayAll.SayAllHandler.readText(sayAll.CURSOR_REVIEW)
102102

103103
elif documentObj.role == controlTypes.ROLE_EDITABLETEXT:
104104
ui.message(documentObj.value)

source/appModules/kindle.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from comtypes.hresult import S_OK
99
import appModuleHandler
1010
import speech
11-
import sayAllHandler
11+
from speech import sayAll
1212
import api
1313
from scriptHandler import willSayAllResume, isScriptWaiting
1414
import controlTypes
@@ -106,11 +106,11 @@ def _changePageScriptHelper(self,gesture,previous=False):
106106

107107
def script_moveByPage_forward(self,gesture):
108108
self._changePageScriptHelper(gesture)
109-
script_moveByPage_forward.resumeSayAllMode=sayAllHandler.CURSOR_CARET
109+
script_moveByPage_forward.resumeSayAllMode = sayAll.CURSOR_CARET
110110

111111
def script_moveByPage_back(self,gesture):
112112
self._changePageScriptHelper(gesture,previous=True)
113-
script_moveByPage_back.resumeSayAllMode=sayAllHandler.CURSOR_CARET
113+
script_moveByPage_back.resumeSayAllMode = sayAll.CURSOR_CARET
114114

115115
def _tabOverride(self,direction):
116116
return False

source/appModules/powerpnt.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import colors
1616
import api
1717
import speech
18-
import sayAllHandler
18+
from speech import sayAll
1919
import NVDAHelper
2020
import winUser
2121
import msoAutoShapeTypes
@@ -407,18 +407,18 @@ def _get_firstChild(self):
407407

408408
def handleSelectionChange(self):
409409
"""Pushes focus to the newly selected object."""
410-
if getattr(self,"_isHandlingSelectionChange",False):
411-
# #3394: A COM event can cause this function to run within itself.
410+
if getattr(self, "_isHandlingSelectionChange", False):
411+
# #3394: A COM event can cause this function to run within itself.
412412
# This can cause double speaking, so stop here if we're already running.
413-
return
414-
self._isHandlingSelectionChange=True
415-
try:
413+
return
414+
self._isHandlingSelectionChange = True
415+
try:
416416
obj=self.selection
417417
if not obj:
418418
obj=IAccessible(windowHandle=self.windowHandle,IAccessibleObject=self.IAccessibleObject,IAccessibleChildID=self.IAccessibleChildID)
419419
if obj and obj!=eventHandler.lastQueuedFocusObject:
420-
eventHandler.queueEvent("gainFocus",obj)
421-
finally:
420+
eventHandler.queueEvent("gainFocus", obj)
421+
finally:
422422
self._isHandlingSelectionChange=False
423423

424424
def script_selectionChange(self,gesture):
@@ -1097,7 +1097,7 @@ def makeTextInfo(self,position):
10971097

10981098
def reportNewSlide(self):
10991099
self.makeTextInfo(textInfos.POSITION_FIRST).updateCaret()
1100-
sayAllHandler.readText(sayAllHandler.CURSOR_CARET)
1100+
sayAll.SayAllHandler.readText(sayAll.CURSOR_CARET)
11011101

11021102
def script_toggleNotesMode(self,gesture):
11031103
self.rootNVDAObject.notesMode=not self.rootNVDAObject.notesMode

source/browseMode.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import braille
3434
import vision
3535
import speech
36-
import sayAllHandler
36+
from speech import sayAll
3737
import treeInterceptorHandler
3838
import inputCore
3939
import api
@@ -462,7 +462,7 @@ def addQuickNav(
462462
script = lambda self,gesture: self._quickNavScript(gesture, itemType, "next", nextError, readUnit)
463463
script.__doc__ = nextDoc
464464
script.__name__ = funcName
465-
script.resumeSayAllMode=sayAllHandler.CURSOR_CARET
465+
script.resumeSayAllMode = sayAll.CURSOR_CARET
466466
setattr(cls, funcName, script)
467467
if key is not None:
468468
cls.__gestures["kb:%s" % key] = scriptName
@@ -471,7 +471,7 @@ def addQuickNav(
471471
script = lambda self,gesture: self._quickNavScript(gesture, itemType, "previous", prevError, readUnit)
472472
script.__doc__ = prevDoc
473473
script.__name__ = funcName
474-
script.resumeSayAllMode=sayAllHandler.CURSOR_CARET
474+
script.resumeSayAllMode = sayAll.CURSOR_CARET
475475
setattr(cls, funcName, script)
476476
if key is not None:
477477
cls.__gestures["kb:shift+%s" % key] = scriptName
@@ -1279,7 +1279,7 @@ def event_treeInterceptor_gainFocus(self):
12791279
if not self.passThrough:
12801280
if doSayAll:
12811281
speech.speakObjectProperties(self.rootNVDAObject, name=True, states=True, reason=OutputReason.FOCUS)
1282-
sayAllHandler.readText(sayAllHandler.CURSOR_CARET)
1282+
sayAll.SayAllHandler.readText(sayAll.CURSOR_CARET)
12831283
else:
12841284
# Speak it like we would speak focus on any other document object.
12851285
# This includes when entering the treeInterceptor for the first time:
@@ -1574,7 +1574,7 @@ def event_gainFocus(self, obj, nextHandler):
15741574
# The virtual caret is not within the focus node.
15751575
oldPassThrough=self.passThrough
15761576
passThrough = self.shouldPassThrough(obj, reason=OutputReason.FOCUS)
1577-
if not oldPassThrough and (passThrough or sayAllHandler.isRunning()):
1577+
if not oldPassThrough and (passThrough or sayAll.SayAllHandler.isRunning()):
15781578
# If pass-through is disabled, cancel speech, as a focus change should cause page reading to stop.
15791579
# This must be done before auto-pass-through occurs, as we want to stop page reading even if pass-through will be automatically enabled by this focus change.
15801580
speech.cancelSpeech()
@@ -1805,7 +1805,7 @@ def script_moveToStartOfContainer(self,gesture):
18051805
if not willSayAllResume(gesture):
18061806
container.expand(textInfos.UNIT_LINE)
18071807
speech.speakTextInfo(container, reason=OutputReason.FOCUS)
1808-
script_moveToStartOfContainer.resumeSayAllMode=sayAllHandler.CURSOR_CARET
1808+
script_moveToStartOfContainer.resumeSayAllMode = sayAll.CURSOR_CARET
18091809
# Translators: Description for the Move to start of container command in browse mode.
18101810
script_moveToStartOfContainer.__doc__=_("Moves to the start of the container element, such as a list or table")
18111811

@@ -1830,7 +1830,7 @@ def script_movePastEndOfContainer(self,gesture):
18301830
if not willSayAllResume(gesture):
18311831
container.expand(textInfos.UNIT_LINE)
18321832
speech.speakTextInfo(container, reason=OutputReason.FOCUS)
1833-
script_movePastEndOfContainer.resumeSayAllMode=sayAllHandler.CURSOR_CARET
1833+
script_movePastEndOfContainer.resumeSayAllMode = sayAll.CURSOR_CARET
18341834
# Translators: Description for the Move past end of container command in browse mode.
18351835
script_movePastEndOfContainer.__doc__=_("Moves past the end of the container element, such as a list or table")
18361836

source/core.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,9 @@ def main():
303303
import speech
304304
log.debug("Initializing speech")
305305
speech.initialize()
306+
from speech import sayAll
307+
log.debug("Initializing sayAllHandler")
308+
sayAll.SayAllHandler.initializeSpeechWithoutPauses()
306309
if not globalVars.appArgs.minimal and (time.time()-globalVars.startTime)>5:
307310
log.debugWarning("Slow starting core (%.2f sec)" % (time.time()-globalVars.startTime))
308311
# Translators: This is spoken when NVDA is starting.

source/cursorManager.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import gui
1717
from gui import guiHelper
1818
import gui.contextHelp
19-
import sayAllHandler
19+
from speech import sayAll
2020
import review
2121
from scriptHandler import willSayAllResume, script
2222
import textInfos
@@ -197,7 +197,7 @@ def run():
197197
"find the next occurrence of the previously entered text string from the current cursor's position"
198198
),
199199
gesture="kb:NVDA+f3",
200-
resumeSayAllMode=sayAllHandler.CURSOR_CARET,
200+
resumeSayAllMode=sayAll.CURSOR_CARET,
201201
)
202202
def script_findNext(self,gesture):
203203
if not self._lastFindText:
@@ -215,7 +215,7 @@ def script_findNext(self,gesture):
215215
"find the previous occurrence of the previously entered text string from the current cursor's position"
216216
),
217217
gesture="kb:NVDA+shift+f3",
218-
resumeSayAllMode=sayAllHandler.CURSOR_CARET,
218+
resumeSayAllMode=sayAll.CURSOR_CARET,
219219
)
220220
def script_findPrevious(self,gesture):
221221
if not self._lastFindText:
@@ -230,11 +230,11 @@ def script_findPrevious(self,gesture):
230230

231231
def script_moveByPage_back(self,gesture):
232232
self._caretMovementScriptHelper(gesture,textInfos.UNIT_LINE,-config.conf["virtualBuffers"]["linesPerPage"],extraDetail=False)
233-
script_moveByPage_back.resumeSayAllMode=sayAllHandler.CURSOR_CARET
233+
script_moveByPage_back.resumeSayAllMode = sayAll.CURSOR_CARET
234234

235235
def script_moveByPage_forward(self,gesture):
236236
self._caretMovementScriptHelper(gesture,textInfos.UNIT_LINE,config.conf["virtualBuffers"]["linesPerPage"],extraDetail=False)
237-
script_moveByPage_forward.resumeSayAllMode=sayAllHandler.CURSOR_CARET
237+
script_moveByPage_forward.resumeSayAllMode = sayAll.CURSOR_CARET
238238

239239
def script_moveByCharacter_back(self,gesture):
240240
self._caretMovementScriptHelper(gesture,textInfos.UNIT_CHARACTER,-1,extraDetail=True,handleSymbols=True)
@@ -250,27 +250,27 @@ def script_moveByWord_forward(self,gesture):
250250

251251
def script_moveByLine_back(self,gesture):
252252
self._caretMovementScriptHelper(gesture,textInfos.UNIT_LINE,-1)
253-
script_moveByLine_back.resumeSayAllMode=sayAllHandler.CURSOR_CARET
253+
script_moveByLine_back.resumeSayAllMode = sayAll.CURSOR_CARET
254254

255255
def script_moveByLine_forward(self,gesture):
256256
self._caretMovementScriptHelper(gesture,textInfos.UNIT_LINE,1)
257-
script_moveByLine_forward.resumeSayAllMode=sayAllHandler.CURSOR_CARET
257+
script_moveByLine_forward.resumeSayAllMode = sayAll.CURSOR_CARET
258258

259259
def script_moveBySentence_back(self,gesture):
260260
self._caretMovementScriptHelper(gesture,textInfos.UNIT_SENTENCE,-1)
261-
script_moveBySentence_back.resumeSayAllMode=sayAllHandler.CURSOR_CARET
261+
script_moveBySentence_back.resumeSayAllMode = sayAll.CURSOR_CARET
262262

263263
def script_moveBySentence_forward(self,gesture):
264264
self._caretMovementScriptHelper(gesture,textInfos.UNIT_SENTENCE,1)
265-
script_moveBySentence_forward.resumeSayAllMode=sayAllHandler.CURSOR_CARET
265+
script_moveBySentence_forward.resumeSayAllMode = sayAll.CURSOR_CARET
266266

267267
def script_moveByParagraph_back(self,gesture):
268268
self._caretMovementScriptHelper(gesture,textInfos.UNIT_PARAGRAPH,-1)
269-
script_moveByParagraph_back.resumeSayAllMode=sayAllHandler.CURSOR_CARET
269+
script_moveByParagraph_back.resumeSayAllMode = sayAll.CURSOR_CARET
270270

271271
def script_moveByParagraph_forward(self,gesture):
272272
self._caretMovementScriptHelper(gesture,textInfos.UNIT_PARAGRAPH,1)
273-
script_moveByParagraph_forward.resumeSayAllMode=sayAllHandler.CURSOR_CARET
273+
script_moveByParagraph_forward.resumeSayAllMode = sayAll.CURSOR_CARET
274274

275275
def script_startOfLine(self,gesture):
276276
self._caretMovementScriptHelper(gesture,textInfos.UNIT_CHARACTER,posUnit=textInfos.UNIT_LINE,extraDetail=True,handleSymbols=True)

0 commit comments

Comments
 (0)