From 68e7b8bdb745c5f01347727a4721d6c092d50169 Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Sun, 24 May 2020 18:12:32 +0200 Subject: [PATCH] remve ansi codes from follow line (#202) --- lib/wttr_srv.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/wttr_srv.py b/lib/wttr_srv.py index ca42f90..fda492b 100644 --- a/lib/wttr_srv.py +++ b/lib/wttr_srv.py @@ -17,7 +17,7 @@ import fmt.png import parse_query from translations import get_message, FULL_TRANSLATION, PARTIAL_TRANSLATION, SUPPORTED_LANGS from buttons import add_buttons -from globals import get_help_file, \ +from globals import get_help_file, remove_ansi, \ BASH_FUNCTION_FILE, TRANSLATION_FILE, LOG_FILE, \ NOT_FOUND_LOCATION, \ MALFORMED_RESPONSE_HTML_PAGE, \ @@ -230,7 +230,10 @@ def _response(parsed_query, query, fast_mode=False): if parsed_query['html_output']: output = add_buttons(output) else: - output += '\n' + get_message('FOLLOW_ME', parsed_query['lang']) + '\n' + message = get_message('FOLLOW_ME', parsed_query['lang']) + if parsed_query.get('no-terminal', False): + message = remove_ansi(message) + output += '\n' + message + '\n' return cache.store(cache_signature, output)