Skip to content

Commit

Permalink
Remove deprecated functions from sessionTracking (#14490)
Browse files Browse the repository at this point in the history
#14416 deprecated several functions for removal from winAPI.sessionTracking.
This was released in 2022.3.3, and scheduled for removal in 2023.1
  • Loading branch information
seanbudd authored Jan 4, 2023
1 parent a8a2c72 commit d7f192e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 79 deletions.
79 changes: 0 additions & 79 deletions source/winAPI/sessionTracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
)
import enum
from typing import (
Any,
Generator,
Optional,
)
Expand All @@ -32,7 +31,6 @@
from logHandler import log
from NVDAState import _TrackNVDAInitialization

from .types import HWNDValT
from ._wtsApi32 import (
WTSINFOEXW,
WTSQuerySessionInformation,
Expand Down Expand Up @@ -134,49 +132,6 @@ def pumpAll():
post_sessionLockStateChanged.notify(isNowLocked=windowsIsNowLocked)


def __getattr__(attrName: str) -> Any:
"""Module level `__getattr__` used to preserve backward compatibility."""
from buildVersion import version_year
import NVDAState
if not NVDAState._allowDeprecatedAPI():
return
if version_year < 2023:
if attrName == "isWindowsLocked":
log.warning(
"isWindowsLocked is deprecated for removal in 2023.1"
)
return _isWindowsLocked
elif attrName == "isLockStateSuccessfullyTracked":
log.warning(
"isLockStateSuccessfullyTracked is deprecated for removal in 2023.1"
)
return _isLockStateSuccessfullyTracked
elif attrName == "register":
log.warning(
"sessionTracking.register is deprecated for removal in 2023.1"
)
return _register
elif attrName == "unregister":
log.warning(
"sessionTracking.register is deprecated for removal in 2023.1"
)
return _unregister
elif attrName == "handleSessionChange":
log.warning(
"sessionTracking.handleSessionChange is deprecated for removal in 2023.1"
)
return _handleSessionChange
raise AttributeError(f"module {repr(__name__)} has no attribute {repr(attrName)}")


def isWindowsLocked() -> bool:
log.error(
"This function is deprecated, for removal in 2023.1. "
"It was never expected that add-on authors would use this function"
)
return _isWindowsLocked()


def _isWindowsLocked() -> bool:
if not _TrackNVDAInitialization.isInitializationComplete():
# Wait until initialization is complete,
Expand Down Expand Up @@ -233,40 +188,6 @@ def _isWindowsLocked_checkViaSessionQuery() -> bool:
return sessionQueryLockState == WTS_LockState.WTS_SESSIONSTATE_LOCK


def _isLockStateSuccessfullyTracked() -> bool:
log.error(
"NVDA no longer registers to receive session tracking notifications. "
"This function is deprecated, for removal in 2023.1. "
"It was never expected that add-on authors would use this function"
)
return True


def _register(handle: HWNDValT) -> bool:
log.error(
"NVDA no longer registers to receive session tracking notifications. "
"This function is deprecated, for removal in 2023.1. "
"It was never expected that add-on authors would use this function"
)
return True


def _unregister(handle: HWNDValT) -> None:
log.error(
"NVDA no longer registers to receive session tracking notifications. "
"This function is deprecated, for removal in 2023.1. "
"It was never expected that add-on authors would use this function"
)


def _handleSessionChange(newState: WindowsTrackedSession, sessionId: int) -> None:
log.error(
"NVDA no longer registers to receive session tracking notifications. "
"This function is deprecated, for removal in 2023.1. "
"It was never expected that add-on authors would use this function"
)


_WTS_INFO_POINTER_T = ctypes.POINTER(WTSINFOEXW)


Expand Down
7 changes: 7 additions & 0 deletions user_docs/en/changes.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ Please open a GitHub issue if your Add-on has an issue with updating to the new
-
-
- The ``NVDAHelper.RemoteLoader64`` class has been removed with no replacement. (#14449)
- The following functions in ``winAPI.sessionTracking`` are removed with no replacement. (#14416, #14490)
- ``isWindowsLocked``
- ``handleSessionChange``
- ``unregister``
- ``register``
- ``isLockStateSuccessfullyTracked``
-
-


Expand Down

0 comments on commit d7f192e

Please sign in to comment.