summaryrefslogtreecommitdiff
path: root/kvmd/plugins/msd/relay
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-08-03 19:44:08 +0300
committerMaxim Devaev <[email protected]>2022-08-03 19:44:08 +0300
commit9925198762ab355343eb759e8117827a17645508 (patch)
tree99baab39d3655f96592c07966d696f469ccb6c62 /kvmd/plugins/msd/relay
parent0809daa199345c84646ad813a527eac5bc4fa728 (diff)
refactored msd reader api
Diffstat (limited to 'kvmd/plugins/msd/relay')
-rw-r--r--kvmd/plugins/msd/relay/__init__.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/kvmd/plugins/msd/relay/__init__.py b/kvmd/plugins/msd/relay/__init__.py
index ff83010e..e8dd995f 100644
--- a/kvmd/plugins/msd/relay/__init__.py
+++ b/kvmd/plugins/msd/relay/__init__.py
@@ -50,6 +50,7 @@ from .. import MsdDisconnectedError
from .. import MsdMultiNotSupported
from .. import MsdCdromNotSupported
from .. import MsdRwNotSupported
+from .. import BaseMsdReader
from .. import BaseMsd
from .. import MsdImageWriter
@@ -218,15 +219,11 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
self.__connected = connected
@contextlib.asynccontextmanager
- async def read_image(self, name: str) -> AsyncGenerator[int, None]:
+ async def read_image(self, name: str) -> AsyncGenerator[BaseMsdReader, 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()
+ yield BaseMsdReader()
@contextlib.asynccontextmanager
async def write_image(self, name: str, size: int, remove_incomplete: Optional[bool]) -> AsyncGenerator[int, None]: