-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from mkzeender/dev
Dev
- Loading branch information
Showing
32 changed files
with
883 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,4 @@ jobs: | |
pyright | ||
- name: Test with pytest | ||
run: | | ||
pytest | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,30 @@ | ||
from typing import TYPE_CHECKING | ||
from .global_state import config | ||
from . import ahk_run | ||
from .convenience.py_lib import pylib as Python | ||
from .ahk_run import get_ahk | ||
from ._unset_type import UNSET | ||
from .proxies._seq_iter import iterator | ||
|
||
|
||
if TYPE_CHECKING: | ||
from autohotpy.static_typing import AhkBuiltins as ahk | ||
else: | ||
ahk = ahk_run.run_str() | ||
import autohotpy.static_typing | ||
|
||
ahk = autohotpy.static_typing.AhkBuiltins() | ||
|
||
|
||
__all__ = ["ahk", "get_ahk", "Python", "config", "UNSET", "iterator"] | ||
|
||
|
||
def __getattr__(__name): | ||
global ahk | ||
if __name == "ahk": | ||
ahk = get_ahk() | ||
return ahk | ||
|
||
import sys | ||
|
||
raise AttributeError( | ||
f"autohotpy has no attribute named {__name}", | ||
name=__name, | ||
obj=sys.modules[__name__], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from typing import Any, Self | ||
|
||
|
||
class UnsetType: | ||
__slots__ = ("__weakref__",) | ||
_UNSET = None | ||
|
||
def __new__(cls) -> Self: | ||
if cls._UNSET is None: | ||
cls._UNSET = super().__new__(cls) | ||
return cls._UNSET | ||
|
||
def __repr__(self) -> str: | ||
return "UNSET" | ||
|
||
def __str__(self) -> str: | ||
return "<UNSET>" | ||
|
||
def __bool__(self) -> bool: | ||
return False | ||
|
||
def __reduce__(self) -> str | tuple[Any, ...]: | ||
return (UnsetType, ()) | ||
|
||
|
||
UNSET = UnsetType() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.