28 lines
713 B
Python
28 lines
713 B
Python
#!/usr/bin/env python3
|
|
"""向 LocalNav SQLite 写入 gate_scout_order 两个服务(可重复执行,已存在则跳过)。"""
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
_ROOT = Path(__file__).resolve().parent.parent
|
|
if str(_ROOT) not in sys.path:
|
|
sys.path.insert(0, str(_ROOT))
|
|
|
|
os.environ.setdefault("NAV_SEED_GATE_SCOUT", "1")
|
|
|
|
from app import app, db # noqa: E402
|
|
from app import _ensure_gate_scout_services # noqa: E402
|
|
|
|
|
|
def main() -> None:
|
|
with app.app_context():
|
|
_ensure_gate_scout_services()
|
|
db.session.commit()
|
|
print("完成。请刷新本地导航首页查看「Gate 扫单」分组。")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|