From 8171e67e707be38c82d82e2d2a17e0abf21ee92c Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Thu, 7 Jul 2022 15:27:53 -0500 Subject: [PATCH] git rid of closed property on fileprotocol --- jtftp/filesystem/__init__.py | 2 -- jtftp/filesystem/inmemory.py | 3 --- 2 files changed, 5 deletions(-) diff --git a/jtftp/filesystem/__init__.py b/jtftp/filesystem/__init__.py index 29a82c1..f998513 100644 --- a/jtftp/filesystem/__init__.py +++ b/jtftp/filesystem/__init__.py @@ -29,8 +29,6 @@ class FileMode(str, Enum): class FileProtocol(Protocol): - closed: bool - async def length(self) -> int | None: """Return the length of the file, or None if the length cannot be determined.""" raise NotImplementedError diff --git a/jtftp/filesystem/inmemory.py b/jtftp/filesystem/inmemory.py index e5879ba..a44123e 100644 --- a/jtftp/filesystem/inmemory.py +++ b/jtftp/filesystem/inmemory.py @@ -29,7 +29,6 @@ class InMemoryFile: filename: bytes mode: FileMode data: io.BytesIO - closed: bool complete_callback: Callable[[bytes, bytes], Awaitable[None]] | None incomplete_callback: Callable[[bytes, bytes], Awaitable[None]] | None @@ -48,7 +47,6 @@ class InMemoryFile: self.data = io.BytesIO(initial_bytes) self.complete_callback = complete_callback self.incomplete_callback = incomplete_callback - self.closed = False async def length(self) -> int: logger.debug("myfile length") @@ -72,7 +70,6 @@ class InMemoryFile: await self.complete_callback(self.filename, self.data.getvalue()) else: await self.incomplete_callback(self.filename, self.data.getvalue()) - self.closed = True class InMemoryFilesystem: