reading images api

This commit is contained in:
Maxim Devaev
2022-07-23 18:34:58 +03:00
parent de14053725
commit 0e3ebac362
10 changed files with 145 additions and 2 deletions

View File

@@ -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():