From a16eb7cc05f94aeaa652258f0809039fca1465e8 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Wed, 23 Feb 2022 10:23:54 +0100 Subject: [PATCH] Refactor logic for readability Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- openpype/lib/terminal.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openpype/lib/terminal.py b/openpype/lib/terminal.py index 30c559eec6..821aefe2ff 100644 --- a/openpype/lib/terminal.py +++ b/openpype/lib/terminal.py @@ -49,11 +49,13 @@ class Terminal: """ from openpype.lib import env_value_to_bool - use_colors = not env_value_to_bool( - "OPENPYPE_LOG_NO_COLORS", default=not Terminal.use_colors + log_no_colors = env_value_to_bool( + "OPENPYPE_LOG_NO_COLORS", default=None ) - if not use_colors: - Terminal.use_colors = use_colors + if log_no_colors is not None: + Terminal.use_colors = not log_no_colors + + if not Terminal.use_colors: Terminal._initialized = True return