From 0e3ebac3627fe5039957d2d48d68d8620ff9384f Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Sat, 23 Jul 2022 18:34:58 +0300 Subject: reading images api --- kvmd/plugins/msd/relay/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'kvmd/plugins/msd/relay/__init__.py') diff --git a/kvmd/plugins/msd/relay/__init__.py b/kvmd/plugins/msd/relay/__init__.py index 2cdc5796..2b45bce3 100644 --- a/kvmd/plugins/msd/relay/__init__.py +++ b/kvmd/plugins/msd/relay/__init__.py @@ -217,6 +217,17 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes get_logger(0).info("MSD switched to KVM: %s", self.__device_info) self.__connected = connected + @contextlib.asynccontextmanager + async def read_image(self, name: str) -> AsyncGenerator[int, None]: + async with self.__working(): + if self is not None: # XXX: Vulture and pylint hack + raise MsdMultiNotSupported() + yield 1 + + async def read_image_chunk(self) -> bytes: + async with self.__working(): + raise MsdMultiNotSupported() + @contextlib.asynccontextmanager async def write_image(self, name: str, size: int) -> AsyncGenerator[int, None]: async with self.__working(): -- cgit v1.2.3