Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
pagfiles --output-header
Browse files Browse the repository at this point in the history
  • Loading branch information
SamStudio8 committed Jan 25, 2022
1 parent 0ff59f0 commit c57af2f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.47.3 2022-01-25
### Changed
* `get pag --mode pagfiles` now supports prepending a header with `--output-header` and will translate suppression status to "SUPPRESSED" or "VALID" rather than printing a bool

## 0.47.2 2022-01-10
### Changed
* `.ocarina` file automatically created if it does not exist instead of suggesting the user creates it themselves
Expand Down
15 changes: 14 additions & 1 deletion ocarina/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ def cli():

get_pag_parser.add_argument("--mode", default="")

get_pag_parser.add_argument("--output-header", action="store_true", help="add header to output (pagfiles mode only)")
get_pag_parser.set_defaults(func=wrap_get_qc)


Expand Down Expand Up @@ -869,9 +870,21 @@ def wrap_get_qc(ocarina, args, metadata={}, metrics={}):
# Bad reply
sys.exit(69) #EX_UNAVAILABLE
if j["get"]["count"] >= 1:

if args.output_header:
print("\t".join([
"pag_name",
"file_type",
"file_path",
"file_hash",
"file_size",
"pag_suppressed",
"pag_basic_qc",
])
for fdat in j["get"]["result"]:
#pag, kind, path, fhash, fsize, pag_qc = fdat
#pag, kind, path, fhash, fsize, pag_supp, pag_qc = fdat
fdat[-1] = "PASS" if fdat[-1] else "FAIL"
fdat[-2] = "SUPPRESSED" if fdat[-2] else "VALID" # wtf was i thinking this is gross
print("\t".join([str(x) for x in fdat]))
elif args.ofield:
csv_w = csv.DictWriter(sys.stdout, fieldnames=[f[1] for f in args.ofield], delimiter=args.odelimiter)
Expand Down
2 changes: 1 addition & 1 deletion ocarina/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.47.2"
__version__ = "0.47.3"

0 comments on commit c57af2f

Please sign in to comment.