docs: 修改文档

This commit is contained in:
2026-05-07 13:26:22 +08:00
parent c2496c1bb5
commit 1975474c94
16 changed files with 464 additions and 57 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ from heurams.services.exceptions import WTFException
logger = get_logger(__name__)
class ConfigDict(UserDict): # 舒服了
class ConfigDict(UserDict):
_instances = {} # 必须使用单例模式, 不然有严重的多实例导致的配置无法持久化问题
def __new__(cls, config_path: pathlib.Path, dict=None):
+2 -2
View File
@@ -73,7 +73,7 @@ class FavoriteManager:
with open(self._file_path, "r", encoding="utf-8") as f:
data = json.load(f)
self._favorites = [FavoriteItem.from_dict(item) for item in data]
logger.debug("收藏列表加载成功%d", len(self._favorites))
logger.debug("收藏列表加载成功, %d", len(self._favorites))
except Exception as e:
logger.error("加载收藏列表失败: %s", e)
self._favorites = []
@@ -86,7 +86,7 @@ class FavoriteManager:
data = [item.to_dict() for item in self._favorites]
with open(self._file_path, "w", encoding="utf-8") as f:
json.dump(data, f, ensure_ascii=False, indent=2)
logger.debug("收藏列表保存成功%d", len(self._favorites))
logger.debug("收藏列表保存成功, %d", len(self._favorites))
except Exception as e:
logger.error("保存收藏列表失败: %s", e)