From 40ad45ad039c2c59ee2a66e73c58decda4265712 Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Sun, 26 Apr 2020 19:38:56 +0200 Subject: [PATCH] minor fixes --- lib/view/line.py | 2 +- lib/wttr_srv.py | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/view/line.py b/lib/view/line.py index 52c98a2..16db987 100644 --- a/lib/view/line.py +++ b/lib/view/line.py @@ -257,7 +257,7 @@ def format_weather_data(query, parsed_query, data): current_condition = data['data']['current_condition'][0] current_condition['location'] = parsed_query["location"] - current_condition['override_location'] = parsed_query["override_location"] + current_condition['override_location'] = parsed_query["override_location_name"] output = render_line(format_line, current_condition, query) return output diff --git a/lib/wttr_srv.py b/lib/wttr_srv.py index be2afa6..ac41f53 100644 --- a/lib/wttr_srv.py +++ b/lib/wttr_srv.py @@ -201,10 +201,6 @@ def _response(parsed_query, query, fast_mode=False): # at this point, we could not handle the query fast, # so we handle it with all available logic - - import json - print(json.dumps(parsed_query, indent=4)) - loc = (parsed_query['orig_location'] or "").lower() if parsed_query.get("view"): output = wttr_line(query, parsed_query) @@ -354,7 +350,8 @@ def wttr(location, request): response = get_message('CAPACITY_LIMIT_REACHED', parsed_query['lang']) # if exception is occured, we return not a png file but text - del parsed_query["png_filename"] + if "png_filename" in parsed_query: + del parsed_query["png_filename"] return _wrap_response( response, parsed_query['html_output'], png_filename=parsed_query.get('png_filename'))