summaryrefslogtreecommitdiff
path: root/kvmd/apps/vnc
diff options
context:
space:
mode:
Diffstat (limited to 'kvmd/apps/vnc')
-rw-r--r--kvmd/apps/vnc/rfb/__init__.py5
-rw-r--r--kvmd/apps/vnc/server.py3
2 files changed, 5 insertions, 3 deletions
diff --git a/kvmd/apps/vnc/rfb/__init__.py b/kvmd/apps/vnc/rfb/__init__.py
index f10d7da2..f552321d 100644
--- a/kvmd/apps/vnc/rfb/__init__.py
+++ b/kvmd/apps/vnc/rfb/__init__.py
@@ -363,7 +363,8 @@ 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:
+ handler = handlers.get(msg_type)
+ if handler is not None:
await handler() # type: ignore # mypy bug
else:
raise RfbError(f"Unknown message type: {msg_type}")
@@ -372,7 +373,7 @@ class RfbClient(RfbClientStream): # pylint: disable=too-many-instance-attribute
# JpegCompression may only be used when bits-per-pixel is either 16 or 32
bits_per_pixel = (await self._read_struct("xxx BB?? HHH BBB xxx"))[0]
if bits_per_pixel not in [16, 32]:
- raise RfbError(f"Requested unsupported {bits_per_pixel=} for Tight JPEG; required 16 or 32")
+ raise RfbError(f"Requested unsupported bits_per_pixel={bits_per_pixel} for Tight JPEG; required 16 or 32")
async def __handle_set_encodings(self) -> None:
encodings_count = (await self._read_struct("x H"))[0]
diff --git a/kvmd/apps/vnc/server.py b/kvmd/apps/vnc/server.py
index 28e7db62..f552e026 100644
--- a/kvmd/apps/vnc/server.py
+++ b/kvmd/apps/vnc/server.py
@@ -239,7 +239,8 @@ class _Client(RfbClient): # pylint: disable=too-many-instance-attributes
async def _on_key_event(self, code: int, state: bool) -> None:
if self.__kvmd_ws:
- if (web_key := self.__symmap.get(code)) is not None:
+ web_key = self.__symmap.get(code)
+ if web_key is not None:
await self.__kvmd_ws.send_key_event(web_key.name, state)
async def _on_pointer_event(self, buttons: Dict[str, bool], wheel: Dict[str, int], move: Dict[str, int]) -> None: