Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #255

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ repos:
- id: trailing-whitespace
- id: double-quote-string-fixer
- repo: https://github.com/psf/black
rev: '23.12.1'
rev: '24.2.0'
hooks:
- id: black
args:
Expand Down
15 changes: 5 additions & 10 deletions ahk/_async/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@
T_SyncFuture = TypeVar('T_SyncFuture')


class AHKProtocolError(Exception):
...
class AHKProtocolError(Exception): ...


class AsyncFutureResult(Generic[T_AsyncFuture]): # unasync: remove
Expand Down Expand Up @@ -191,8 +190,7 @@ def result(self, timeout: Optional[float] = None) -> T_SyncFuture:

@runtime_checkable
class Killable(Protocol):
def kill(self) -> None:
...
def kill(self) -> None: ...


def kill(proc: Killable) -> None:
Expand All @@ -213,17 +211,14 @@ def async_assert_send_nonblocking_type_correct(
class Communicable(Protocol):
runargs: List[str]

def communicate(self, input_bytes: Optional[bytes], timeout: Optional[int] = None) -> Tuple[bytes, bytes]:
...
def communicate(self, input_bytes: Optional[bytes], timeout: Optional[int] = None) -> Tuple[bytes, bytes]: ...

async def acommunicate( # unasync: remove
self, input_bytes: Optional[bytes], timeout: Optional[int] = None
) -> Tuple[bytes, bytes]:
...
) -> Tuple[bytes, bytes]: ...

@property
def returncode(self) -> Optional[int]:
...
def returncode(self) -> Optional[int]: ...


class AsyncAHKProcess:
Expand Down
39 changes: 13 additions & 26 deletions ahk/_async/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
from .transport import AsyncFutureResult


class WindowNotFoundException(Exception):
...
class WindowNotFoundException(Exception): ...


AsyncPropertyReturnStr: TypeAlias = Coroutine[None, None, str] # unasync: remove
Expand Down Expand Up @@ -535,20 +534,16 @@ async def redraw(self, *, blocking: bool = True) -> Union[None, AsyncFutureResul
)

@overload
async def set_style(self, style: str) -> bool:
...
async def set_style(self, style: str) -> bool: ...

@overload
async def set_style(self, style: str, *, blocking: Literal[True]) -> bool:
...
async def set_style(self, style: str, *, blocking: Literal[True]) -> bool: ...

@overload
async def set_style(self, style: str, *, blocking: Literal[False]) -> AsyncFutureResult[bool]:
...
async def set_style(self, style: str, *, blocking: Literal[False]) -> AsyncFutureResult[bool]: ...

@overload
async def set_style(self, style: str, *, blocking: bool = True) -> Union[bool, AsyncFutureResult[bool]]:
...
async def set_style(self, style: str, *, blocking: bool = True) -> Union[bool, AsyncFutureResult[bool]]: ...

async def set_style(self, style: str, *, blocking: bool = True) -> Union[bool, AsyncFutureResult[bool]]:
return await self._engine.win_set_style(
Expand All @@ -560,20 +555,16 @@ async def set_style(self, style: str, *, blocking: bool = True) -> Union[bool, A
)

@overload
async def set_ex_style(self, style: str) -> bool:
...
async def set_ex_style(self, style: str) -> bool: ...

@overload
async def set_ex_style(self, style: str, *, blocking: Literal[False]) -> AsyncFutureResult[bool]:
...
async def set_ex_style(self, style: str, *, blocking: Literal[False]) -> AsyncFutureResult[bool]: ...

@overload
async def set_ex_style(self, style: str, *, blocking: Literal[True]) -> bool:
...
async def set_ex_style(self, style: str, *, blocking: Literal[True]) -> bool: ...

@overload
async def set_ex_style(self, style: str, *, blocking: bool = True) -> Union[bool, AsyncFutureResult[bool]]:
...
async def set_ex_style(self, style: str, *, blocking: bool = True) -> Union[bool, AsyncFutureResult[bool]]: ...

async def set_ex_style(self, style: str, *, blocking: bool = True) -> Union[bool, AsyncFutureResult[bool]]:
return await self._engine.win_set_ex_style(
Expand All @@ -585,20 +576,16 @@ async def set_ex_style(self, style: str, *, blocking: bool = True) -> Union[bool
)

@overload
async def set_region(self, options: str) -> bool:
...
async def set_region(self, options: str) -> bool: ...

@overload
async def set_region(self, options: str, *, blocking: Literal[True]) -> bool:
...
async def set_region(self, options: str, *, blocking: Literal[True]) -> bool: ...

@overload
async def set_region(self, options: str, *, blocking: Literal[False]) -> AsyncFutureResult[bool]:
...
async def set_region(self, options: str, *, blocking: Literal[False]) -> AsyncFutureResult[bool]: ...

@overload
async def set_region(self, options: str, *, blocking: bool = True) -> Union[bool, AsyncFutureResult[bool]]:
...
async def set_region(self, options: str, *, blocking: bool = True) -> Union[bool, AsyncFutureResult[bool]]: ...

async def set_region(self, options: str, *, blocking: bool = True) -> Union[bool, AsyncFutureResult[bool]]:
return await self._engine.win_set_region(
Expand Down
6 changes: 2 additions & 4 deletions ahk/_hotkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ def on_clipboard_change(
self.restart()


class STOP:
...
class STOP: ...


class ThreadedHotkeyTransport(HotkeyTransportBase):
Expand Down Expand Up @@ -453,8 +452,7 @@ def _validate(self) -> None:

@runtime_checkable
class Killable(Protocol):
def kill(self) -> None:
...
def kill(self) -> None: ...


def kill(proc: Killable) -> None:
Expand Down
3 changes: 1 addition & 2 deletions ahk/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ def __repr__(self) -> str:

@runtime_checkable
class Stringable(Protocol):
def __str__(self) -> str:
...
def __str__(self) -> str: ...


class KeyModifier(Key):
Expand Down
6 changes: 2 additions & 4 deletions ahk/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,15 @@
from typing import Union


class OutOfMessageTypes(Exception):
...
class OutOfMessageTypes(Exception): ...


Position = namedtuple('Position', ('x', 'y', 'width', 'height'))


@runtime_checkable
class BytesLineReadable(Protocol):
def readline(self) -> bytes:
...
def readline(self) -> bytes: ...


def is_window_control_list_response(resp_obj: object) -> TypeGuard[Tuple[str, List[Tuple[str, str]]]]:
Expand Down
2 changes: 1 addition & 1 deletion buildunasync.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'async_sleep': 'sleep',
'AsyncFutureResult': 'FutureResult',
'_async_run_nonblocking': '_sync_run_nonblocking',
'acommunicate': 'communicate'
'acommunicate': 'communicate',
# "__aenter__": "__aenter__",
},
),
Expand Down