mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-01 02:21:53 +08:00
reading images api
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user