feat(ui): 修改版本号到v4.4

- 进一步适配三月七相关配置项
This commit is contained in:
DLmaster361
2025-07-10 17:34:41 +08:00
parent d9043aab0a
commit 5b0d7f0012
33 changed files with 138 additions and 62 deletions

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA主程序包 AUTO_MAA主程序包
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA核心组件包 AUTO_MAA核心组件包
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA配置管理 AUTO_MAA配置管理
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """
@@ -601,14 +601,21 @@ class GeneralConfig(LQConfig):
) )
self.Script_Arguments = ConfigItem("Script", "Arguments", "") self.Script_Arguments = ConfigItem("Script", "Arguments", "")
self.Script_ConfigPath = ConfigItem( self.Script_ConfigPath = ConfigItem(
"Script", "ConfigPath", ".", FolderValidator() "Script", "ConfigPath", ".", FileValidator()
)
self.Script_ConfigPathMode = OptionsConfigItem(
"Script",
"ConfigPathMode",
"所有文件 (*)",
OptionsValidator(["所有文件 (*)", "文件夹"]),
) )
self.Script_LogPath = ConfigItem("Script", "LogPath", ".", FileValidator()) self.Script_LogPath = ConfigItem("Script", "LogPath", ".", FileValidator())
self.Script_LogPathFormat = ConfigItem("Script", "LogPathFormat", "%Y-%m-%d")
self.Script_LogTimeStart = ConfigItem( self.Script_LogTimeStart = ConfigItem(
"Script", "LogTimeStart", 0, RangeValidator(0, 1024) "Script", "LogTimeStart", 1, RangeValidator(1, 1024)
) )
self.Script_LogTimeEnd = ConfigItem( self.Script_LogTimeEnd = ConfigItem(
"Script", "LogTimeEnd", 0, RangeValidator(0, 1024) "Script", "LogTimeEnd", 1, RangeValidator(1, 1024)
) )
self.Script_LogTimeFormat = ConfigItem( self.Script_LogTimeFormat = ConfigItem(
"Script", "LogTimeFormat", "%Y-%m-%d %H:%M:%S" "Script", "LogTimeFormat", "%Y-%m-%d %H:%M:%S"
@@ -616,7 +623,7 @@ class GeneralConfig(LQConfig):
self.Script_SuccessLog = ConfigItem("Script", "SuccessLog", "") self.Script_SuccessLog = ConfigItem("Script", "SuccessLog", "")
self.Script_ErrorLog = ConfigItem("Script", "ErrorLog", "") self.Script_ErrorLog = ConfigItem("Script", "ErrorLog", "")
self.Game_Enabled = ConfigItem("Game", "Enabled", True, BoolValidator()) self.Game_Enabled = ConfigItem("Game", "Enabled", False, BoolValidator())
self.Game_Style = OptionsConfigItem( self.Game_Style = OptionsConfigItem(
"Game", "Style", "Emulator", OptionsValidator(["Emulator", "Client"]) "Game", "Style", "Emulator", OptionsValidator(["Emulator", "Client"])
) )

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA信息通知栏 AUTO_MAA信息通知栏
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA网络请求线程 AUTO_MAA网络请求线程
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA音效播放器 AUTO_MAA音效播放器
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA业务调度器 AUTO_MAA业务调度器
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA主业务定时器 AUTO_MAA主业务定时器
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
MAA功能组件 MAA功能组件
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA模组包 AUTO_MAA模组包
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
通用功能组件 通用功能组件
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """
@@ -118,7 +118,7 @@ class GeneralManager(QObject):
Path(self.set["Script"]["RootPath"]).exists() Path(self.set["Script"]["RootPath"]).exists()
and Path(self.set["Script"]["ScriptPath"]).exists() and Path(self.set["Script"]["ScriptPath"]).exists()
and Path(self.set["Script"]["ConfigPath"]).exists() and Path(self.set["Script"]["ConfigPath"]).exists()
and Path(self.set["Script"]["LogPath"]).exists() and Path(self.set["Script"]["LogPath"]).parent.exists()
and self.set["Script"]["LogTimeFormat"] and self.set["Script"]["LogTimeFormat"]
and self.set["Script"]["ErrorLog"] and self.set["Script"]["ErrorLog"]
) or ( ) or (
@@ -137,16 +137,24 @@ class GeneralManager(QObject):
self.script_root_path = Path(self.set["Script"]["RootPath"]) self.script_root_path = Path(self.set["Script"]["RootPath"])
self.script_exe_path = Path(self.set["Script"]["ScriptPath"]) self.script_exe_path = Path(self.set["Script"]["ScriptPath"])
self.script_config_path = Path(self.set["Script"]["ConfigPath"]) self.script_config_path = Path(self.set["Script"]["ConfigPath"])
self.script_log_path = Path(self.set["Script"]["LogPath"]) self.script_log_path = (
Path(self.set["Script"]["LogPath"]).with_stem(
datetime.now().strftime(self.set["Script"]["LogPathFormat"])
)
if self.set["Script"]["LogPathFormat"]
else Path(self.set["Script"]["LogPath"])
)
if not self.script_log_path.exists():
self.script_log_path.parent.mkdir(parents=True, exist_ok=True)
self.script_log_path.touch(exist_ok=True)
self.game_path = Path(self.set["Game"]["Path"]) self.game_path = Path(self.set["Game"]["Path"])
self.log_time_range = [ self.log_time_range = [
self.set["Script"]["LogTimeStart"], self.set["Script"]["LogTimeStart"] - 1,
self.set["Script"]["LogTimeEnd"], self.set["Script"]["LogTimeEnd"],
] ]
self.success_log = [ self.success_log = [
_.strip() for _ in self.set["Script"]["SuccessLog"].split("|") _.strip() for _ in self.set["Script"]["SuccessLog"].split("|")
] ]
print(f"Success Log: {self.success_log}")
self.error_log = [_.strip() for _ in self.set["Script"]["ErrorLog"].split("|")] self.error_log = [_.strip() for _ in self.set["Script"]["ErrorLog"].split("|")]
def run(self): def run(self):
@@ -431,9 +439,14 @@ class GeneralManager(QObject):
self.start_monitor(start_time) self.start_monitor(start_time)
self.sub_config_path.mkdir(parents=True, exist_ok=True) self.sub_config_path.mkdir(parents=True, exist_ok=True)
shutil.copytree( if self.set["Script"]["ConfigPathMode"] == "文件夹":
self.script_config_path, self.sub_config_path, dirs_exist_ok=True shutil.copytree(
) self.script_config_path,
self.sub_config_path,
dirs_exist_ok=True,
)
else:
shutil.copy(self.script_config_path, self.sub_config_path)
except Exception as e: except Exception as e:
logger.error(f"{self.name} | 启动通用脚本时出现异常:{e}") logger.error(f"{self.name} | 启动通用脚本时出现异常:{e}")
@@ -690,15 +703,31 @@ class GeneralManager(QObject):
# 预导入配置文件 # 预导入配置文件
if self.mode == "设置通用脚本": if self.mode == "设置通用脚本":
if self.sub_config_path.exists(): if self.sub_config_path.exists():
shutil.copytree( if self.set["Script"]["ConfigPathMode"] == "文件夹":
self.sub_config_path, self.script_config_path, dirs_exist_ok=True shutil.copytree(
) self.sub_config_path,
self.script_config_path,
dirs_exist_ok=True,
)
elif (self.sub_config_path / self.script_config_path.name).exists():
shutil.copy(
self.sub_config_path / self.script_config_path.name,
self.script_config_path,
)
else: else:
shutil.copytree( if self.set["Script"]["ConfigPathMode"] == "文件夹":
self.data[index]["Path"] / "ConfigFiles", shutil.copytree(
self.script_config_path, self.data[index]["Path"] / "ConfigFiles",
dirs_exist_ok=True, self.script_config_path,
) dirs_exist_ok=True,
)
else:
shutil.copy(
self.data[index]["Path"]
/ "ConfigFiles"
/ self.script_config_path.name,
self.script_config_path,
)
def execute_script_task(self, script_path: Path, task_name: str) -> bool: def execute_script_task(self, script_path: Path, task_name: str) -> bool:
"""执行脚本任务并等待结束""" """执行脚本任务并等待结束"""

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA服务包 AUTO_MAA服务包
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA通知服务 AUTO_MAA通知服务
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA安全服务 AUTO_MAA安全服务
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -28,7 +28,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA森空岛服务 AUTO_MAA森空岛服务
v4.3 v4.4
作者DLmaster_361、ClozyA 作者DLmaster_361、ClozyA
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA系统服务 AUTO_MAA系统服务
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -27,7 +27,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA组件 AUTO_MAA组件
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """
@@ -577,7 +577,7 @@ class PathSettingCard(PushSettingCard):
self, self,
icon: Union[str, QIcon, FluentIconBase], icon: Union[str, QIcon, FluentIconBase],
title: str, title: str,
mode: str, mode: Union[str, OptionsConfigItem],
text: str, text: str,
qconfig: QConfig, qconfig: QConfig,
configItem: ConfigItem, configItem: ConfigItem,
@@ -590,6 +590,18 @@ class PathSettingCard(PushSettingCard):
self.qconfig = qconfig self.qconfig = qconfig
self.configItem = configItem self.configItem = configItem
if isinstance(mode, OptionsConfigItem):
self.ComboBox = ComboBox(self)
self.hBoxLayout.insertWidget(5, self.ComboBox, 0, Qt.AlignRight)
for option in mode.options:
self.ComboBox.addItem(option, userData=option)
self.ComboBox.setCurrentText(self.qconfig.get(mode))
self.ComboBox.currentIndexChanged.connect(self._onCurrentIndexChanged)
mode.valueChanged.connect(self.setValue)
self.setContent(self.qconfig.get(self.configItem)) self.setContent(self.qconfig.get(self.configItem))
self.clicked.connect(self.ChoosePath) self.clicked.connect(self.ChoosePath)
@@ -602,7 +614,7 @@ class PathSettingCard(PushSettingCard):
old_path = Path(self.qconfig.get(self.configItem)) old_path = Path(self.qconfig.get(self.configItem))
if self.mode == "文件夹": if self.get_mode() == "文件夹":
folder = QFileDialog.getExistingDirectory( folder = QFileDialog.getExistingDirectory(
self, "选择文件夹", self.qconfig.get(self.configItem) self, "选择文件夹", self.qconfig.get(self.configItem)
@@ -614,7 +626,7 @@ class PathSettingCard(PushSettingCard):
else: else:
file_path, _ = QFileDialog.getOpenFileName( file_path, _ = QFileDialog.getOpenFileName(
self, "打开文件", self.qconfig.get(self.configItem), self.mode self, "打开文件", self.qconfig.get(self.configItem), self.get_mode()
) )
if file_path: if file_path:
file_path = self.analysis_lnk(file_path) file_path = self.analysis_lnk(file_path)
@@ -635,6 +647,21 @@ class PathSettingCard(PushSettingCard):
else: else:
return lnk_path return lnk_path
def get_mode(self) -> str:
"""获取当前模式"""
if isinstance(self.mode, OptionsConfigItem):
return self.qconfig.get(self.mode)
return self.mode
def _onCurrentIndexChanged(self, index: int):
self.qconfig.set(self.mode, self.ComboBox.itemData(index))
def setValue(self, value):
self.ComboBox.setCurrentText(value)
self.qconfig.set(self.mode, value)
class PushAndSwitchButtonSettingCard(SettingCard): class PushAndSwitchButtonSettingCard(SettingCard):
"""Setting card with push & switch button""" """Setting card with push & switch button"""

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA图形化界面包 AUTO_MAA图形化界面包
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA调度中枢界面 AUTO_MAA调度中枢界面
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA更新器 AUTO_MAA更新器
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA历史记录界面 AUTO_MAA历史记录界面
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA主界面 AUTO_MAA主界面
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA主界面 AUTO_MAA主界面
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA脚本管理界面 AUTO_MAA脚本管理界面
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """
@@ -2312,27 +2312,36 @@ class MemberManager(QWidget):
) )
self.card_ConfigPath = PathSettingCard( self.card_ConfigPath = PathSettingCard(
icon=FluentIcon.FOLDER, icon=FluentIcon.FOLDER,
title="脚本配置文件目录 - [必填]", title="脚本配置文件路径 - [必填]",
mode="文件夹", mode=self.config.Script_ConfigPathMode,
text="选择文件夹", text="选择路径",
qconfig=self.config, qconfig=self.config,
configItem=self.config.Script_ConfigPath, configItem=self.config.Script_ConfigPath,
parent=self, parent=self,
) )
self.card_LogPath = PathSettingCard( self.card_LogPath = PathSettingCard(
icon=FluentIcon.FOLDER, icon=FluentIcon.FOLDER,
title="脚本日志文件目录 - [必填]", title="脚本日志文件路径 - [必填]",
mode="所有文件 (*)", mode="所有文件 (*)",
text="选择文件", text="选择文件",
qconfig=self.config, qconfig=self.config,
configItem=self.config.Script_LogPath, configItem=self.config.Script_LogPath,
parent=self, parent=self,
) )
self.card_LogPathFormat = LineEditSettingCard(
icon=FluentIcon.PAGE_RIGHT,
title="脚本日志文件名格式",
content="若脚本日志文件名中随时间变化,请填入时间格式,留空则不启用",
text="请输入脚本日志文件名格式",
qconfig=self.config,
configItem=self.config.Script_LogPathFormat,
parent=self,
)
self.card_LogTimeStart = SpinBoxSettingCard( self.card_LogTimeStart = SpinBoxSettingCard(
icon=FluentIcon.PAGE_RIGHT, icon=FluentIcon.PAGE_RIGHT,
title="脚本日志时间起始位置 - [必填]", title="脚本日志时间起始位置 - [必填]",
content="脚本日志中时间的起始位置,单位为字符", content="脚本日志中时间的起始位置,单位为字符",
range=(0, 1024), range=(1, 1024),
qconfig=self.config, qconfig=self.config,
configItem=self.config.Script_LogTimeStart, configItem=self.config.Script_LogTimeStart,
parent=self, parent=self,
@@ -2341,7 +2350,7 @@ class MemberManager(QWidget):
icon=FluentIcon.PAGE_RIGHT, icon=FluentIcon.PAGE_RIGHT,
title="脚本日志时间结束位置 - [必填]", title="脚本日志时间结束位置 - [必填]",
content="脚本日志中时间的结束位置,单位为字符", content="脚本日志中时间的结束位置,单位为字符",
range=(0, 1024), range=(1, 1024),
qconfig=self.config, qconfig=self.config,
configItem=self.config.Script_LogTimeEnd, configItem=self.config.Script_LogTimeEnd,
parent=self, parent=self,
@@ -2402,6 +2411,7 @@ class MemberManager(QWidget):
Layout.addWidget(self.card_Arguments) Layout.addWidget(self.card_Arguments)
Layout.addWidget(self.card_ConfigPath) Layout.addWidget(self.card_ConfigPath)
Layout.addWidget(self.card_LogPath) Layout.addWidget(self.card_LogPath)
Layout.addWidget(self.card_LogPathFormat)
Layout.addLayout(h_layout) Layout.addLayout(h_layout)
Layout.addWidget(self.card_LogTimeFormat) Layout.addWidget(self.card_LogTimeFormat)
Layout.addWidget(self.card_SuccessLog) Layout.addWidget(self.card_SuccessLog)
@@ -3066,7 +3076,7 @@ class MemberManager(QWidget):
self.card_ScriptBeforeTask = PathSettingCard( self.card_ScriptBeforeTask = PathSettingCard(
icon=FluentIcon.FOLDER, icon=FluentIcon.FOLDER,
title="脚本前置任务", title="脚本前置任务",
mode="脚本文件 (*.py *.bat *.exe)", mode="脚本文件 (*.py *.bat *.cmd *.exe)",
text="选择脚本文件", text="选择脚本文件",
qconfig=self.config, qconfig=self.config,
configItem=self.config.Info_ScriptBeforeTask, configItem=self.config.Info_ScriptBeforeTask,
@@ -3081,7 +3091,7 @@ class MemberManager(QWidget):
self.card_ScriptAfterTask = PathSettingCard( self.card_ScriptAfterTask = PathSettingCard(
icon=FluentIcon.FOLDER, icon=FluentIcon.FOLDER,
title="脚本后置任务", title="脚本后置任务",
mode="脚本文件 (*.py *.bat *.exe)", mode="脚本文件 (*.py *.bat *.cmd *.exe)",
text="选择脚本文件", text="选择脚本文件",
qconfig=self.config, qconfig=self.config,
configItem=self.config.Info_ScriptAfterTask, configItem=self.config.Info_ScriptAfterTask,

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA计划管理界面 AUTO_MAA计划管理界面
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA调度队列界面 AUTO_MAA调度队列界面
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA设置界面 AUTO_MAA设置界面
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA图像组件 AUTO_MAA图像组件
v4.3 v4.4
作者ClozyA 作者ClozyA
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA进程管理组件 AUTO_MAA进程管理组件
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA工具包 AUTO_MAA工具包
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA打包程序 AUTO_MAA打包程序
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -21,7 +21,7 @@
""" """
AUTO_MAA AUTO_MAA
AUTO_MAA主程序 AUTO_MAA主程序
v4.3 v4.4
作者DLmaster_361 作者DLmaster_361
""" """

View File

@@ -2,6 +2,9 @@
"main_version": "4.4.0.2", "main_version": "4.4.0.2",
"version_info": { "version_info": {
"4.4.0.2": { "4.4.0.2": {
"新增功能": [
"进一步适配三月七相关配置项"
],
"修复BUG": [ "修复BUG": [
"适配 Mirror 酱 平台下载策略调整" "适配 Mirror 酱 平台下载策略调整"
] ]