minor fixes

v2
Igor Chubin 5 years ago
parent 16e9ba5740
commit 40ad45ad03

@ -257,7 +257,7 @@ def format_weather_data(query, parsed_query, data):
current_condition = data['data']['current_condition'][0] current_condition = data['data']['current_condition'][0]
current_condition['location'] = parsed_query["location"] 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) output = render_line(format_line, current_condition, query)
return output return output

@ -201,10 +201,6 @@ def _response(parsed_query, query, fast_mode=False):
# at this point, we could not handle the query fast, # at this point, we could not handle the query fast,
# so we handle it with all available logic # so we handle it with all available logic
import json
print(json.dumps(parsed_query, indent=4))
loc = (parsed_query['orig_location'] or "").lower() loc = (parsed_query['orig_location'] or "").lower()
if parsed_query.get("view"): if parsed_query.get("view"):
output = wttr_line(query, parsed_query) output = wttr_line(query, parsed_query)
@ -354,7 +350,8 @@ def wttr(location, request):
response = get_message('CAPACITY_LIMIT_REACHED', parsed_query['lang']) response = get_message('CAPACITY_LIMIT_REACHED', parsed_query['lang'])
# if exception is occured, we return not a png file but text # 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( return _wrap_response(
response, parsed_query['html_output'], response, parsed_query['html_output'],
png_filename=parsed_query.get('png_filename')) png_filename=parsed_query.get('png_filename'))

Loading…
Cancel
Save