Use aiofiles for image provider file writes
This commit is contained in:
parent
519d3610ef
commit
9decd58992
1
TODO.md
1
TODO.md
|
@ -13,6 +13,7 @@
|
|||
|
||||
- Refactoring
|
||||
- Use .mjs modules
|
||||
- SignIn/RememberAccount screens
|
||||
- Don't bake in size properties for components
|
||||
- Unfinished work in button-refactor branch
|
||||
- Button can get "hoverEnabled: false" to let HoverHandlers work
|
||||
|
|
|
@ -9,7 +9,7 @@ from pathlib import Path
|
|||
from typing import Tuple
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from atomicfile import AtomicFile
|
||||
import aiofiles
|
||||
from dataclasses import dataclass, field
|
||||
from PIL import Image as PILImage
|
||||
|
||||
|
@ -108,8 +108,8 @@ class Thumbnail:
|
|||
|
||||
self.local_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
with AtomicFile(str(self.local_path), "wb") as file:
|
||||
file.write(body)
|
||||
async with aiofiles.open(self.local_path, "wb") as file:
|
||||
await file.write(body)
|
||||
|
||||
return body
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user