feat(ui): 修改版本号到v4.4
- 进一步适配三月七相关配置项
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA主程序包
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA核心组件包
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA配置管理
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
@@ -601,14 +601,21 @@ class GeneralConfig(LQConfig):
|
||||
)
|
||||
self.Script_Arguments = ConfigItem("Script", "Arguments", "")
|
||||
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_LogPathFormat = ConfigItem("Script", "LogPathFormat", "%Y-%m-%d")
|
||||
self.Script_LogTimeStart = ConfigItem(
|
||||
"Script", "LogTimeStart", 0, RangeValidator(0, 1024)
|
||||
"Script", "LogTimeStart", 1, RangeValidator(1, 1024)
|
||||
)
|
||||
self.Script_LogTimeEnd = ConfigItem(
|
||||
"Script", "LogTimeEnd", 0, RangeValidator(0, 1024)
|
||||
"Script", "LogTimeEnd", 1, RangeValidator(1, 1024)
|
||||
)
|
||||
self.Script_LogTimeFormat = ConfigItem(
|
||||
"Script", "LogTimeFormat", "%Y-%m-%d %H:%M:%S"
|
||||
@@ -616,7 +623,7 @@ class GeneralConfig(LQConfig):
|
||||
self.Script_SuccessLog = ConfigItem("Script", "SuccessLog", "")
|
||||
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(
|
||||
"Game", "Style", "Emulator", OptionsValidator(["Emulator", "Client"])
|
||||
)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA信息通知栏
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA网络请求线程
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA音效播放器
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA业务调度器
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA主业务定时器
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
MAA功能组件
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA模组包
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
通用功能组件
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
@@ -118,7 +118,7 @@ class GeneralManager(QObject):
|
||||
Path(self.set["Script"]["RootPath"]).exists()
|
||||
and Path(self.set["Script"]["ScriptPath"]).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"]["ErrorLog"]
|
||||
) or (
|
||||
@@ -137,16 +137,24 @@ class GeneralManager(QObject):
|
||||
self.script_root_path = Path(self.set["Script"]["RootPath"])
|
||||
self.script_exe_path = Path(self.set["Script"]["ScriptPath"])
|
||||
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.log_time_range = [
|
||||
self.set["Script"]["LogTimeStart"],
|
||||
self.set["Script"]["LogTimeStart"] - 1,
|
||||
self.set["Script"]["LogTimeEnd"],
|
||||
]
|
||||
self.success_log = [
|
||||
_.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("|")]
|
||||
|
||||
def run(self):
|
||||
@@ -431,9 +439,14 @@ class GeneralManager(QObject):
|
||||
self.start_monitor(start_time)
|
||||
|
||||
self.sub_config_path.mkdir(parents=True, exist_ok=True)
|
||||
shutil.copytree(
|
||||
self.script_config_path, self.sub_config_path, dirs_exist_ok=True
|
||||
)
|
||||
if self.set["Script"]["ConfigPathMode"] == "文件夹":
|
||||
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:
|
||||
logger.error(f"{self.name} | 启动通用脚本时出现异常:{e}")
|
||||
@@ -690,15 +703,31 @@ class GeneralManager(QObject):
|
||||
# 预导入配置文件
|
||||
if self.mode == "设置通用脚本":
|
||||
if self.sub_config_path.exists():
|
||||
shutil.copytree(
|
||||
self.sub_config_path, self.script_config_path, dirs_exist_ok=True
|
||||
)
|
||||
if self.set["Script"]["ConfigPathMode"] == "文件夹":
|
||||
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:
|
||||
shutil.copytree(
|
||||
self.data[index]["Path"] / "ConfigFiles",
|
||||
self.script_config_path,
|
||||
dirs_exist_ok=True,
|
||||
)
|
||||
if self.set["Script"]["ConfigPathMode"] == "文件夹":
|
||||
shutil.copytree(
|
||||
self.data[index]["Path"] / "ConfigFiles",
|
||||
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:
|
||||
"""执行脚本任务并等待结束"""
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA服务包
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA通知服务
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA安全服务
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA森空岛服务
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361、ClozyA
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA系统服务
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA组件
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
@@ -577,7 +577,7 @@ class PathSettingCard(PushSettingCard):
|
||||
self,
|
||||
icon: Union[str, QIcon, FluentIconBase],
|
||||
title: str,
|
||||
mode: str,
|
||||
mode: Union[str, OptionsConfigItem],
|
||||
text: str,
|
||||
qconfig: QConfig,
|
||||
configItem: ConfigItem,
|
||||
@@ -590,6 +590,18 @@ class PathSettingCard(PushSettingCard):
|
||||
self.qconfig = qconfig
|
||||
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.clicked.connect(self.ChoosePath)
|
||||
@@ -602,7 +614,7 @@ class PathSettingCard(PushSettingCard):
|
||||
|
||||
old_path = Path(self.qconfig.get(self.configItem))
|
||||
|
||||
if self.mode == "文件夹":
|
||||
if self.get_mode() == "文件夹":
|
||||
|
||||
folder = QFileDialog.getExistingDirectory(
|
||||
self, "选择文件夹", self.qconfig.get(self.configItem)
|
||||
@@ -614,7 +626,7 @@ class PathSettingCard(PushSettingCard):
|
||||
else:
|
||||
|
||||
file_path, _ = QFileDialog.getOpenFileName(
|
||||
self, "打开文件", self.qconfig.get(self.configItem), self.mode
|
||||
self, "打开文件", self.qconfig.get(self.configItem), self.get_mode()
|
||||
)
|
||||
if file_path:
|
||||
file_path = self.analysis_lnk(file_path)
|
||||
@@ -635,6 +647,21 @@ class PathSettingCard(PushSettingCard):
|
||||
else:
|
||||
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):
|
||||
"""Setting card with push & switch button"""
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA图形化界面包
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA调度中枢界面
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA更新器
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA历史记录界面
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA主界面
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA主界面
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA脚本管理界面
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
@@ -2312,27 +2312,36 @@ class MemberManager(QWidget):
|
||||
)
|
||||
self.card_ConfigPath = PathSettingCard(
|
||||
icon=FluentIcon.FOLDER,
|
||||
title="脚本配置文件目录 - [必填]",
|
||||
mode="文件夹",
|
||||
text="选择文件夹",
|
||||
title="脚本配置文件路径 - [必填]",
|
||||
mode=self.config.Script_ConfigPathMode,
|
||||
text="选择路径",
|
||||
qconfig=self.config,
|
||||
configItem=self.config.Script_ConfigPath,
|
||||
parent=self,
|
||||
)
|
||||
self.card_LogPath = PathSettingCard(
|
||||
icon=FluentIcon.FOLDER,
|
||||
title="脚本日志文件目录 - [必填]",
|
||||
title="脚本日志文件路径 - [必填]",
|
||||
mode="所有文件 (*)",
|
||||
text="选择文件",
|
||||
qconfig=self.config,
|
||||
configItem=self.config.Script_LogPath,
|
||||
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(
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="脚本日志时间起始位置 - [必填]",
|
||||
content="脚本日志中时间的起始位置,单位为字符",
|
||||
range=(0, 1024),
|
||||
range=(1, 1024),
|
||||
qconfig=self.config,
|
||||
configItem=self.config.Script_LogTimeStart,
|
||||
parent=self,
|
||||
@@ -2341,7 +2350,7 @@ class MemberManager(QWidget):
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="脚本日志时间结束位置 - [必填]",
|
||||
content="脚本日志中时间的结束位置,单位为字符",
|
||||
range=(0, 1024),
|
||||
range=(1, 1024),
|
||||
qconfig=self.config,
|
||||
configItem=self.config.Script_LogTimeEnd,
|
||||
parent=self,
|
||||
@@ -2402,6 +2411,7 @@ class MemberManager(QWidget):
|
||||
Layout.addWidget(self.card_Arguments)
|
||||
Layout.addWidget(self.card_ConfigPath)
|
||||
Layout.addWidget(self.card_LogPath)
|
||||
Layout.addWidget(self.card_LogPathFormat)
|
||||
Layout.addLayout(h_layout)
|
||||
Layout.addWidget(self.card_LogTimeFormat)
|
||||
Layout.addWidget(self.card_SuccessLog)
|
||||
@@ -3066,7 +3076,7 @@ class MemberManager(QWidget):
|
||||
self.card_ScriptBeforeTask = PathSettingCard(
|
||||
icon=FluentIcon.FOLDER,
|
||||
title="脚本前置任务",
|
||||
mode="脚本文件 (*.py *.bat *.exe)",
|
||||
mode="脚本文件 (*.py *.bat *.cmd *.exe)",
|
||||
text="选择脚本文件",
|
||||
qconfig=self.config,
|
||||
configItem=self.config.Info_ScriptBeforeTask,
|
||||
@@ -3081,7 +3091,7 @@ class MemberManager(QWidget):
|
||||
self.card_ScriptAfterTask = PathSettingCard(
|
||||
icon=FluentIcon.FOLDER,
|
||||
title="脚本后置任务",
|
||||
mode="脚本文件 (*.py *.bat *.exe)",
|
||||
mode="脚本文件 (*.py *.bat *.cmd *.exe)",
|
||||
text="选择脚本文件",
|
||||
qconfig=self.config,
|
||||
configItem=self.config.Info_ScriptAfterTask,
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA计划管理界面
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA调度队列界面
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA设置界面
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA图像组件
|
||||
v4.3
|
||||
v4.4
|
||||
作者:ClozyA
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA进程管理组件
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA工具包
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA打包程序
|
||||
v4.3
|
||||
v4.4
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user