From 554380415b2be20f8f296ff0589a9502b47ab284 Mon Sep 17 00:00:00 2001 From: MuWinds Date: Thu, 13 Mar 2025 10:55:44 +0800 Subject: [PATCH 1/4] =?UTF-8?q?Fix:=E6=8E=A8=E7=90=86gui=E6=8A=A5ImportErr?= =?UTF-8?q?or?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gui/reasoning_gui.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/reasoning_gui.py b/src/gui/reasoning_gui.py index e79f8f91f..c577ba3ae 100644 --- a/src/gui/reasoning_gui.py +++ b/src/gui/reasoning_gui.py @@ -7,7 +7,7 @@ from datetime import datetime from typing import Dict, List from loguru import logger from typing import Optional -from ..common.database import db + import customtkinter as ctk from dotenv import load_dotenv @@ -16,6 +16,8 @@ from dotenv import load_dotenv current_dir = os.path.dirname(os.path.abspath(__file__)) # 获取项目根目录 root_dir = os.path.abspath(os.path.join(current_dir, '..', '..')) +sys.path.insert(0, root_dir) +from src.common.database import db # 加载环境变量 if os.path.exists(os.path.join(root_dir, '.env.dev')): From 48b1953e7e62f046aa352f24827c952807f6dcca Mon Sep 17 00:00:00 2001 From: HYY Date: Thu, 13 Mar 2025 12:00:34 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=8E=A5=E6=94=B6At=E5=85=A8=E4=BD=93=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/chat/cq_code.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/chat/cq_code.py b/src/plugins/chat/cq_code.py index bc40cff80..049419f1c 100644 --- a/src/plugins/chat/cq_code.py +++ b/src/plugins/chat/cq_code.py @@ -86,9 +86,12 @@ class CQCode: else: self.translated_segments = Seg(type="text", data="[图片]") elif self.type == "at": - user_nickname = get_user_nickname(self.params.get("qq", "")) - self.translated_segments = Seg( - type="text", data=f"[@{user_nickname or '某人'}]" + if self.params.get("qq") == "all": + self.translated_segments = Seg(type="text", data="@[全体成员]") + else: + user_nickname = get_user_nickname(self.params.get("qq", "")) + self.translated_segments = Seg( + type="text", data=f"[@{user_nickname or '某人'}]" ) elif self.type == "reply": reply_segments = self.translate_reply() From c83fbc1529f56ddc07e474d7e99c3ae657cf3de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=B4=E7=8C=AB?= Date: Thu, 13 Mar 2025 14:14:56 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20.pre-commit-config.yam?= =?UTF-8?q?l=20=EF=BC=88=E8=BF=99=E5=B9=B6=E4=B8=8D=E4=BC=9A=E5=90=AF?= =?UTF-8?q?=E7=94=A8hook=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..8a04e2d84 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: +- repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.9.10 + hooks: + # Run the linter. + - id: ruff + args: [ --fix ] + # Run the formatter. + - id: ruff-format From c4d1df3d4812c640db2fed17e6f190e00fea21a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=A5=E6=B2=B3=E6=99=B4?= Date: Thu, 13 Mar 2025 15:05:32 +0900 Subject: [PATCH 4/4] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0.gitignore?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0JetBrains=E7=9B=B8=E5=85=B3=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=92=8C=E7=9B=AE=E5=BD=95=EF=BC=8C=E7=A7=BB=E9=99=A4?= =?UTF-8?q?.env=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3579444dc..b4c7154de 100644 --- a/.gitignore +++ b/.gitignore @@ -190,7 +190,6 @@ cython_debug/ # PyPI configuration file .pypirc -.env # jieba jieba.cache @@ -199,4 +198,9 @@ jieba.cache !.vscode/settings.json # direnv -/.direnv \ No newline at end of file +/.direnv + +# JetBrains +.idea +*.iml +*.ipr