Refactor: modular main.py with selectable functions, save debug output to debug/ dir

This commit is contained in:
2025-12-29 01:09:59 +08:00
parent 283a035ab1
commit 04b7b3bb36
4 changed files with 253 additions and 61 deletions

View File

@@ -60,15 +60,21 @@ OrbitIn/
## 命令
```bash
# 获取并处理数据(带数据库存储)
# 默认:获取、提取、解析并保存到数据库
python3 main.py
# 不存储到数据库
python3 main.py --no-db
# 仅获取HTML并提取文本保存到debug目录
python3 main.py fetch
# 获取并保存带时间戳的debug文件
python3 main.py fetch-debug
# 生成日报
python3 -c "from src.report import DailyReportGenerator; g = DailyReportGenerator(); g.print_report('2025-12-28'); g.close()"
python3 main.py report 2025-12-28
# 测试解析模块
python3 -c "from src.parser import HandoverLogParser; p = HandoverLogParser(); print(p.parse(open('layout_output.txt').read())[:3])"
# 解析测试
python3 main.py parse-test
# 添加未统计数据
python3 main.py --unaccounted 118 --month 2025-12
```