mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-06 12:20:00 +08:00
✅ 添加测试:更新与添加插件 (#1594)
* ✅ 测试更新与添加插件 * ✅ Sourcery建议 * 👷 添加pytest * 🎨 优化代码
This commit is contained in:
@@ -86,8 +86,8 @@ async def download_file(url: str, _is: bool = False, api_url: str | None = None)
|
||||
for download_url, path in data_list:
|
||||
if download_url and "." in path:
|
||||
logger.debug(f"下载文件: {path}", "插件管理")
|
||||
base_path = "zhenxun/plugins/" if _is else "zhenxun/"
|
||||
file = Path(f"{base_path}{path}")
|
||||
base_path = BASE_PATH / "plugins" if _is else BASE_PATH
|
||||
file = base_path / path
|
||||
file.parent.mkdir(parents=True, exist_ok=True)
|
||||
r = await AsyncHttpx.get(download_url)
|
||||
if r.status_code != 200:
|
||||
|
||||
Reference in New Issue
Block a user