🎨 使用Python包管理和模块访问

🎨 重构数据库结构, 使用集中式服务定位器与数据库交互
🎨 更改部分代码逻辑, 减小内存消耗
This commit is contained in:
2025-11-30 16:45:13 +08:00
parent b4d3baebe6
commit a6691595e5
29 changed files with 1356 additions and 885 deletions
+5 -9
View File
@@ -1,15 +1,14 @@
from zhenxun.configs.path_config import DATA_PATH
from zhenxun.services.log import logger
from ..utils.config import g_sResourcePath
from ..utils.tool import g_pToolManager
from ..utils import config, getToolManager
class CHelpManager:
@classmethod
async def createHelpImage(cls) -> bool:
templatePath = g_sResourcePath / "html/help.html"
outputPath = g_sResourcePath / "temp_html/help.html"
templatePath = config.g_sResourcePath / "html/help.html"
outputPath = config.g_sResourcePath / "temp_html/help.html"
savePath = DATA_PATH / "farm_res/html/help.png"
context = {
@@ -24,9 +23,9 @@ class CHelpManager:
}
try:
g_pToolManager.renderHtmlToFile(templatePath, context, outputPath)
getToolManager().renderHtmlToFile(templatePath, context, outputPath)
bytes = await g_pToolManager.screenshotSave(
bytes = await getToolManager().screenshotSave(
str(outputPath), str(savePath), 1500, 2300
)
except Exception as e:
@@ -34,6 +33,3 @@ class CHelpManager:
return False
return True
g_pHelpManager = CHelpManager()