Skip to content

Commit

Permalink
Merge pull request #275 from spyoungtech/fix-list-windows-typing
Browse files Browse the repository at this point in the history
Fix list windows typing
  • Loading branch information
spyoungtech authored Mar 21, 2024
2 parents 066f33b + 185258f commit 0713efb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ahk/_async/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions ahk/_sync/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: ...
Expand Down
4 changes: 2 additions & 2 deletions docs/extending.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
'''
Expand Down Expand Up @@ -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 <https://www.autohotkey.com/docs/v1/Scripts.htm#auto>`_
- 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.

0 comments on commit 0713efb

Please sign in to comment.