🎨 black

This commit is contained in:
Mawoka
2022-04-09 11:06:36 +02:00
parent fd0b51d7e3
commit 6d5ba5ce74
18 changed files with 403 additions and 159 deletions
+2 -2
View File
@@ -11,13 +11,13 @@ class LocalStorage:
async def get_file(self, file_name: str) -> io.BytesIO | None:
try:
async with aiofiles.open(file=os.path.join(self.base_path, file_name), mode='rb') as f:
async with aiofiles.open(file=os.path.join(self.base_path, file_name), mode="rb") as f:
return io.BytesIO(await f.read())
except FileNotFoundError:
return None
async def write_file(self, file_name: str, data: bytes) -> None:
async with aiofiles.open(file=os.path.join(self.base_path, file_name), mode='wb') as f:
async with aiofiles.open(file=os.path.join(self.base_path, file_name), mode="wb") as f:
await f.write(data)
async def delete_file(self, file_names: [str]) -> None: