summaryrefslogtreecommitdiff
path: root/ATRI/utils/file.py
diff options
context:
space:
mode:
authorLint Action <[email protected]>2021-05-04 06:29:07 +0000
committerLint Action <[email protected]>2021-05-04 06:29:07 +0000
commit8804f1e10d507ba293fafc77a7e93d3a84a5814b (patch)
treee107da61f76dfe64dfb96feb5e961bbc4bbd8d52 /ATRI/utils/file.py
parentea7f48011c34fdaec7e91af7eb373c8174e439e6 (diff)
downloadATRI-8804f1e10d507ba293fafc77a7e93d3a84a5814b.tar.gz
ATRI-8804f1e10d507ba293fafc77a7e93d3a84a5814b.tar.bz2
ATRI-8804f1e10d507ba293fafc77a7e93d3a84a5814b.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 a873647..6cae2a5 100644
--- a/ATRI/utils/file.py
+++ b/ATRI/utils/file.py
@@ -7,17 +7,17 @@ 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":