diff --git a/ahk/_async/engine.py b/ahk/_async/engine.py index d36d730..ab0c068 100644 --- a/ahk/_async/engine.py +++ b/ahk/_async/engine.py @@ -702,7 +702,7 @@ def _format_win_args( @overload async def list_windows(self, title: str = '', text: str = '', exclude_title: str = '', exclude_text: str = '', *, title_match_mode: Optional[TitleMatchMode] = None, detect_hidden_windows: Optional[bool] = None) -> List[AsyncWindow]: ... @overload - async def list_windows(self, title: str = '', text: str = '', exclude_title: str = '', exclude_text: str = '', *, title_match_mode: Optional[TitleMatchMode] = None, detect_hidden_windows: Optional[bool] = None, blocking: Literal[False]) -> Union[List[AsyncWindow], AsyncFutureResult[List[AsyncWindow]]]: ... + async def list_windows(self, title: str = '', text: str = '', exclude_title: str = '', exclude_text: str = '', *, title_match_mode: Optional[TitleMatchMode] = None, detect_hidden_windows: Optional[bool] = None, blocking: Literal[False]) -> AsyncFutureResult[List[AsyncWindow]]: ... @overload async def list_windows(self, title: str = '', text: str = '', exclude_title: str = '', exclude_text: str = '', *, title_match_mode: Optional[TitleMatchMode] = None, detect_hidden_windows: Optional[bool] = None, blocking: Literal[True]) -> List[AsyncWindow]: ... @overload diff --git a/ahk/_sync/engine.py b/ahk/_sync/engine.py index cb43e1b..9e2df2d 100644 --- a/ahk/_sync/engine.py +++ b/ahk/_sync/engine.py @@ -697,7 +697,7 @@ def _format_win_args( @overload def list_windows(self, title: str = '', text: str = '', exclude_title: str = '', exclude_text: str = '', *, title_match_mode: Optional[TitleMatchMode] = None, detect_hidden_windows: Optional[bool] = None) -> List[Window]: ... @overload - def list_windows(self, title: str = '', text: str = '', exclude_title: str = '', exclude_text: str = '', *, title_match_mode: Optional[TitleMatchMode] = None, detect_hidden_windows: Optional[bool] = None, blocking: Literal[False]) -> Union[List[Window], FutureResult[List[Window]]]: ... + def list_windows(self, title: str = '', text: str = '', exclude_title: str = '', exclude_text: str = '', *, title_match_mode: Optional[TitleMatchMode] = None, detect_hidden_windows: Optional[bool] = None, blocking: Literal[False]) -> FutureResult[List[Window]]: ... @overload def list_windows(self, title: str = '', text: str = '', exclude_title: str = '', exclude_text: str = '', *, title_match_mode: Optional[TitleMatchMode] = None, detect_hidden_windows: Optional[bool] = None, blocking: Literal[True]) -> List[Window]: ... @overload @@ -1590,7 +1590,6 @@ def menu_tray_icon_hide(self) -> None: self._transport.function_call('AHKMenuTrayHide') return None - # fmt: off @overload def sound_beep(self, frequency: int = 523, duration: int = 150) -> None: ... diff --git a/docs/extending.rst b/docs/extending.rst index 3b3f898..43423ff 100644 --- a/docs/extending.rst +++ b/docs/extending.rst @@ -97,7 +97,7 @@ containing the AutoHotkey code we just wrote above. from ahk.extensions import Extension from typing import Literal - script_text = r'''\ + script_text = r''' ; a string of your AHK script ; Omitted here for brevity -- copy/paste from the previous code block ''' @@ -322,4 +322,4 @@ Notes - AHK functions MUST always return a message. Failing to return a message will result in an exception being raised. If the function should return nothing, use ``return FormatNoValueResponse()`` which will translate to ``None`` in Python. - You cannot define hotkeys, hotstrings, or write any AutoHotkey code that would cause the end of the `auto-execute section `_ - Extensions must be imported (anywhere, at least once) *before* instantiating the ``AHK`` instance -- Although extensions can be declared explicitly, using ``extensions='auto'`` is generally the easiest method for enabling all available extensions +- Although extensions can be declared explicitly, using ``extensions='auto'`` can be used for convenience/portability.