Files
NEP-auto/main.py
2025-12-09 01:15:38 +08:00

34 lines
874 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# main.py
import os
import sys
from src.utils import setup_logger
from src.workflow import Workflow
def main():
root_dir = os.getcwd()
# 1. 初始化日志
# 既然 workspace 还没创建先放到根目录Workflow 初始化后再放到 workspace 也可以
# 这里简单起见放在根目录
setup_logger(root_dir)
# 2. 检查基本文件是否存在
required_dirs = ['config', 'data', 'template']
for d in required_dirs:
if not os.path.exists(os.path.join(root_dir, d)):
print(f"Error: Missing directory '{d}'. Please check file structure.")
sys.exit(1)
# 3. 启动工作流
try:
app = Workflow(root_dir)
app.run()
except Exception as e:
import traceback
traceback.print_exc()
print(f"Critical Error: {e}")
if __name__ == "__main__":
main()