INNER CODE UNIT · Python

cmd_summary

KSwordDEV/KSword · tools/acceptance_record.py:108

def cmd_summary(_args: argparse.Namespace) -> int:
    document = load()
    by_phase: dict[str, dict[str, int]] = {}
    for item in document["acceptance_items"]:
        phase = item.get("phase", "?")
        bucket = by_phase.setdefault(phase, {})
        key = item["verification_status"]
        bucket[key] = bucket.get(key, 0) + 1
    total = len(document["acceptance_items"])
    print("total acceptance items: %d" % total)
    for phase in sorted(by_phase):
        parts = ", ".join("%s=%d" % (k, v) for k, v in sorted(by_phase[phase].items()))
        print("  %s: %s" % (phase, parts))
    return 0


def main(argv: list[str]) -> int:
    parser = argparse.ArgumentParser(description=__doc__,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…