Mercurial > libervia-backend
changeset 4326:5fd6a4dc2122
cli (output/std): use `rich` to output JSON.
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 20 Nov 2024 11:38:44 +0100 |
parents | 45662662a432 |
children | 554a87ae17a6 |
files | libervia/cli/output_std.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libervia/cli/output_std.py Wed Nov 20 11:30:43 2024 +0100 +++ b/libervia/cli/output_std.py Wed Nov 20 11:38:44 2024 +0100 @@ -112,7 +112,7 @@ ) -class Json(object): +class Json: """outputs in json format""" def __init__(self, host): @@ -132,7 +132,7 @@ host.register_output(C.OUTPUT_COMPLEX, C.OUTPUT_NAME_JSON_RAW, self.dump) def dump(self, data): - self.host.disp(json.dumps(data, default=str)) + self.host.console.print_json(data=data, indent=None, highlight=False, default=str) def dump_pretty(self, data): - self.host.disp(json.dumps(data, indent=4, default=str)) + self.host.console.print_json(data=data, indent=4, default=str)