mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
✨ 优化获取文件列表的代码格式
This commit is contained in:
parent
49b60aa640
commit
1012542992
@ -44,6 +44,7 @@ async def _(path: str | None = None) -> Result[list[DirFile]]:
|
||||
size=None if file_path.is_dir() else file_path.stat().st_size,
|
||||
mtime=file_path.stat().st_mtime,
|
||||
)
|
||||
)
|
||||
return Result.ok(data_list)
|
||||
except Exception as e:
|
||||
return Result.fail(f"获取文件列表失败: {e!s}")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user