tools: add example json-seq render based on tqdm

Add an example render to test/demo how the json-seq based progress
works. It needs the python `tqdm` package for the actual rendering.

See the output with:
```
$ sudo OSBUILD_TEST_STORE=/var/tmp/osbuild-test-store  \
    python3 -m osbuild --libdir=. --monitor=JSONSeqMonitor --export image \
      --output-dir=/tmp/output-dir ./test/data/manifests/fedora-boot.json | ./tools/osbuild-json-seq-progress-example-renderer
```
This commit is contained in:
Michael Vogt 2023-11-24 11:24:50 +01:00 committed by Ondřej Budai
parent 83e66839bc
commit f034bef127
2 changed files with 93 additions and 0 deletions

View file

@ -197,6 +197,8 @@ def osbuild_cli() -> int:
for pid in exports:
export(pid, output_directory, object_store, manifest)
# TODO: subpress when "--monitor=JSONSeqMontior" is used
# or (be explcit) have "--no-summary" or something
if args.json:
r = fmt.output(manifest, r, object_store)
json.dump(r, sys.stdout)