fix:优化配置存储
This commit is contained in:
@@ -1,20 +1,17 @@
|
||||
import os
|
||||
import threading
|
||||
import time
|
||||
import pythoncom
|
||||
|
||||
import pandas as pd
|
||||
from loguru import logger
|
||||
from pptx import Presentation
|
||||
from rich.console import Console
|
||||
import traceback
|
||||
|
||||
import comtypes.client
|
||||
import pandas as pd
|
||||
import pythoncom
|
||||
from loguru import logger
|
||||
from pptx import Presentation
|
||||
|
||||
from config.config import load_config
|
||||
from utils.agent_utils import generate_comment
|
||||
from utils.file_utils import check_file_exists, get_output_pptx_files
|
||||
from utils.image_utils import find_image_path
|
||||
from utils.zodiac_utils import calculate_zodiac
|
||||
from utils.growt_utils import (
|
||||
replace_one_page,
|
||||
replace_two_page,
|
||||
@@ -22,6 +19,8 @@ from utils.growt_utils import (
|
||||
replace_four_page,
|
||||
replace_five_page,
|
||||
)
|
||||
from utils.image_utils import find_image_path
|
||||
from utils.zodiac_utils import calculate_zodiac
|
||||
|
||||
|
||||
# ==========================================
|
||||
@@ -35,7 +34,7 @@ def generate_template(stop_event: threading.Event = None, progress_callback=None
|
||||
"""
|
||||
# 1. 加载配置文件
|
||||
try:
|
||||
config = load_config("config.toml")
|
||||
config = load_config()
|
||||
except Exception as e:
|
||||
logger.error(f"配置文件获取失败: {str(e)}")
|
||||
# 打印详细报错位置,方便调试
|
||||
@@ -89,7 +88,7 @@ def generate_comment_all(stop_event: threading.Event = None, progress_callback=N
|
||||
"""
|
||||
# 1. 加载配置文件
|
||||
try:
|
||||
config = load_config("config.toml")
|
||||
config = load_config()
|
||||
except Exception as e:
|
||||
logger.error(f"配置文件获取失败: {str(e)}")
|
||||
# 打印详细报错位置,方便调试
|
||||
@@ -184,7 +183,7 @@ def generate_report(stop_event: threading.Event = None, progress_callback=None):
|
||||
:params progress_callback 进度回调函数
|
||||
""" # 1. 加载配置文件
|
||||
try:
|
||||
config = load_config("config.toml")
|
||||
config = load_config()
|
||||
except Exception as e:
|
||||
logger.error(f"配置文件获取失败: {str(e)}")
|
||||
# 打印详细报错位置,方便调试
|
||||
@@ -316,6 +315,7 @@ def generate_report(stop_event: threading.Event = None, progress_callback=None):
|
||||
class_image_path = find_image_path(
|
||||
config["image_folder"], config["class_name"]
|
||||
)
|
||||
print(config["image_folder"], config["class_name"])
|
||||
|
||||
# 添加检查班级图片是否存在,若不存在则跳过
|
||||
if check_file_exists(class_image_path):
|
||||
@@ -378,7 +378,7 @@ def generate_convert_pdf(stop_event: threading.Event = None, progress_callback=N
|
||||
"""
|
||||
# 1. 加载配置文件
|
||||
try:
|
||||
config = load_config("config.toml")
|
||||
config = load_config()
|
||||
except Exception as e:
|
||||
logger.error(f"配置文件获取失败: {str(e)}")
|
||||
# 打印详细报错位置,方便调试
|
||||
@@ -470,7 +470,7 @@ def generate_zodiac(stop_event: threading.Event = None, progress_callback=None):
|
||||
"""
|
||||
# 1. 加载配置文件
|
||||
try:
|
||||
config = load_config("config.toml")
|
||||
config = load_config()
|
||||
except Exception as e:
|
||||
logger.error(f"配置文件获取失败: {str(e)}")
|
||||
# 打印详细报错位置,方便调试
|
||||
@@ -559,7 +559,7 @@ def generate_signature(progress_callback=None) -> str:
|
||||
"""
|
||||
# 1. 加载配置文件
|
||||
try:
|
||||
config = load_config("config.toml")
|
||||
config = load_config()
|
||||
except Exception as e:
|
||||
logger.error(f"配置文件获取失败: {str(e)}")
|
||||
# 打印详细报错位置,方便调试
|
||||
|
||||
Reference in New Issue
Block a user