diff options
author | Kyomotoi <[email protected]> | 2021-05-04 14:27:56 +0800 |
---|---|---|
committer | Kyomotoi <[email protected]> | 2021-05-04 14:27:56 +0800 |
commit | ea7f48011c34fdaec7e91af7eb373c8174e439e6 (patch) | |
tree | e4f14eaacde37774d49e7f98ac1ff4635049d80a /ATRI/utils/file.py | |
parent | 07a7e41f72cfa9dfd207a04445f4aa5b0b6fa3ce (diff) | |
download | ATRI-ea7f48011c34fdaec7e91af7eb373c8174e439e6.tar.gz ATRI-ea7f48011c34fdaec7e91af7eb373c8174e439e6.tar.bz2 ATRI-ea7f48011c34fdaec7e91af7eb373c8174e439e6.zip |
✨🐛 更新
新增:老婆!
新增:涩图
修复:manage中出现的bug
优化:nsfw不再用float,换为int
Diffstat (limited to 'ATRI/utils/file.py')
-rw-r--r-- | ATRI/utils/file.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ATRI/utils/file.py b/ATRI/utils/file.py index 2cf03df..a873647 100644 --- a/ATRI/utils/file.py +++ b/ATRI/utils/file.py @@ -2,22 +2,22 @@ import aiofiles import urllib from pathlib import Path -from ATRI.exceptions import RequestTimeOut, WriteError +from ATRI.exceptions import WriteError from .request import get_content -async def write_file(path: Path, text, encoding="utf-8") -> None: +async def write_file(path: Path, text, encoding='utf-8') -> None: try: - async with aiofiles.open(path, "w", encoding=encoding) as target: + async with aiofiles.open(path, 'w', encoding=encoding) as target: await target.write(text) except WriteError: raise WriteError("Writing file failed!") -async def open_file(path: Path, method, encoding="utf-8"): +async def open_file(path: Path, method, encoding='utf-8'): try: - async with aiofiles.open(path, "r", encoding=encoding) as target: + async with aiofiles.open(path, 'r', encoding=encoding) as target: if method == "read": return target.read() elif method == "readlines": |