diff options
author | Maxim Devaev <[email protected]> | 2022-09-04 18:08:40 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2022-09-04 18:08:40 +0300 |
commit | ee3e224e396494cd0d69bb6167087a071a20349c (patch) | |
tree | 5becd28570e58a03c6e1e231d0db24c264a73f88 /kvmd/plugins/hid/__init__.py | |
parent | 4b75221e9470b4a009955d7677f16adf8e23e302 (diff) |
new typing style
Diffstat (limited to 'kvmd/plugins/hid/__init__.py')
-rw-r--r-- | kvmd/plugins/hid/__init__.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/kvmd/plugins/hid/__init__.py b/kvmd/plugins/hid/__init__.py index a0b582c7..2a6c075e 100644 --- a/kvmd/plugins/hid/__init__.py +++ b/kvmd/plugins/hid/__init__.py @@ -20,12 +20,8 @@ # ========================================================================== # -from typing import Tuple -from typing import Dict from typing import Iterable from typing import AsyncGenerator -from typing import Type -from typing import Optional from .. import BasePlugin from .. import get_plugin_class @@ -36,10 +32,10 @@ class BaseHid(BasePlugin): def sysprep(self) -> None: raise NotImplementedError - async def get_state(self) -> Dict: + async def get_state(self) -> dict: raise NotImplementedError - async def poll_state(self) -> AsyncGenerator[Dict, None]: + async def poll_state(self) -> AsyncGenerator[dict, None]: yield {} raise NotImplementedError @@ -51,7 +47,7 @@ class BaseHid(BasePlugin): # ===== - def send_key_events(self, keys: Iterable[Tuple[str, bool]]) -> None: + def send_key_events(self, keys: Iterable[tuple[str, bool]]) -> None: raise NotImplementedError def send_mouse_button_event(self, button: str, state: bool) -> None: @@ -68,7 +64,7 @@ class BaseHid(BasePlugin): def send_mouse_wheel_event(self, delta_x: int, delta_y: int) -> None: raise NotImplementedError - def set_params(self, keyboard_output: Optional[str]=None, mouse_output: Optional[str]=None) -> None: + def set_params(self, keyboard_output: (str | None)=None, mouse_output: (str | None)=None) -> None: _ = keyboard_output _ = mouse_output @@ -80,5 +76,5 @@ class BaseHid(BasePlugin): # ===== -def get_hid_class(name: str) -> Type[BaseHid]: +def get_hid_class(name: str) -> type[BaseHid]: return get_plugin_class("hid", name) # type: ignore |