Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c5a4a8c
Prototype for Windows Terminal: Use notifications instead of monitori…
LeonarddeR Aug 22, 2022
60d4b36
Comments
LeonarddeR Aug 22, 2022
5054d0c
Apply suggestions from code review
LeonarddeR Aug 24, 2022
f9771b3
Fix imports
LeonarddeR Aug 24, 2022
2cafc67
Import ordering
LeonarddeR Aug 24, 2022
f39870b
Merge branch 'master' into wtNotifications
codeofdusk Aug 29, 2022
1176505
Remove Windows Terminal from textChangeUIAClassNames as it no longer …
codeofdusk Aug 29, 2022
9735811
Suppress more blanks
codeofdusk Aug 29, 2022
3b678c4
Merge branch 'master' into wtNotifications
codeofdusk Sep 20, 2022
f79d0f6
Merge branch 'master' into wtNotifications
codeofdusk Sep 29, 2022
a2bff15
Merge branch 'master' into wtNotifications
codeofdusk Oct 18, 2022
40ca1e0
Place new functionality behind a feature flag
codeofdusk Oct 18, 2022
73b5367
Remove dead code
codeofdusk Oct 18, 2022
497e3f3
Rename flag enum
codeofdusk Oct 20, 2022
2cba013
Apply suggestions from code review
codeofdusk Oct 20, 2022
69f621e
Rename _shouldUseWtNotifications to _shouldUseWindowsTerminalNotifica…
codeofdusk Oct 20, 2022
81fe5e0
Apply suggestions from code review
codeofdusk Oct 21, 2022
6a1bbb2
Style
codeofdusk Oct 21, 2022
e043da9
Add types
codeofdusk Oct 24, 2022
b6620a7
Fix hyphen
codeofdusk Oct 24, 2022
f992db5
Add alias
codeofdusk Oct 24, 2022
1b915a0
Use getattr
codeofdusk Oct 24, 2022
715168b
Update source/NVDAObjects/UIA/winConsoleUIA.py
codeofdusk Oct 24, 2022
5139a56
Rename
codeofdusk Oct 24, 2022
b706a19
Merge branch 'wtNotifications' of https://github.com/leonardder/nvda …
codeofdusk Oct 24, 2022
5fe8559
Merge remote-tracking branch 'origin/master' into wtNotifications
seanbudd Oct 25, 2022
f6f6563
update changes
seanbudd Oct 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use getattr
  • Loading branch information
codeofdusk committed Oct 24, 2022
commit 1b915a071d297f5d1d963a2b6d02f0faa531f93a
23 changes: 16 additions & 7 deletions source/NVDAObjects/UIA/winConsoleUIA.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import controlTypes
import ctypes
import NVDAHelper
import NVDAState
import speech
import textInfos
import textUtils
Expand All @@ -16,7 +17,7 @@
from comtypes import COMError
from diffHandler import prefer_difflib
from logHandler import log
from typing import Optional
from typing import Any, Optional
Comment thread
codeofdusk marked this conversation as resolved.
Outdated
from UIAHandler.utils import _getConhostAPILevel, _shouldUseWindowsTerminalNotifications
from UIAHandler.constants import WinConsoleAPILevel
from . import UIA, UIATextInfo
Expand Down Expand Up @@ -465,9 +466,17 @@ def event_UIA_notification(
if line and not line.isspace(): # Don't say "blank" during autoread
speech.speakText(line)

#: WinTerminalUIA is kept for backwards compatibility.
WinTerminalUIA = (
NotificationsBasedWinTerminalUIA
if _shouldUseWindowsTerminalNotifications()
else DiffBasedWinTerminalUIA
)

def __getattr__(attrName: str) -> Any:
"""Module level `__getattr__` used to preserve backward compatibility."""
if attrName == "WinTerminalUIA" and NVDAState._allowDeprecatedAPI():
log.warning(
"WinTerminalUIA is deprecated. "
"Instead use DiffBasedWinTerminalUIA or NotificationsBasedWinTerminalUIA"
)
return (
NotificationsBasedWinTerminalUIA
if _shouldUseWindowsTerminalNotifications()
else DiffBasedWinTerminalUIA
)
raise AttributeError(f"module {repr(__name__)} has no attribute {repr(attrName)}")