Skip to content

Commit 7f5eba6

Browse files
Merge 739e9e9 into 90a3c8d
2 parents 90a3c8d + 739e9e9 commit 7f5eba6

41 files changed

Lines changed: 82 additions & 106 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ repos:
9999

100100
- repo: https://github.com/astral-sh/ruff-pre-commit
101101
# Matches Ruff version in requirements.
102-
rev: v0.8.1
102+
rev: v0.9.9
103103
hooks:
104104
- id: ruff
105105
name: lint with ruff

source/COMRegistrationFixes/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def fixCOMRegistrations() -> None:
117117
OSMajorMinor = (winVer.major, winVer.minor)
118118
is64bit = winVer.processorArchitecture.endswith("64")
119119
log.debug(
120-
f"Fixing COM registrations for Windows {OSMajorMinor[0]}.{OSMajorMinor[1]}, " "{} bit.".format(
120+
f"Fixing COM registrations for Windows {OSMajorMinor[0]}.{OSMajorMinor[1]}, {{}} bit.".format(
121121
"64" if is64bit else "32",
122122
),
123123
)

source/IAccessibleHandler/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ def processFocusWinEvent(window, objectID, childID, force=False):
692692
"""
693693
if isMSAADebugLoggingEnabled():
694694
log.debug(
695-
f"Processing focus winEvent: {getWinEventLogInfo(window, objectID, childID)}, " f"force {force}",
695+
f"Processing focus winEvent: {getWinEventLogInfo(window, objectID, childID)}, force {force}",
696696
)
697697
windowClassName = winUser.getClassName(window)
698698
# Generally, we must ignore focus on child windows of SDM windows as we only want the SDM MSAA events.

source/JABHandler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
A11Y_PROPS_PATH = os.path.expanduser(r"~\.accessibility.properties")
4949
#: The content of ".accessibility.properties" when JAB is enabled.
5050
A11Y_PROPS_CONTENT = (
51-
"assistive_technologies=com.sun.java.accessibility.AccessBridge\n" "screen_magnifier_present=true\n"
51+
"assistive_technologies=com.sun.java.accessibility.AccessBridge\nscreen_magnifier_present=true\n"
5252
)
5353

5454
# Some utility functions to help with function defines

source/NVDAObjects/IAccessible/ia2TextMozilla.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def _getText(self, withFields, formatConfig=None):
386386
ti = self._getEmbedding(obj)
387387
if not ti:
388388
log.debugWarning(
389-
"_getEmbedding returned None while getting initial fields. " "Object probably dead.",
389+
"_getEmbedding returned None while getting initial fields. Object probably dead.",
390390
)
391391
return []
392392
obj = ti.obj
@@ -420,7 +420,7 @@ def _getText(self, withFields, formatConfig=None):
420420
ti = self._getEmbedding(obj)
421421
if not ti:
422422
log.debugWarning(
423-
"_getEmbedding returned None while ascending to get more text. " "Object probably dead.",
423+
"_getEmbedding returned None while ascending to get more text. Object probably dead.",
424424
)
425425
return []
426426
obj = ti.obj

source/NVDAObjects/UIA/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ def _getTextWithFields_text(
679679
furtherUIAFormatUnits = self.UIAFormatUnits if UIAFormatUnits is None else []
680680
if debug:
681681
log.debug(
682-
f"Walking by unit {unit}, " f"with further units of: {furtherUIAFormatUnits}",
682+
f"Walking by unit {unit}, with further units of: {furtherUIAFormatUnits}",
683683
)
684684
rangeIter = iterUIARangeByUnit(textRange, unit) if unit is not None else [textRange]
685685
for tempRange in rangeIter:
@@ -930,7 +930,7 @@ def _getTextWithFieldsForUIARange( # noqa: C901
930930
if lastChildEndDelta > 0:
931931
if debug:
932932
log.debug(
933-
"textRange ended part way through the child. " "Crop end of childRange to fit",
933+
"textRange ended part way through the child. Crop end of childRange to fit",
934934
)
935935
childRange.MoveEndpointByRange(
936936
UIAHandler.TextPatternRangeEndpoint_End,
@@ -957,8 +957,7 @@ def _getTextWithFieldsForUIARange( # noqa: C901
957957
elif childStartDelta < 0:
958958
if debug:
959959
log.debug(
960-
"textRange started part way through child. "
961-
"Cropping Start of child range to fit",
960+
"textRange started part way through child. Cropping Start of child range to fit",
962961
)
963962
childRange.MoveEndpointByRange(
964963
UIAHandler.TextPatternRangeEndpoint_Start,

source/NVDAObjects/window/excel.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,8 +1884,7 @@ def _get_positionInfo(self):
18841884
@script(
18851885
description=_(
18861886
# Translators: the description for a script for Excel
1887-
"Reports the note on the current cell. "
1888-
"If pressed twice, presents the information in browse mode",
1887+
"Reports the note on the current cell. If pressed twice, presents the information in browse mode",
18891888
),
18901889
gesture="kb:NVDA+alt+c",
18911890
category=SCRCAT_SYSTEMCARET,

source/UIAHandler/__init__.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -826,13 +826,12 @@ def IUIAutomationEventHandler_HandleAutomationEvent(self, sender, eventID):
826826
):
827827
if _isDebug():
828828
log.debug(
829-
"HandleAutomationEvent: "
830-
f"Ignoring event {NVDAEventName} because ignored by object itself",
829+
f"HandleAutomationEvent: Ignoring event {NVDAEventName} because ignored by object itself",
831830
)
832831
return
833832
if _isDebug():
834833
log.debug(
835-
f"handleAutomationEvent: queuing NVDA event {NVDAEventName} " f"for NVDAObject {obj} ",
834+
f"handleAutomationEvent: queuing NVDA event {NVDAEventName} for NVDAObject {obj} ",
836835
)
837836
eventHandler.queueEvent(NVDAEventName, obj)
838837

@@ -918,7 +917,7 @@ def IUIAutomationFocusChangedEventHandler_HandleFocusChangedEvent(self, sender):
918917
return
919918
if _isDebug():
920919
log.debug(
921-
"handleFocusChangedEvent: Queuing NVDA gainFocus event " f"for obj {obj} ",
920+
f"handleFocusChangedEvent: Queuing NVDA gainFocus event for obj {obj} ",
922921
)
923922
eventHandler.queueEvent("gainFocus", obj)
924923

@@ -972,7 +971,7 @@ def IUIAutomationPropertyChangedEventHandler_HandlePropertyChangedEvent(
972971
):
973972
if _isDebug():
974973
log.debug(
975-
"propertyChange event is for focus. " f"Redirecting event to focus NVDAObject {focus}",
974+
f"propertyChange event is for focus. Redirecting event to focus NVDAObject {focus}",
976975
)
977976
obj = focus
978977
elif not self.isNativeUIAElement(sender):
@@ -1014,7 +1013,7 @@ def IUIAutomationPropertyChangedEventHandler_HandlePropertyChangedEvent(
10141013
)
10151014
if _isDebug():
10161015
log.debug(
1017-
f"handlePropertyChangeEvent: queuing NVDA {NVDAEventName} event " f"for NVDAObject {obj} ",
1016+
f"handlePropertyChangeEvent: queuing NVDA {NVDAEventName} event for NVDAObject {obj} ",
10181017
)
10191018
eventHandler.queueEvent(NVDAEventName, obj)
10201019

@@ -1067,7 +1066,7 @@ def IUIAutomationNotificationEventHandler_HandleNotificationEvent(
10671066
return
10681067
if _isDebug():
10691068
log.debug(
1070-
"Queuing UIA_notification NVDA event " f"for NVDAObject {obj}",
1069+
f"Queuing UIA_notification NVDA event for NVDAObject {obj}",
10711070
)
10721071
eventHandler.queueEvent(
10731072
"UIA_notification",
@@ -1358,8 +1357,7 @@ def getNearestWindowHandle(self, UIAElement):
13581357
return None
13591358
if _isDebug():
13601359
log.debug(
1361-
"Found ancestor element "
1362-
f"with valid windowHandle {self.getWindowHandleDebugString(window)}",
1360+
f"Found ancestor element with valid windowHandle {self.getWindowHandleDebugString(window)}",
13631361
)
13641362
# Cache for future use to improve performance.
13651363
UIAElement._nearestWindowHandle = window
@@ -1434,7 +1432,7 @@ def isNativeUIAElement(self, UIAElement):
14341432
if processID == globalVars.appPid:
14351433
if _isDebug():
14361434
log.debug(
1437-
"element is local to NVDA, " "treating as non-native.",
1435+
"element is local to NVDA, treating as non-native.",
14381436
)
14391437
return False
14401438
# Whether this is a native element depends on whether its window natively supports UIA.

source/UIAHandler/_remoteOps/operation.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,12 @@ def _dumpRemoteLog(self):
296296
logOutput = self._remoteLog.localValue
297297
if logOutput:
298298
log.info(
299-
f"Remote log for execution {self._executionCount}\n"
300-
"--- Begin ---\n"
301-
f"{logOutput}"
302-
"--- end ---",
299+
f"Remote log for execution {self._executionCount}\n--- Begin ---\n{logOutput}--- end ---",
303300
)
304301

305302
def _dumpCompiletimeLog(self):
306303
log.info(
307-
"Dumping instructions:\n" "--- Begin ---\n" f"{self._rob.dumpInstructions()}" "--- End ---",
304+
f"Dumping instructions:\n--- Begin ---\n{self._rob.dumpInstructions()}--- End ---",
308305
)
309306

310307
def _executeUntilSuccess(self, maxTries: int) -> Generator[ExecutionResult, None, None]:
@@ -330,7 +327,7 @@ def _executeUntilSuccess(self, maxTries: int) -> Generator[ExecutionResult, None
330327
f"Error occured on execution try {self._executionCount}",
331328
)
332329
e.add_note(
333-
"Dumping instructions:\n" "--- Begin ---\n" f"{self._rob.dumpInstructions()}" "--- End ---",
330+
f"Dumping instructions:\n--- Begin ---\n{self._rob.dumpInstructions()}--- End ---",
334331
)
335332
raise
336333

source/addonStore/dataManager.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ def _getLatestAddonsDataForVersion(self, apiVersion: str) -> Optional[bytes]:
129129
return None
130130
if response.status_code != requests.codes.OK:
131131
log.error(
132-
f"Unable to get data from API ({url}),"
133-
f" response ({response.status_code}): {response.content}",
132+
f"Unable to get data from API ({url}), response ({response.status_code}): {response.content}",
134133
)
135134
return None
136135
return response.content
@@ -145,8 +144,7 @@ def _getCacheHash(self) -> Optional[str]:
145144
return None
146145
if response.status_code != requests.codes.OK:
147146
log.error(
148-
f"Unable to get data from API ({url}),"
149-
f" response ({response.status_code}): {response.content}",
147+
f"Unable to get data from API ({url}), response ({response.status_code}): {response.content}",
150148
)
151149
return None
152150
cacheHash = response.json()

0 commit comments

Comments
 (0)