From 92aa9c17117099fe79a6218bec5fb902a9520d5c Mon Sep 17 00:00:00 2001 From: RockChinQ <1010553892@qq.com> Date: Sat, 2 Mar 2024 14:57:55 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=AD=A5=E9=AA=A4=E7=A7=BB=E5=8A=A8=E5=88=B0?= =?UTF-8?q?main.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 15 +++++++++++++++ pkg/core/boot.py | 12 ------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/main.py b/main.py index 3d97b1e3..e4dbef02 100644 --- a/main.py +++ b/main.py @@ -17,6 +17,8 @@ async def main_entry(): import sys + # 检查依赖 + from pkg.core.bootutils import deps missing_deps = await deps.check_deps() @@ -29,6 +31,19 @@ async def main_entry(): print("已自动安装缺失的依赖包,请重启程序。") sys.exit(0) + # 检查配置文件 + + from pkg.core.bootutils import files + + generated_files = await files.generate_files() + + if generated_files: + print("以下文件不存在,已自动生成,请按需修改配置文件后重启:") + for file in generated_files: + print("-", file) + + sys.exit(0) + from pkg.core import boot await boot.main() diff --git a/pkg/core/boot.py b/pkg/core/boot.py index 7b4318ca..c04fa798 100644 --- a/pkg/core/boot.py +++ b/pkg/core/boot.py @@ -21,20 +21,8 @@ from ..plugin import manager as plugin_mgr from ..audit.center import v2 as center_v2 from ..utils import version, proxy, announce -use_override = False - async def make_app() -> app.Application: - global use_override - - generated_files = await files.generate_files() - - if generated_files: - print("以下文件不存在,已自动生成,请按需修改配置文件后重启:") - for file in generated_files: - print("-", file) - - sys.exit(0) qcg_logger = await log.init_logging()