From 9641c667511544aa298626b02a7fcf56c13afe4a Mon Sep 17 00:00:00 2001 From: SlyAimer <2289782085@qq.com> Date: Tue, 4 Mar 2025 22:47:03 +0800 Subject: [PATCH] =?UTF-8?q?refactor(path=5Fconfig):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=85=8D=E7=BD=AE=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 简化路径拼接方式,使用直接字符串拼接替代 os.path.join - 统一路径分隔符为Unix风格,提高代码可读性和兼容性 --- src/configs/path_config.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/configs/path_config.py b/src/configs/path_config.py index 366d334..99f0865 100644 --- a/src/configs/path_config.py +++ b/src/configs/path_config.py @@ -1,41 +1,41 @@ import os from pathlib import Path -path = os.path.join(os.getcwd(), '/src/resources') +path = os.getcwd()+'/src/resources' # 塔罗牌图片路径 -image_local_qq_image_path = os.path.join(path,'/image/qq_image') +image_local_qq_image_path = path+'/image/qq_image' os.makedirs(image_local_qq_image_path, exist_ok=True) # 个人图片路径 -image_local_path= os.path.join(path,"/image/MaoYuNa") +image_local_path= path+"/image/MaoYuNa" os.makedirs(image_local_path, exist_ok=True) # 塔罗牌图片路径 -tarots_img_path = os.path.join(path,'/image/tarot/TarotImages/') +tarots_img_path = path+'/image/tarot/TarotImages/' os.makedirs(tarots_img_path, exist_ok=True) # 摸摸头图片路径 -rua_png = os.path.join(path,'/image/rua/') +rua_png = path+'/image/rua/' os.makedirs(rua_png, exist_ok=True) # 喜报、悲报图片路径 -good_bad = os.path.join(path,'/image/good_bad_news/') +good_bad = path+'/image/good_bad_news/' os.makedirs(good_bad, exist_ok=True) #谁说 生成图片路径 -who_say_path = os.path.join(path,'/image/who_say/') +who_say_path = path+'/image/who_say/' os.makedirs(who_say_path, exist_ok=True) #yuc_wiki 动漫wiki -yuc_wiki_path = os.path.join(path , '/image/yuc_wiki/') +yuc_wiki_path = path + '/image/yuc_wiki/' os.makedirs(yuc_wiki_path, exist_ok=True) # 字体路径 -font_path = os.path.join(path , '/font/') +font_path = path + '/font/' os.makedirs(font_path, exist_ok=True) # 临时数据路径 -temp_path = os.path.join(path , '/temp/') +temp_path = path + '/temp/' os.makedirs(temp_path, exist_ok=True) # 日志路径 -log_path = os.path.join(path,'/log/') +log_path = path+'/log/' os.makedirs(log_path, exist_ok=True) # 视频路径 -video_path = os.path.join(path,'/video/') +video_path = path+'/video/' os.makedirs(video_path, exist_ok=True)