feat(configs): 自动创建缺失的目录路径

在 `path_config.py` 中为所有路径添加 `os.makedirs`,确保目录不存在时自动创建,避免运行时错误。
This commit is contained in:
SlyAimer 2025-02-15 16:32:42 +08:00
parent 77e052a175
commit b982d2ba49

View file

@ -6,36 +6,40 @@ path = os.getcwd()+'/src/resources'
# 塔罗牌图片路径
image_local_qq_image_path = path+'/image/qq_image'
os.makedirs(image_local_qq_image_path, exist_ok=True)
# 个人图片路径
image_local_path= path+"/image/MaoYuNa"
os.makedirs(image_local_path, exist_ok=True)
# 塔罗牌图片路径
tarots_img_path = path+'/image/tarot/TarotImages/'
os.makedirs(tarots_img_path, exist_ok=True)
# 摸摸头图片路径
rua_png = path+'/image/rua/'
os.makedirs(rua_png, exist_ok=True)
# 喜报、悲报图片路径
good_bad = path+'/image/good_bad_news/'
os.makedirs(good_bad, exist_ok=True)
#谁说 生成图片路径
who_say_path = path+'/image/who_say/'
os.makedirs(who_say_path, exist_ok=True)
# 日报
daily_news_path = path+'/image/report/'
os.makedirs(daily_news_path, exist_ok=True)
# 轻小说
light_novel_path = path + '/image/lightnovel/'
os.makedirs(light_novel_path, exist_ok=True)
# 字体路径
font_path = path + '/font/'
os.makedirs(font_path, exist_ok=True)
# 临时数据路径
temp_path = path + '/temp/'
os.makedirs(temp_path, exist_ok=True)
# 日志路径
log_path = path+'/log/'
os.makedirs(log_path, exist_ok=True)
# 视频路径
video_path = path+'/video/'
os.makedirs(video_path, exist_ok=True)
@ -49,10 +53,3 @@ video_path = path+'/video/'
# TEMPLATE_PATH = Path() / "src" / "resources" / "template"
# # 视频路径
# VIDEO_PATH = Path() / "src" / "resources" / "videos"
# IMAGE_PATH.mkdir(parents=True, exist_ok=True)
# RECORD_PATH.mkdir(parents=True, exist_ok=True)
# TEXT_PATH.mkdir(parents=True, exist_ok=True)
# LOG_PATH.mkdir(parents=True, exist_ok=True)
# FONT_PATH.mkdir(parents=True, exist_ok=True)
# DATA_PATH.mkdir(parents=True, exist_ok=True)
# TEMP_PATH.mkdir(parents=True, exist_ok=True)