24 lines
798 B
Python
24 lines
798 B
Python
from scraper.cli import build_parser
|
|
# Build and try to invoke parse
|
|
import argparse
|
|
p = build_parser()
|
|
try:
|
|
p.parse_args(["parse", "--input", "samples/assembly_dailyfile_latest.html", "--output", "out/_dbg.jsonl"])
|
|
print("parse subcommand EXISTS")
|
|
except SystemExit:
|
|
pass
|
|
subs = p._subparsers._name_map if hasattr(p, "_subparsers") else None
|
|
print("registered subcommands:", list(subs.keys()) if subs else "none")
|
|
|
|
# Direct test of register
|
|
from scraper.parse_cli import register, handle_parse
|
|
import argparse as a
|
|
root = a.ArgumentParser()
|
|
sub = root.add_subparsers(dest="command")
|
|
try:
|
|
register(sub)
|
|
print("register() OK on fresh sub; name_map:", list(sub._name_map.keys()))
|
|
except Exception as e:
|
|
import traceback; traceback.print_exc()
|
|
print("register FAILED:", e)
|