summaryrefslogtreecommitdiff
path: root/kvmd/apps/vnc
diff options
context:
space:
mode:
authorOleg Girko <[email protected]>2020-08-18 03:44:06 +0300
committerOleg Girko <[email protected]>2020-09-01 19:24:13 +0300
commit2dbf11428f01b748619ac5b25215c7d7a0b07dbc (patch)
treeabdc93c161c4c0678106dc66ffde3f66b98ef0c4 /kvmd/apps/vnc
parent5307765399c1a3280eeb33380047195a118eb935 (diff)
Remove all uses of assignment expressions.
This is needed to port to Python 3.7 because Raspbian 10 doesn't have Python 3.8. Signed-off-by: Oleg Girko <[email protected]>
Diffstat (limited to 'kvmd/apps/vnc')
-rw-r--r--kvmd/apps/vnc/rfb/__init__.py3
-rw-r--r--kvmd/apps/vnc/server.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/kvmd/apps/vnc/rfb/__init__.py b/kvmd/apps/vnc/rfb/__init__.py
index f10d7da2..765d1574 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}")
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: