mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
handle add-ons attempting to import isMac/isWin from aqt.utils
This commit is contained in:
parent
dcfc6d73a2
commit
c1612e641d
1 changed files with 11 additions and 1 deletions
|
@ -7,9 +7,10 @@ import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from typing import TYPE_CHECKING, Any, Literal, Sequence
|
from typing import TYPE_CHECKING, Any, Literal, Sequence, no_type_check
|
||||||
|
|
||||||
import aqt
|
import aqt
|
||||||
|
from anki._legacy import DeprecatedNamesMixinForModule
|
||||||
from anki.collection import Collection, HelpPage
|
from anki.collection import Collection, HelpPage
|
||||||
from anki.lang import TR, tr_legacyglobal # pylint: disable=unused-import
|
from anki.lang import TR, tr_legacyglobal # pylint: disable=unused-import
|
||||||
from anki.utils import (
|
from anki.utils import (
|
||||||
|
@ -1011,3 +1012,12 @@ class KeyboardModifiersPressed:
|
||||||
@property
|
@property
|
||||||
def alt(self) -> bool:
|
def alt(self) -> bool:
|
||||||
return bool(self._modifiers & Qt.KeyboardModifier.AltModifier)
|
return bool(self._modifiers & Qt.KeyboardModifier.AltModifier)
|
||||||
|
|
||||||
|
|
||||||
|
# add-ons attempting to import isMac from this module :-(
|
||||||
|
_deprecated_names = DeprecatedNamesMixinForModule(globals())
|
||||||
|
|
||||||
|
|
||||||
|
@no_type_check
|
||||||
|
def __getattr__(name: str) -> Any:
|
||||||
|
return _deprecated_names.__getattr__(name)
|
||||||
|
|
Loading…
Reference in a new issue