# HG changeset patch # User Goffi # Date 1732099124 -3600 # Node ID 5fd6a4dc21221bf868bd1f11c25fcb98f547c812 # Parent 45662662a4320798f29485ae19db34a52f2a0088 cli (output/std): use `rich` to output JSON. diff -r 45662662a432 -r 5fd6a4dc2122 libervia/cli/output_std.py --- 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)