kevin.yang il y a 1 mois
Parent
commit
4cfb5a5452
2 fichiers modifiés avec 0 ajouts et 35 suppressions
  1. 0 34
      utils/general.py
  2. 0 1
      workers/consumption_work.py

+ 0 - 34
utils/general.py

@@ -1,34 +0,0 @@
-import os
-import re
-from pathlib import Path
-
-
-def is_prod() -> bool:
-    """判断当前环境是否为生产环境"""
-    return os.getenv('ENV', 'test') == 'prod'
-
-
-def get_root_dir() -> str:
-    """获取项目根目录的绝对路径"""
-    current_path = Path(__file__).resolve()
-    root_path = current_path.parent if not current_path.is_dir() else current_path
-    while True:
-        if 'requirements.txt' in os.listdir(root_path):
-            return str(root_path.absolute())
-        root_path = root_path.parent
-
-
-def get_abs_path(relative_path: str) -> str:
-    """获取目标文件或目录的相对路径在系统中的绝对路径"""
-    return os.path.join(get_root_dir(), relative_path)
-
-
-def pascal_to_snake(pascal_str: str) -> str:
-    """将Pascal字符串转为蛇形字符串"""
-    snake_str = re.sub(r'([a-z])([A-Z])', r'\1_\2', pascal_str)
-    return snake_str.lower()
-
-
-def snake_to_pascal(snake_str: str) -> str:
-    """将蛇形字符串转为Pascal字符串"""
-    return ''.join([item.title() for item in snake_str.split('_')])

+ 0 - 1
workers/consumption_work.py

@@ -25,7 +25,6 @@ from utils.dy_ks_get_url import Dy_KS
 from utils.feishu_form import Material
 from utils.feishu_utils import Feishu
 from utils.ffmpeg import FFmpeg
-from utils.general import get_abs_path
 from utils.gpt4o_mini_help import GPT4oMini
 from utils.piaoquan import PQ
 from utils.sql_help import sqlCollect