Bug fix: RUNTIME_PLATFORM

修复由于修改主文件中获取运行时平台方式,但忘记修改 `SubProcessDlg` 对应代码导致的问题;
This commit is contained in:
muzing 2023-12-08 09:42:12 +08:00
parent aadc437e94
commit 68fad69821

View File

@ -14,7 +14,7 @@ from PySide6.QtWidgets import (
QWidget,
)
from ..Constants import PLATFORM
from ..Constants import PLATFORM, RUNTIME_PLATFORM
from ..Core.subprocess_tool import SubProcessTool
@ -96,12 +96,12 @@ class SubProcessDlg(QDialog):
self.close()
elif btn_text == "打开输出位置":
dist_path = self.parent().packaging_task.script_path.parent / "dist"
if self.parent().running_platform == PLATFORM.windows:
if PLATFORM.windows == RUNTIME_PLATFORM:
import os # fmt: skip
os.startfile(dist_path) # noqa
elif self.parent().running_platform == PLATFORM.linux:
elif PLATFORM.linux == RUNTIME_PLATFORM:
subprocess.call(["xdg-open", dist_path])
elif self.parent().running_platform == PLATFORM.macos:
elif PLATFORM.macos == RUNTIME_PLATFORM:
subprocess.call(["open", dist_path])
elif btn_text == "关闭":
self.close()