summaryrefslogtreecommitdiff
path: root/ATRI/utils/file.py
diff options
context:
space:
mode:
authorLint Action <[email protected]>2021-05-04 06:09:42 +0000
committerLint Action <[email protected]>2021-05-04 06:09:42 +0000
commit07a7e41f72cfa9dfd207a04445f4aa5b0b6fa3ce (patch)
treeb02c1b4e674acf6f56cf7335ad05acd0523af91c /ATRI/utils/file.py
parent8e94b4cd4aea1943a9639b900e33fe0fa1de5bb8 (diff)
downloadATRI-07a7e41f72cfa9dfd207a04445f4aa5b0b6fa3ce.tar.gz
ATRI-07a7e41f72cfa9dfd207a04445f4aa5b0b6fa3ce.tar.bz2
ATRI-07a7e41f72cfa9dfd207a04445f4aa5b0b6fa3ce.zip
:rotating_light: 自动进行代码格式化
Diffstat (limited to 'ATRI/utils/file.py')
-rw-r--r--ATRI/utils/file.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ATRI/utils/file.py b/ATRI/utils/file.py
index 7afbead..2cf03df 100644
--- a/ATRI/utils/file.py
+++ b/ATRI/utils/file.py
@@ -7,17 +7,17 @@ from ATRI.exceptions import RequestTimeOut, 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":