从东方年代记吧一次性备份脚本整理成的贴吧存档工具:crawl/update/verify/as-of/restore/rebuild/images/build-zim,SQLite 事件流 + 回收站 + 中文全文索引 ZIM。
23 lines
646 B
Python
23 lines
646 B
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
"""命令行入口:``python tieba.py <子命令>``。
|
|
|
|
只做一件事:把脚本所在目录放进 sys.path,然后交给 ``tieba_archiver.cli``。
|
|
这样从任何工作目录执行 ``python C:\\path\\to\\tieba.py stats`` 都能找到包,
|
|
不用先 ``pip install -e .``。
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parent
|
|
if str(ROOT) not in sys.path:
|
|
sys.path.insert(0, str(ROOT))
|
|
|
|
from tieba_archiver.cli import main # noqa: E402 (必须在 sys.path 调整之后)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|