Skip to content

Commit fe02c54

Browse files
Merge 616a43a into be26a2c
2 parents be26a2c + 616a43a commit fe02c54

42 files changed

Lines changed: 83 additions & 107 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.4
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
@@ -1864,8 +1864,7 @@ def _get_positionInfo(self):
18641864
@script(
18651865
description=_(
18661866
# Translators: the description for a script for Excel
1867-
"Reports the note on the current cell. "
1868-
"If pressed twice, presents the information in browse mode",
1867+
"Reports the note on the current cell. If pressed twice, presents the information in browse mode",
18691868
),
18701869
gesture="kb:NVDA+alt+c",
18711870
category=SCRCAT_SYSTEMCARET,

source/UIAHandler/__init__.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -820,13 +820,12 @@ def IUIAutomationEventHandler_HandleAutomationEvent(self, sender, eventID):
820820
):
821821
if _isDebug():
822822
log.debug(
823-
"HandleAutomationEvent: "
824-
f"Ignoring event {NVDAEventName} because ignored by object itself",
823+
f"HandleAutomationEvent: Ignoring event {NVDAEventName} because ignored by object itself",
825824
)
826825
return
827826
if _isDebug():
828827
log.debug(
829-
f"handleAutomationEvent: queuing NVDA event {NVDAEventName} " f"for NVDAObject {obj} ",
828+
f"handleAutomationEvent: queuing NVDA event {NVDAEventName} for NVDAObject {obj} ",
830829
)
831830
eventHandler.queueEvent(NVDAEventName, obj)
832831

@@ -912,7 +911,7 @@ def IUIAutomationFocusChangedEventHandler_HandleFocusChangedEvent(self, sender):
912911
return
913912
if _isDebug():
914913
log.debug(
915-
"handleFocusChangedEvent: Queuing NVDA gainFocus event " f"for obj {obj} ",
914+
f"handleFocusChangedEvent: Queuing NVDA gainFocus event for obj {obj} ",
916915
)
917916
eventHandler.queueEvent("gainFocus", obj)
918917

@@ -966,7 +965,7 @@ def IUIAutomationPropertyChangedEventHandler_HandlePropertyChangedEvent(
966965
):
967966
if _isDebug():
968967
log.debug(
969-
"propertyChange event is for focus. " f"Redirecting event to focus NVDAObject {focus}",
968+
f"propertyChange event is for focus. Redirecting event to focus NVDAObject {focus}",
970969
)
971970
obj = focus
972971
elif not self.isNativeUIAElement(sender):
@@ -1008,7 +1007,7 @@ def IUIAutomationPropertyChangedEventHandler_HandlePropertyChangedEvent(
10081007
)
10091008
if _isDebug():
10101009
log.debug(
1011-
f"handlePropertyChangeEvent: queuing NVDA {NVDAEventName} event " f"for NVDAObject {obj} ",
1010+
f"handlePropertyChangeEvent: queuing NVDA {NVDAEventName} event for NVDAObject {obj} ",
10121011
)
10131012
eventHandler.queueEvent(NVDAEventName, obj)
10141013

@@ -1061,7 +1060,7 @@ def IUIAutomationNotificationEventHandler_HandleNotificationEvent(
10611060
return
10621061
if _isDebug():
10631062
log.debug(
1064-
"Queuing UIA_notification NVDA event " f"for NVDAObject {obj}",
1063+
f"Queuing UIA_notification NVDA event for NVDAObject {obj}",
10651064
)
10661065
eventHandler.queueEvent(
10671066
"UIA_notification",
@@ -1352,8 +1351,7 @@ def getNearestWindowHandle(self, UIAElement):
13521351
return None
13531352
if _isDebug():
13541353
log.debug(
1355-
"Found ancestor element "
1356-
f"with valid windowHandle {self.getWindowHandleDebugString(window)}",
1354+
f"Found ancestor element with valid windowHandle {self.getWindowHandleDebugString(window)}",
13571355
)
13581356
# Cache for future use to improve performance.
13591357
UIAElement._nearestWindowHandle = window
@@ -1428,7 +1426,7 @@ def isNativeUIAElement(self, UIAElement):
14281426
if processID == globalVars.appPid:
14291427
if _isDebug():
14301428
log.debug(
1431-
"element is local to NVDA, " "treating as non-native.",
1429+
"element is local to NVDA, treating as non-native.",
14321430
)
14331431
return False
14341432
# 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
@@ -125,8 +125,7 @@ def _getLatestAddonsDataForVersion(self, apiVersion: str) -> Optional[bytes]:
125125
return None
126126
if response.status_code != requests.codes.OK:
127127
log.error(
128-
f"Unable to get data from API ({url}),"
129-
f" response ({response.status_code}): {response.content}",
128+
f"Unable to get data from API ({url}), response ({response.status_code}): {response.content}",
130129
)
131130
return None
132131
return response.content
@@ -141,8 +140,7 @@ def _getCacheHash(self) -> Optional[str]:
141140
return None
142141
if response.status_code != requests.codes.OK:
143142
log.error(
144-
f"Unable to get data from API ({url}),"
145-
f" response ({response.status_code}): {response.content}",
143+
f"Unable to get data from API ({url}), response ({response.status_code}): {response.content}",
146144
)
147145
return None
148146
cacheHash = response.json()

0 commit comments

Comments
 (0)