diff options
author | Devaev Maxim <[email protected]> | 2020-05-22 14:36:01 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-05-22 14:36:01 +0300 |
commit | 0fa0680bd7c28e246c70b5a5102e38a592bd0f0d (patch) | |
tree | d33b4d5e0bbed8c8e6600402990959900baba26d /kvmd | |
parent | 08950a5fbda89970af5043effa89886ae41fbb42 (diff) |
lint fixes
Diffstat (limited to 'kvmd')
-rw-r--r-- | kvmd/aiotools.py | 2 | ||||
-rw-r--r-- | kvmd/apps/kvmd/http.py | 4 | ||||
-rw-r--r-- | kvmd/apps/vnc/keysym.py | 4 | ||||
-rw-r--r-- | kvmd/apps/vnc/rfb/__init__.py | 2 | ||||
-rw-r--r-- | kvmd/apps/vnc/server.py | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/kvmd/aiotools.py b/kvmd/aiotools.py index bd4bd37e..6f76423e 100644 --- a/kvmd/aiotools.py +++ b/kvmd/aiotools.py @@ -204,5 +204,5 @@ async def run_region_task( if entered.done(): return - if (exc := task.exception()) is not None: # noqa: E203,E231 + if (exc := task.exception()) is not None: raise exc diff --git a/kvmd/apps/kvmd/http.py b/kvmd/apps/kvmd/http.py index 69dfa6ff..f46e8b13 100644 --- a/kvmd/apps/kvmd/http.py +++ b/kvmd/apps/kvmd/http.py @@ -69,7 +69,7 @@ def get_exposed_http(obj: object) -> List[HttpExposed]: handler=handler, ) for name in dir(obj) - if inspect.ismethod(handler := getattr(obj, name)) and getattr(handler, _HTTP_EXPOSED, False) # noqa: E203 + if inspect.ismethod(handler := getattr(obj, name)) and getattr(handler, _HTTP_EXPOSED, False) ] @@ -99,7 +99,7 @@ def get_exposed_ws(obj: object) -> List[WsExposed]: handler=handler, ) for name in dir(obj) - if inspect.ismethod(handler := getattr(obj, name)) and getattr(handler, _WS_EXPOSED, False) # noqa: E203 + if inspect.ismethod(handler := getattr(obj, name)) and getattr(handler, _WS_EXPOSED, False) ] diff --git a/kvmd/apps/vnc/keysym.py b/kvmd/apps/vnc/keysym.py index 5f35c28b..275eee5e 100644 --- a/kvmd/apps/vnc/keysym.py +++ b/kvmd/apps/vnc/keysym.py @@ -41,7 +41,7 @@ def build_symmap(path: str) -> Dict[int, str]: symmap[x11_code] = keymap.AT1_TO_WEB[at1_code] for (x11_code, at1_code) in _read_keyboard_layout(path).items(): - if (web_name := keymap.AT1_TO_WEB.get(at1_code)) is not None: # noqa: E203,E231 + if (web_name := keymap.AT1_TO_WEB.get(at1_code)) is not None: # mypy bug symmap[x11_code] = web_name # type: ignore return symmap @@ -89,7 +89,7 @@ def _read_keyboard_layout(path: str) -> Dict[int, int]: # Keysym to evdev (at1) parts = line.split() if len(parts) >= 2: - if (code := _resolve_keysym(parts[0])) != 0: # noqa: E203,E231 + if (code := _resolve_keysym(parts[0])) != 0: try: layout[code] = int(parts[1], 16) except ValueError as err: diff --git a/kvmd/apps/vnc/rfb/__init__.py b/kvmd/apps/vnc/rfb/__init__.py index 70ed087d..279c18bf 100644 --- a/kvmd/apps/vnc/rfb/__init__.py +++ b/kvmd/apps/vnc/rfb/__init__.py @@ -365,7 +365,7 @@ class RfbClient(RfbClientStream): # pylint: disable=too-many-instance-attribute } while True: msg_type = await self._read_number("B") - if (handler := handlers.get(msg_type)) is not None: # noqa: E203,E231 + if (handler := handlers.get(msg_type)) is not None: await handler() # type: ignore # mypy bug else: raise RfbError(f"Unknown message type: {msg_type}") diff --git a/kvmd/apps/vnc/server.py b/kvmd/apps/vnc/server.py index 15eb2402..e2ac697c 100644 --- a/kvmd/apps/vnc/server.py +++ b/kvmd/apps/vnc/server.py @@ -249,7 +249,7 @@ class _Client(RfbClient): # pylint: disable=too-many-instance-attributes # ===== async def _on_key_event(self, code: int, state: bool) -> None: - if (web_name := self.__symmap.get(code)) is not None: # noqa: E203,E231 + if (web_name := self.__symmap.get(code)) is not None: await self.__ws_writer_queue.put({ "event_type": "key", "event": {"key": web_name, "state": state}, |