Skip to content

Commit b3f23b2

Browse files
chore: 使用 ruff format 格式化代码 (#3283)
* Initial plan * chore: 使用 ruff format 格式化代码 Co-authored-by: LIghtJUNction <106986785+LIghtJUNction@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: LIghtJUNction <106986785+LIghtJUNction@users.noreply.github.com>
1 parent 212d8cc commit b3f23b2

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

astrbot/core/message/components.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,9 @@ async def convert_to_file_path(self) -> str:
242242
return url[8:]
243243
if url and url.startswith("http"):
244244
download_dir = str(AstrbotPaths.astrbot_root / "temp")
245-
video_file_path = str(AstrbotPaths.astrbot_root / "temp" / f"{uuid.uuid4().hex}")
245+
video_file_path = str(
246+
AstrbotPaths.astrbot_root / "temp" / f"{uuid.uuid4().hex}"
247+
)
246248
await download_file(url, video_file_path)
247249
if os.path.exists(video_file_path):
248250
return os.path.abspath(video_file_path)
@@ -442,7 +444,9 @@ async def convert_to_file_path(self) -> str:
442444
bs64_data = url.removeprefix("base64://")
443445
image_bytes = base64.b64decode(bs64_data)
444446
temp_dir = str(AstrbotPaths.astrbot_root / "temp")
445-
image_file_path = str(AstrbotPaths.astrbot_root / "temp" / f"{uuid.uuid4()}.jpg")
447+
image_file_path = str(
448+
AstrbotPaths.astrbot_root / "temp" / f"{uuid.uuid4()}.jpg"
449+
)
446450
with open(image_file_path, "wb") as f:
447451
f.write(image_bytes)
448452
return os.path.abspath(image_file_path)

astrbot/core/platform/sources/wechatpadpro/wechatpadpro_adapter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,9 @@ async def _process_message_content(
788788
voice_bs64_data = base64.b64decode(voice_bs64_data)
789789
temp_dir = str(AstrbotPaths.astrbot_root / "temp")
790790
file_path = str(
791-
AstrbotPaths.astrbot_root / "temp" / f"wechatpadpro_voice_{abm.message_id}.silk"
791+
AstrbotPaths.astrbot_root
792+
/ "temp"
793+
/ f"wechatpadpro_voice_{abm.message_id}.silk"
792794
)
793795

794796
async with await anyio.open_file(file_path, "wb") as f:

astrbot/dashboard/server.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ def __init__(
3838
if webui_dir and os.path.exists(webui_dir):
3939
self.data_path = os.path.abspath(webui_dir)
4040
else:
41-
self.data_path = os.path.abspath(
42-
str(AstrbotPaths.astrbot_root / "dist")
43-
)
41+
self.data_path = os.path.abspath(str(AstrbotPaths.astrbot_root / "dist"))
4442

4543
self.app = Quart("dashboard", static_folder=self.data_path, static_url_path="/")
4644
APP = self.app # noqa

0 commit comments

Comments
 (0)