From 4b7523c8c9c960ee1d4767cc153d5d8e16f77e96 Mon Sep 17 00:00:00 2001 From: Marcin Maka Date: Fri, 15 May 2020 17:08:57 +0200 Subject: [PATCH] tools: sof-ri-info: use colors for terminal output only Do not use colors if stdout is not a tty. Signed-off-by: Marcin Maka --- tools/sof_ri_info/sof_ri_info.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/sof_ri_info/sof_ri_info.py b/tools/sof_ri_info/sof_ri_info.py index 2c1ad8fdf..b03fc98ff 100755 --- a/tools/sof_ri_info/sof_ri_info.py +++ b/tools/sof_ri_info/sof_ri_info.py @@ -1013,7 +1013,11 @@ class FwBin(Component): def main(args): """ main function """ - Attribute.no_colors = args.no_colors + if sys.stdout.isatty(): + Attribute.no_colors = args.no_colors + else: + Attribute.no_colors = True + Attribute.full_bytes = args.full_bytes fw_bin = parse_fw_bin(args.sof_ri_path, args.verbose, not args.headers)