refactor: move flat modules into inbound_verify package (Tier 1, behavior-identical)
Relocate 12 root .py modules into inbound_verify/ (sites/, cli/ subpackages). Rewrite all internal imports to package-qualified; drop the site_ prefix on the 5 site modules and their 28 call sites. Fix paths.py BASE_DIR to anchor at the project root. Add main() entry wrappers (cli/router, cli/server, store). No behavior change. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
20
inbound_verify/paths.py
Normal file
20
inbound_verify/paths.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# paths.py
|
||||
# 统一的路径锚点:所有路径都以本项目所在目录为基准,避免依赖运行时的工作目录(cwd)。
|
||||
# 这样无论从哪个目录启动脚本(IDE / 命令行 / 计划任务 / 双击),
|
||||
# 下载目录与配置文件都能稳定定位,不会出现“文件落到别处”或“读不到密码”的隐蔽故障。
|
||||
|
||||
import os
|
||||
|
||||
# 项目根目录(以本文件所在位置为基准,与从哪个目录启动脚本无关)
|
||||
# __file__ = <root>/inbound_verify/paths.py → 上两级 = 项目根
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
# 统一的下载 / 输出目录
|
||||
DOWNLOAD_DIR = os.path.join(BASE_DIR, "downloads")
|
||||
OUTPUT_DIR = os.path.join(BASE_DIR, "output")
|
||||
|
||||
# 统一的配置文件路径(注意:config.yaml 需与本项目脚本放在同一目录下)
|
||||
CONFIG_PATH = os.path.join(BASE_DIR, "config.yaml")
|
||||
|
||||
# 状态存储(SQLite,阶段0:心跳 / 登录态 / 数据态持久化,重启不丢)
|
||||
STATE_DB_PATH = os.path.join(BASE_DIR, "state", "state.db")
|
||||
Reference in New Issue
Block a user