From 110b0cfc219772c5ce6a7f6fc4420f78dc082437 Mon Sep 17 00:00:00 2001 From: snowy Date: Fri, 5 Apr 2024 09:14:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/deployment/install.md | 2 +- liteyuki/utils/data.py | 3 +-- liteyuki/utils/language.py | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/deployment/install.md b/docs/deployment/install.md index bfe27f2..1df07c0 100644 --- a/docs/deployment/install.md +++ b/docs/deployment/install.md @@ -9,7 +9,7 @@ tag: ### 设备要求 - Windows系统版本最低`Windows10+`/`Windows Server 2019+` -- Linux系统要支持Python3.10+,推荐`Ubuntu 20.04+`/`CentOS 8+` +- Linux系统要支持Python3.10+,推荐`Ubuntu 20.04+`/`CentOS 8+`(~~别用你那b CentOS~~) - CPU: 至少`1vCPU` - 内存: Bot无其他插件会占用`100MB`,其他插件占用视具体插件而定,建议`1GB`以上 - 硬盘: 至少`1GB`空间 diff --git a/liteyuki/utils/data.py b/liteyuki/utils/data.py index ddf219a..19face9 100644 --- a/liteyuki/utils/data.py +++ b/liteyuki/utils/data.py @@ -12,7 +12,6 @@ from pydantic import BaseModel class LiteModel(BaseModel): TABLE_NAME: str = None id: int = None - def dump(self, *args, **kwargs): if pydantic.__version__ < "1.8.2": return self.dict(*args, **kwargs) @@ -88,7 +87,7 @@ class Database: if not model.TABLE_NAME: raise ValueError(f"数据模型 {model.__class__.__name__} 未提供表名") elif model.TABLE_NAME not in table_list: - raise ValueError(f"数据模型 {model.__class__.__name__} 的表 {model.TABLE_NAME} 不存在,请先迁移") + raise ValueError(f"数据模型 {model.__class__.__name__} 表 {model.TABLE_NAME} 不存在,请先迁移") else: self._save(model.dump(by_alias=True)) diff --git a/liteyuki/utils/language.py b/liteyuki/utils/language.py index 37952d9..fc54416 100644 --- a/liteyuki/utils/language.py +++ b/liteyuki/utils/language.py @@ -42,6 +42,7 @@ def load_from_lang(file_path: str, lang_code: str = None): if lang_code not in _language_data: _language_data[lang_code] = {} _language_data[lang_code].update(data) + nonebot.logger.debug(f"Loaded language data from {file_path}") except Exception as e: nonebot.logger.error(f"Failed to load language data from {file_path}: {e}") @@ -62,6 +63,7 @@ def load_from_json(file_path: str, lang_code: str = None): if lang_code not in _language_data: _language_data[lang_code] = {} _language_data[lang_code].update(data) + nonebot.logger.debug(f"Loaded language data from {file_path}") except Exception as e: nonebot.logger.error(f"Failed to load language data from {file_path}: {e}")