fix(ТСН): своя печать результатов, _p ждёт поля ФГИС

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
anor
2026-11-18 02:14:05 +10:00
co-authored by Claude Code
parent bd022fadaa
commit 3204879d87
+8 -2
View File
@@ -413,13 +413,19 @@ def main(argv=None) -> int:
args = ap.parse_args(argv)
if args.source == "niac_tsn":
def _print_tsn(r):
if r.get("skipped"):
print(f" = {r['key']}: пропущен ({r.get('reason','')})")
else:
print(f" + {r['key']}: {r.get('bytes')} байт, страниц {r.get('pages')}, "
f"sha {(r.get('sha256') or '')[:12]}")
try:
for r in pull_niac_tsn(scope=args.scope, keep_pdf=args.keep_pdf):
_p(r)
_print_tsn(r)
return 0
except PartialPullError as e:
for r in e.results:
_p(r)
_print_tsn(r)
print(str(e), file=sys.stderr)
return 1