Skip to content

Commit 6d921fc

Browse files
authored
Merge ab689a2 into 2e37433
2 parents 2e37433 + ab689a2 commit 6d921fc

18 files changed

Lines changed: 366 additions & 355 deletions

File tree

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+
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: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,15 +365,15 @@ def script_nextParagraph(self,gesture):
365365
info._rangeObj.move(wdParagraph,1)
366366
info.updateCaret()
367367
self._caretScriptPostMovedHelper(textInfos.UNIT_PARAGRAPH,gesture,None)
368-
script_nextParagraph.resumeSayAllMode=sayAllHandler.CURSOR_CARET
368+
script_nextParagraph.resumeSayAllMode=sayAll.CURSOR_CARET
369369

370370
def script_previousParagraph(self,gesture):
371371
info=self.makeTextInfo(textInfos.POSITION_CARET)
372372
# #4375: keeping cemetrical with nextParagraph script.
373373
info._rangeObj.move(wdParagraph,-1)
374374
info.updateCaret()
375375
self._caretScriptPostMovedHelper(textInfos.UNIT_PARAGRAPH,gesture,None)
376-
script_previousParagraph.resumeSayAllMode=sayAllHandler.CURSOR_CARET
376+
script_previousParagraph.resumeSayAllMode=sayAll.CURSOR_CARET
377377

378378
def focusOnActiveDocument(self, officeChartObject):
379379
rangeStart=officeChartObject.Parent.Range.Start
@@ -465,4 +465,3 @@ def event_gainFocus(self):
465465
ctypes.windll.user32.AttachThreadInput(curThreadID,document.windowThreadID,False)
466466
if not document.WinwordWindowObject.active:
467467
document.WinwordWindowObject.activate()
468-

source/NVDAObjects/window/winword.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import locale
1515
import collections
1616
import colorsys
17-
import sayAllHandler
17+
import sayAll
1818
import eventHandler
1919
import braille
2020
from scriptHandler import script
@@ -946,7 +946,7 @@ def collapse(self,end=False):
946946
newEndOffset = self._rangeObj.end
947947
# the new endOffset should not have become smaller than the old endOffset, this could cause an infinite loop in
948948
# 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)
949+
# For an example of this see sayAll (specifically readTextHelper_generator in sayAll.py)
950950
if newEndOffset < oldEndOffset :
951951
raise RuntimeError
952952

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+
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+
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+
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+
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/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+
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)

source/editableText.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"""
1010

1111
import time
12-
import sayAllHandler
12+
import sayAll
1313
import api
1414
import review
1515
from baseObject import ScriptableObject
@@ -222,7 +222,7 @@ def _caretMoveBySentenceHelper(self, gesture, direction):
222222

223223
def script_caret_moveByLine(self,gesture):
224224
self._caretMovementScriptHelper(gesture, textInfos.UNIT_LINE)
225-
script_caret_moveByLine.resumeSayAllMode=sayAllHandler.CURSOR_CARET
225+
script_caret_moveByLine.resumeSayAllMode=sayAll.CURSOR_CARET
226226

227227
def script_caret_moveByCharacter(self,gesture):
228228
self._caretMovementScriptHelper(gesture, textInfos.UNIT_CHARACTER)
@@ -232,15 +232,15 @@ def script_caret_moveByWord(self,gesture):
232232

233233
def script_caret_moveByParagraph(self,gesture):
234234
self._caretMovementScriptHelper(gesture, textInfos.UNIT_PARAGRAPH)
235-
script_caret_moveByParagraph.resumeSayAllMode=sayAllHandler.CURSOR_CARET
235+
script_caret_moveByParagraph.resumeSayAllMode=sayAll.CURSOR_CARET
236236

237237
def script_caret_previousSentence(self,gesture):
238238
self._caretMoveBySentenceHelper(gesture, -1)
239-
script_caret_previousSentence.resumeSayAllMode=sayAllHandler.CURSOR_CARET
239+
script_caret_previousSentence.resumeSayAllMode=sayAll.CURSOR_CARET
240240

241241
def script_caret_nextSentence(self,gesture):
242242
self._caretMoveBySentenceHelper(gesture, 1)
243-
script_caret_nextSentence.resumeSayAllMode=sayAllHandler.CURSOR_CARET
243+
script_caret_nextSentence.resumeSayAllMode=sayAll.CURSOR_CARET
244244

245245
def _backspaceScriptHelper(self,unit,gesture):
246246
try:
@@ -394,7 +394,7 @@ def script_caret_changeSelection(self,gesture):
394394
try:
395395
self.reportSelectionChange(oldInfo)
396396
except:
397-
return
397+
return
398398

399399
__changeSelectionGestures = (
400400
"kb:shift+upArrow",

source/globalCommands.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import api
2020
import textInfos
2121
import speech
22-
import sayAllHandler
22+
import sayAll
2323
from NVDAObjects import NVDAObject, NVDAObjectTextInfo
2424
import globalVars
2525
from logHandler import log
@@ -1253,7 +1253,7 @@ def script_review_top(self,gesture):
12531253
@script(
12541254
# Translators: Input help mode message for move review cursor to previous line command.
12551255
description=_("Moves the review cursor to the previous line of the current navigator object and speaks it"),
1256-
resumeSayAllMode=sayAllHandler.CURSOR_REVIEW,
1256+
resumeSayAllMode=sayAll.CURSOR_REVIEW,
12571257
category=SCRCAT_TEXTREVIEW,
12581258
gestures=("kb:numpad7", "kb(laptop):NVDA+upArrow", "ts(text):flickUp")
12591259
)
@@ -1294,7 +1294,7 @@ def script_review_currentLine(self,gesture):
12941294
@script(
12951295
# Translators: Input help mode message for move review cursor to next line command.
12961296
description=_("Moves the review cursor to the next line of the current navigator object and speaks it"),
1297-
resumeSayAllMode=sayAllHandler.CURSOR_REVIEW,
1297+
resumeSayAllMode=sayAll.CURSOR_REVIEW,
12981298
category=SCRCAT_TEXTREVIEW,
12991299
gestures=("kb:numpad9", "kb(laptop):NVDA+downArrow", "ts(text):flickDown")
13001300
)
@@ -1675,7 +1675,7 @@ def script_showGui(self,gesture):
16751675
gestures=("kb:numpadPlus", "kb(laptop):NVDA+shift+a", "ts(text):3finger_flickDown")
16761676
)
16771677
def script_review_sayAll(self,gesture):
1678-
sayAllHandler.readText(sayAllHandler.CURSOR_REVIEW)
1678+
sayAll.SayAllHandler.readText(sayAll.CURSOR_REVIEW)
16791679

16801680
@script(
16811681
# Translators: Input help mode message for say all with system caret command.
@@ -1684,7 +1684,7 @@ def script_review_sayAll(self,gesture):
16841684
gestures=("kb(desktop):NVDA+downArrow", "kb(laptop):NVDA+a")
16851685
)
16861686
def script_sayAll(self,gesture):
1687-
sayAllHandler.readText(sayAllHandler.CURSOR_CARET)
1687+
sayAll.SayAllHandler.readText(sayAll.CURSOR_CARET)
16881688

16891689
def _reportFormattingHelper(self, info, browseable=False):
16901690
# Report all formatting-related changes regardless of user settings
@@ -1991,7 +1991,7 @@ def script_title(self,gesture):
19911991
def script_speakForeground(self,gesture):
19921992
obj=api.getForegroundObject()
19931993
if obj:
1994-
sayAllHandler.readObjects(obj)
1994+
sayAll.SayAllHandler.readObjects(obj)
19951995

19961996
@script(
19971997
gesture="kb(desktop):NVDA+control+f2"

0 commit comments

Comments
 (0)