🎨 black
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user