From 768fe0fc5778e4a52b2cee7c46b49fd976cb20ed Mon Sep 17 00:00:00 2001 From: Bill Dengler Date: Fri, 31 May 2019 06:30:05 -0400 Subject: [PATCH] Cleanup. --- source/NVDAObjects/UIA/winConsoleUIA.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/source/NVDAObjects/UIA/winConsoleUIA.py b/source/NVDAObjects/UIA/winConsoleUIA.py index 4c7af5194e3..adfa62282aa 100644 --- a/source/NVDAObjects/UIA/winConsoleUIA.py +++ b/source/NVDAObjects/UIA/winConsoleUIA.py @@ -41,7 +41,11 @@ def move(self, unit, direction, endPoint=None): # UIA adds thousands of blank lines to the end of the console. visiRanges = self.obj.UIATextPattern.GetVisibleRanges() lastVisiRange = visiRanges.GetElement(visiRanges.length - 1) - if self._rangeObj.CompareEndPoints(UIAHandler.TextPatternRangeEndpoint_Start, lastVisiRange, UIAHandler.TextPatternRangeEndpoint_End) >= 0: + if self._rangeObj.CompareEndPoints( + UIAHandler.TextPatternRangeEndpoint_Start, + lastVisiRange, + UIAHandler.TextPatternRangeEndpoint_End + ) >= 0: return 0 if unit == textInfos.UNIT_WORD and direction != 0: # UIA doesn't implement word movement, so we need to do it manually. @@ -74,10 +78,12 @@ def collapse(self): self._expandedToWord = False return super(consoleUIATextInfo, self).collapse() - def getTextWithFields(self,formatConfig=None): + def getTextWithFields(self, formatConfig=None): if self._expandedToWord: return [self.text] - return super(consoleUIATextInfo, self).getTextWithFields(formatConfig=formatConfig) + return super(consoleUIATextInfo, self).getTextWithFields( + formatConfig=formatConfig + ) def _get_text(self): if self._expandedToWord: @@ -130,7 +136,7 @@ def _getWordOffsets(self, offset): ) def _getCurrentWord(self): - lineInfo=self.copy() + lineInfo = self.copy() lineInfo.expand(textInfos.UNIT_LINE) lineText = lineInfo.text offset = self._getCurrentOffset() @@ -146,7 +152,10 @@ class winConsoleUIA(Terminal): def _reportNewText(self, line): # Additional typed character filtering beyond that in LiveText - if self._isTyping and time.time() - self._lastCharTime <= self._TYPING_TIMEOUT: + if ( + self._isTyping + and time.time() - self._lastCharTime <= self._TYPING_TIMEOUT + ): return super(winConsoleUIA, self)._reportNewText(line)