Initial commit
This commit is contained in:
commit
5f2db08b43
100 files changed
+16985
No files matched your search
@@ -0,0 +1,23 @@
|
||||
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)
|
||||
Reference in new issue
Block a user