From 3149dd3301481b621c4836dda5f75917a83d93ac Mon Sep 17 00:00:00 2001 From: jiajiu123 <1771663559@qq.com> Date: Sun, 9 Mar 2025 23:00:31 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20mongodb.zip=20=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=A7=A3=E5=8E=8B=20fix:=E6=9B=B4=E6=8D=A2=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E7=9A=84=E6=96=B9=E6=B3=95=20fix:=E5=BD=93?= =?UTF-8?q?=20db=20=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=97=B6=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=20feat:=20=E4=B8=80=E9=94=AE=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=AE=8C=E6=88=90=E5=90=8E=E5=90=AF=E5=8A=A8=E9=BA=A6?= =?UTF-8?q?=E9=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run.py | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/run.py b/run.py index 46b53318..35f8653b 100644 --- a/run.py +++ b/run.py @@ -45,21 +45,15 @@ def run_cmd(command: str, open_new_window: bool = True): command (str): 指定要运行的命令 open_new_window (bool): 指定是否新建一个 cmd 窗口运行 """ - creationflags = 0 if open_new_window: - creationflags = subprocess.CREATE_NEW_CONSOLE - subprocess.Popen( - [ - "cmd.exe", - "/c", - command, - ], - creationflags=creationflags, - ) + command = "start " + command + subprocess.Popen(command, shell=True) def run_maimbot(): run_cmd(r"napcat\NapCatWinBootMain.exe 10001", False) + if not os.path.exists(r"mongodb\db"): + os.makedirs(r"mongodb\db") run_cmd( r"mongodb\bin\mongod.exe --dbpath=" + os.getcwd() + r"\mongodb\db --port 27017" ) @@ -86,26 +80,29 @@ def install_mongodb(): for data in resp.iter_content(chunk_size=1024): size = file.write(data) bar.update(size) - extract_files("mongodb.zip", "mongodb") - print("MongoDB 下载完成") - os.remove("mongodb.zip") - choice = input( - "是否安装 MongoDB Compass?此软件可以以可视化的方式修改数据库,建议安装(Y/n)" - ).upper() - if choice == "Y" or choice == "": - install_mongodb_compass() + extract_files("mongodb.zip", "mongodb") + print("MongoDB 下载完成") + os.remove("mongodb.zip") + choice = input( + "是否安装 MongoDB Compass?此软件可以以可视化的方式修改数据库,建议安装(Y/n)" + ).upper() + if choice == "Y" or choice == "": + install_mongodb_compass() def install_mongodb_compass(): run_cmd( - r"powershell Start-Process powershell -Verb runAs 'Set-ExecutionPolicy RemoteSigned'") + r"powershell Start-Process powershell -Verb runAs 'Set-ExecutionPolicy RemoteSigned'" + ) input("请在弹出的用户账户控制中点击“是”后按任意键继续安装") run_cmd(r"powershell mongodb\bin\Install-Compass.ps1") - input("Compass 安装完成后请按任意键继续后续安装") + input("按任意键启动麦麦") + input("如不需要启动此窗口可直接关闭,无需等待 Compass 安装完成") + install_mongodb_compass() def install_napcat(): - run_cmd("start https://github.com/NapNeko/NapCatQQ/releases") + run_cmd("start https://github.com/NapNeko/NapCatQQ/releases", False) print("请检查弹出的浏览器窗口,点击**第一个**蓝色的“Win64无头” 下载 napcat") napcat_filename = input( "下载完成后请把文件复制到此文件夹,并将**不包含后缀的文件名**输入至此窗口,如 NapCat.32793.Shell:" @@ -136,4 +133,4 @@ if __name__ == "__main__": run_maimbot() elif choice == "3": run_maimbot() - run_cmd("python src/gui/reasoning_gui.py") \ No newline at end of file + run_cmd(r"python src\gui\reasoning_gui.py") From 3223153e3ecde6410c0e3d3a36e320f893bd1b6a Mon Sep 17 00:00:00 2001 From: jiajiu123 <1771663559@qq.com> Date: Sun, 9 Mar 2025 23:09:02 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E4=B8=80=E9=94=AE=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E6=96=B0=E5=A2=9E=E8=AE=B0=E5=BF=86=E5=8F=AF=E8=A7=86?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/run.py b/run.py index 35f8653b..5546d1fa 100644 --- a/run.py +++ b/run.py @@ -123,7 +123,6 @@ if __name__ == "__main__": "请输入要进行的操作:\n" "1.首次安装\n" "2.运行麦麦\n" - "3.运行麦麦并启动可视化推理界面\n" ) os.system("cls") if choice == "1": @@ -131,6 +130,9 @@ if __name__ == "__main__": install_mongodb() elif choice == "2": run_maimbot() - elif choice == "3": - run_maimbot() - run_cmd(r"python src\gui\reasoning_gui.py") + choice = input("是否启动推理可视化?(y/N)").upper() + if choice == "Y": + run_cmd(r"python src\gui\reasoning_gui.py") + choice = input("是否启动记忆可视化?(y/N)").upper() + if choice == "Y": + run_cmd(r"python src/plugins/memory_system/memory_manual_build.py") From 6c35704e70bcd1f2861f68b9e87f4309f67be22c Mon Sep 17 00:00:00 2001 From: jiajiu123 <1771663559@qq.com> Date: Sun, 9 Mar 2025 23:12:48 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E8=B0=83=E7=94=A8=E4=BA=86=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.py b/run.py index 5546d1fa..baea4d13 100644 --- a/run.py +++ b/run.py @@ -98,7 +98,7 @@ def install_mongodb_compass(): run_cmd(r"powershell mongodb\bin\Install-Compass.ps1") input("按任意键启动麦麦") input("如不需要启动此窗口可直接关闭,无需等待 Compass 安装完成") - install_mongodb_compass() + run_maimbot() def install_napcat():