重构测试执行部分+去除转发器
This commit is contained in:
@@ -8,11 +8,8 @@ import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
def get_config_path(app):
|
||||
def get_config_path(self):
|
||||
"""获取配置文件的完整路径(兼容打包后的程序)"""
|
||||
self = app
|
||||
import os
|
||||
import sys
|
||||
|
||||
# 判断是否是打包后的程序
|
||||
if getattr(sys, "frozen", False):
|
||||
@@ -33,9 +30,8 @@ def get_config_path(app):
|
||||
return config_file
|
||||
|
||||
|
||||
def load_pq_config(app):
|
||||
def load_pq_config(self):
|
||||
"""加载PQ配置(兼容打包后的程序)"""
|
||||
self = app
|
||||
try:
|
||||
# ✅ 使用 self.config_file(已经是动态路径)
|
||||
if os.path.exists(self.config_file):
|
||||
@@ -52,9 +48,8 @@ def load_pq_config(app):
|
||||
self.log_gui.log(f"⚠️ 加载配置文件失败: {str(e)},使用默认配置")
|
||||
|
||||
|
||||
def save_pq_config(app):
|
||||
def save_pq_config(self):
|
||||
"""保存PQ配置(兼容打包后的程序)"""
|
||||
self = app
|
||||
try:
|
||||
# 确保目录存在
|
||||
os.makedirs(os.path.dirname(self.config_file), exist_ok=True)
|
||||
@@ -66,9 +61,8 @@ def save_pq_config(app):
|
||||
self.log_gui.log(f"保存配置文件失败: {str(e)}")
|
||||
|
||||
|
||||
def clear_config_file(app):
|
||||
def clear_config_file(self):
|
||||
"""清理配置文件(兼容打包后的程序)"""
|
||||
self = app
|
||||
from tkinter import messagebox
|
||||
|
||||
config_file = self.get_config_path()
|
||||
|
||||
Reference in New Issue
Block a user