Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelDCurran committed Apr 3, 2024
1 parent a251c61 commit 0aa821c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
26 changes: 22 additions & 4 deletions source/NVDAObjects/UIA/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2183,13 +2183,31 @@ def event_UIA_notification(
messageID = None
# Add a new UIA notification processing constant.
NotificationProcessing_ImportantCurrentThenMostRecent = 5
speakOnlyMostRecentWithSameID = notificationProcessing in (UIAHandler.NotificationProcessing_MostRecent, UIAHandler.NotificationProcessing_CurrentThenMostRecent, UIAHandler.NotificationProcessing_ImportantMostRecent, NotificationProcessing_ImportantCurrentThenMostRecent)
interuptCurrentWithSameID = notificationProcessing in (UIAHandler.NotificationProcessing_MostRecent, UIAHandler.NotificationProcessing_ImportantMostRecent)
if notificationProcessing in (UIAHandler.NotificationProcessing_ImportantAll, UIAHandler.NotificationProcessing_ImportantMostRecent, NotificationProcessing_ImportantCurrentThenMostRecent):
speakOnlyMostRecentWithSameID = notificationProcessing in (
UIAHandler.NotificationProcessing_MostRecent,
UIAHandler.NotificationProcessing_CurrentThenMostRecent,
UIAHandler.NotificationProcessing_ImportantMostRecent,
NotificationProcessing_ImportantCurrentThenMostRecent,
)
interuptCurrentWithSameID = notificationProcessing in (
UIAHandler.NotificationProcessing_MostRecent,
UIAHandler.NotificationProcessing_ImportantMostRecent,
)
if notificationProcessing in (
UIAHandler.NotificationProcessing_ImportantAll,
UIAHandler.NotificationProcessing_ImportantMostRecent,
NotificationProcessing_ImportantCurrentThenMostRecent,
):
speechPriority = speech.Spri.NOW
else:
speechPriority = speech.Spri.NEXT
ui.message(displayString, speechPriority=speechPriority, messageID=messageID, speakOnlyMostRecentWithSameID=speakOnlyMostRecentWithSameID, interuptCurrentWithSameID=interuptCurrentWithSameID)
ui.message(
displayString,
speechPriority=speechPriority,
messageID=messageID,
speakOnlyMostRecentWithSameID=speakOnlyMostRecentWithSameID,
interuptCurrentWithSameID=interuptCurrentWithSameID
)

def event_UIA_dragDropEffect(self):
# UIA drag drop effect was introduced in Windows 8.
Expand Down
6 changes: 3 additions & 3 deletions source/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ def __init__(self, uniqueID, skipFirst=False):
self._index = len(oldCommands)
self._liveCommands.add(self)
self._uniqueID = uniqueID
firstLoop = skipFirst
firstLoop = skipFirst
for oldCommand in sorted(oldCommands, key=lambda x: x._index):
if oldCommand._uniqueID == uniqueID and not oldCommand._killed:
if not firstLoop:
oldCommand._killed = True
firstLoop=False
firstLoop = False

def _checkIfValid(self):
return not self._killed
Expand All @@ -161,7 +161,7 @@ def message(
text: str,
speechPriority: Optional[speech.Spri] = None,
brailleText: Optional[str] = None,
messageID: str| None = None,
messageID: str | None = None,
speakOnlyMostRecentWithSameID=False,
interuptCurrentWithSameID=False,
):
Expand Down

0 comments on commit 0aa821c

Please sign in to comment.