采集卡bug修复
This commit is contained in:
11
config.py
11
config.py
@@ -48,11 +48,20 @@ class ConfigManager:
|
||||
def save_config(self):
|
||||
"""保存配置文件"""
|
||||
try:
|
||||
import os
|
||||
# 确保目录存在
|
||||
config_dir = os.path.dirname(os.path.abspath(self.config_file))
|
||||
if config_dir and not os.path.exists(config_dir):
|
||||
os.makedirs(config_dir, exist_ok=True)
|
||||
|
||||
with open(self.config_file, 'w', encoding='utf-8') as f:
|
||||
json.dump(self.config, f, ensure_ascii=False, indent=4)
|
||||
print(f"✅ 配置文件已保存到: {os.path.abspath(self.config_file)}")
|
||||
return True
|
||||
except Exception as e:
|
||||
print(f"保存配置文件失败: {e}")
|
||||
print(f"❌ 保存配置文件失败: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
return False
|
||||
|
||||
def add_group(self, name=None):
|
||||
|
||||
Reference in New Issue
Block a user