From c161a0a45741c5dad4db470e797c57b7554e9297 Mon Sep 17 00:00:00 2001 From: Jeffreytsai1004 Date: Tue, 4 Feb 2025 16:29:33 +0800 Subject: [PATCH] Update --- DevGoals.md | 1 + config/__init__.py | 2 +- scripts/MetaFusion.py | 22 +++++++++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 DevGoals.md diff --git a/DevGoals.md b/DevGoals.md new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/DevGoals.md @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/config/__init__.py b/config/__init__.py index 49ca90e..44b3172 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -1,4 +1,4 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from .data import * +from . import * diff --git a/scripts/MetaFusion.py b/scripts/MetaFusion.py index 4150d13..cbd6c77 100644 --- a/scripts/MetaFusion.py +++ b/scripts/MetaFusion.py @@ -2,11 +2,31 @@ # -*- coding: utf-8 -*- import os +import sys +from PySide2 import QtCore, QtGui, QtWidgets + +# 添加项目根目录到 Python 路径 +ROOT_DIR = os.path.dirname(os.path.dirname(__file__)) +if ROOT_DIR not in sys.path: + sys.path.insert(0, ROOT_DIR) from config import data QtCore, QtGui, QtWidgets = data.Qt() +#===================================== 2. Global Variables ===================================== +TOOL_NAME = data.TOOL_NAME +TOOL_VERSION = data.TOOL_VERSION +TOOL_AUTHOR = data.TOOL_AUTHOR +TOOL_LANG = data.TOOL_LANG +TOOL_WSCL_NAME = data.TOOL_WSCL_NAME +TOOL_HELP_URL = data.TOOL_HELP_URL +SCRIPTS_PATH = data.SCRIPTS_PATH +ICONS_PATH = data.ICONS_PATH + +TOOL_MAIN_SCRIPT = data.TOOL_MAIN_SCRIPT +TOOL_MOD_FILENAME = data.TOOL_MOD_FILENAME +TOOL_ICON = data.TOOL_ICON +TOOL_COMMAND_ICON = data.TOOL_COMMAND_ICON -# 全局变量声明 main_window = None class MetaFusionWindow(QtWidgets.QMainWindow):