From ba38aaf6920b246f6644cfb49730a5e2ee5f9db0 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Tue, 7 Jul 2020 17:17:31 -0400 Subject: --print-status=html creates html report --- bh20seqanalyzer/main.py | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/bh20seqanalyzer/main.py b/bh20seqanalyzer/main.py index 2fefa86..1746587 100644 --- a/bh20seqanalyzer/main.py +++ b/bh20seqanalyzer/main.py @@ -235,9 +235,10 @@ def upload_schema(api, workflow_def_project): return "keep:%s/schema.yml" % pdh -def print_status(api, uploader_project): +def print_status(api, uploader_project, fmt): pending = arvados.util.list_all(api.collections().list, filters=[["owner_uuid", "=", uploader_project]]) out = [] + status = {} for p in pending: prop = p["properties"] out.append(prop) @@ -245,7 +246,38 @@ def print_status(api, uploader_project): prop["status"] = "pending" prop["created_at"] = p["created_at"] prop["uuid"] = p["uuid"] - print(json.dumps(out, indent=2)) + status[prop["status"]] = status.get(prop["status"], 0) + 1 + if fmt == "html": + print( +""" + +
+""") + print("Total collections in upload project %s
" % len(out)) + print("Status %s
" % status) + print( +""" +Collection | +Sequence label | +Status | +Errors |
---|---|---|---|
%s | " % (r["uuid"], r["uuid"])) + print("%s | " % r["sequence_label"]) + print("%s | " % r["status"]) + print("%s | " % "\n".join(r.get("errors", [])))
+ print("