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/apps/vnc/vncauth.py | |
parent | 4b75221e9470b4a009955d7677f16adf8e23e302 (diff) |
new typing style
Diffstat (limited to 'kvmd/apps/vnc/vncauth.py')
-rw-r--r-- | kvmd/apps/vnc/vncauth.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/kvmd/apps/vnc/vncauth.py b/kvmd/apps/vnc/vncauth.py index b0f702d1..c7c04864 100644 --- a/kvmd/apps/vnc/vncauth.py +++ b/kvmd/apps/vnc/vncauth.py @@ -22,9 +22,6 @@ import dataclasses -from typing import Tuple -from typing import Dict - from ...logging import get_logger from ... import aiofs @@ -53,7 +50,7 @@ class VncAuthManager: self.__path = path self.__enabled = enabled - async def read_credentials(self) -> Tuple[Dict[str, VncAuthKvmdCredentials], bool]: + async def read_credentials(self) -> tuple[dict[str, VncAuthKvmdCredentials], bool]: if self.__enabled: try: return (await self.__inner_read_credentials(), True) @@ -63,10 +60,10 @@ class VncAuthManager: get_logger(0).exception("Unhandled exception while reading VNCAuth passwd file") return ({}, (not self.__enabled)) - async def __inner_read_credentials(self) -> Dict[str, VncAuthKvmdCredentials]: + async def __inner_read_credentials(self) -> dict[str, VncAuthKvmdCredentials]: lines = (await aiofs.read(self.__path)).split("\n") - credentials: Dict[str, VncAuthKvmdCredentials] = {} + credentials: dict[str, VncAuthKvmdCredentials] = {} for (lineno, line) in enumerate(lines): if len(line.strip()) == 0 or line.lstrip().startswith("#"): continue |