From 74a462a09fb4b5cbc392d20ba4fae6470b390ef6 Mon Sep 17 00:00:00 2001 From: InfinityPacer <160988576+InfinityPacer@users.noreply.github.com> Date: Fri, 12 Jul 2024 16:30:06 +0800 Subject: [PATCH 1/2] fix SitesHelper import tips --- app/main.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index e73b43c9..a8869521 100644 --- a/app/main.py +++ b/app/main.py @@ -20,12 +20,20 @@ if SystemUtils.is_frozen(): from app.core.config import settings, global_vars from app.core.module import ModuleManager + +# SitesHelper涉及资源包拉取,提前引入并容错提示 +try: + from app.helper.sites import SitesHelper +except ImportError as e: + error_message = f"错误: {str(e)}\n站点认证及索引相关资源导入失败,请尝试重建镜像或手动拉取资源" + print(error_message, file=sys.stderr) + sys.exit(1) + from app.core.plugin import PluginManager from app.db.init import init_db, update_db, init_super_user from app.helper.thread import ThreadHelper from app.helper.display import DisplayHelper from app.helper.resource import ResourceHelper -from app.helper.sites import SitesHelper from app.helper.message import MessageHelper from app.scheduler import Scheduler from app.command import Command, CommandChian From e2acec321d5b4706f33c4be6a5499c38cfbef678 Mon Sep 17 00:00:00 2001 From: InfinityPacer <160988576+InfinityPacer@users.noreply.github.com> Date: Fri, 12 Jul 2024 16:48:44 +0800 Subject: [PATCH 2/2] fix tips --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index a8869521..5a2ee2bf 100644 --- a/app/main.py +++ b/app/main.py @@ -25,7 +25,7 @@ from app.core.module import ModuleManager try: from app.helper.sites import SitesHelper except ImportError as e: - error_message = f"错误: {str(e)}\n站点认证及索引相关资源导入失败,请尝试重建镜像或手动拉取资源" + error_message = f"错误: {str(e)}\n站点认证及索引相关资源导入失败,请尝试重建容器或手动拉取资源" print(error_message, file=sys.stderr) sys.exit(1)