mirror of
https://github.com/Shu-Ying/main_plugin_farm.git
synced 2026-11-03 03:00:43 +08:00
🎨 使用Python包管理和模块访问
🎨 重构数据库结构, 使用集中式服务定位器与数据库交互 🎨 更改部分代码逻辑, 减小内存消耗
This commit is contained in:
+5
-9
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user