Files
check-course-syllabus-aa/scripts/main.py

87 lines
2.1 KiB
Python

#!/usr/bin/env python3
"""课程教学大纲合规性体检 - CLI 入口(占位骨架)"""
import sys
from pathlib import Path
from util.constants import SKILL_SLUG, SKILL_VERSION
# 占位:开发者后续接入 jiangchang_skill_core
# from jiangchang_skill_core import ...
BASE_DIR = Path(__file__).resolve().parent.parent
def health():
"""运行检查(占位)。"""
print(f"{SKILL_SLUG} health check (placeholder)")
print(f"base_dir: {BASE_DIR}")
return 0
def version():
"""查看版本(占位)。"""
print(f"{SKILL_SLUG} v{SKILL_VERSION}")
return 0
def config_path():
"""查看配置位置(占位)。"""
print(f"{BASE_DIR / '.env'}")
return 0
def init_db():
"""初始化数据库(占位)。"""
print("init-db: 后续由开发者按 references/SCHEMA.md 实现")
return 0
def audit_syllabus(syllabus_id: str):
"""体检这份大纲。"""
print(f"audit-syllabus: syllabus_id={syllabus_id} (待开发者实现)")
return 0
def batch_audit_syllabus(major_id: str = "", course_ids: str = ""):
"""批量体检。"""
print(f"batch-audit-syllabus: major_id={major_id} course_ids={course_ids} (待开发者实现)")
return 0
def render_html(audit_id: str):
"""查看体检报告。"""
print(f"render-html: audit_id={audit_id} (待开发者实现)")
return 0
def sync_norm_library():
"""同步编制规范库。"""
print("sync-norm-library (待开发者实现)")
return 0
COMMANDS = {
"health": health,
"version": version,
"config-path": config_path,
"init-db": init_db,
"audit-syllabus": audit_syllabus,
"batch-audit-syllabus": batch_audit_syllabus,
"render-html": render_html,
"sync-norm-library": sync_norm_library,
}
def main(argv=None):
argv = argv or sys.argv[1:]
if not argv or argv[0] not in COMMANDS:
print("Usage: python scripts/main.py <command>")
print("Commands:", ", ".join(COMMANDS.keys()))
return 1
return COMMANDS[argv[0]](*argv[1:])
if __name__ == "__main__":
sys.exit(main())