mirror of
https://github.com/chubin/wttr.in.git
synced 2025-08-14 15:58:27 +02:00
minor cleanup
This commit is contained in:
@ -196,7 +196,6 @@ def location_processing(location, ip_addr):
|
||||
override_location_name = location[1:].replace('+', ' ')
|
||||
location = "%s,%s" % (geolocation['latitude'], geolocation['longitude'])
|
||||
full_address = geolocation['address']
|
||||
print full_address
|
||||
else:
|
||||
location = NOT_FOUND_LOCATION #location[1:]
|
||||
try:
|
||||
|
@ -92,7 +92,6 @@ def get_wetter(location, ip, html=False, lang=None, query=None, location_name=No
|
||||
stdout = open(test_file, 'r').read()
|
||||
stderr = ""
|
||||
break
|
||||
print "LOCATION = ", location
|
||||
if location == NOT_FOUND_LOCATION:
|
||||
location_not_found = True
|
||||
location = DEFAULT_LOCATION
|
||||
@ -194,7 +193,6 @@ def get_wetter(location, ip, html=False, lang=None, query=None, location_name=No
|
||||
stdout = re.sub("<head>", "<head>" + title + opengraph, stdout)
|
||||
open(filename+'.html', 'w').write(stdout)
|
||||
|
||||
print "LOCATION >>> ", location
|
||||
filename = get_filename(location, lang=lang, query=query, location_name=location_name)
|
||||
if not os.path.exists(filename):
|
||||
save_weather_data(location, filename, lang=lang, query=query, location_name=location_name, full_address=full_address)
|
||||
@ -221,7 +219,6 @@ def get_moon(location, html=False, lang=None):
|
||||
env = os.environ.copy()
|
||||
if lang:
|
||||
env['LANG'] = lang
|
||||
print cmd
|
||||
p = Popen(cmd, stdout=PIPE, stderr=PIPE, env=env)
|
||||
stdout = p.communicate()[0]
|
||||
|
||||
|
@ -171,7 +171,7 @@ def wttr(location, request):
|
||||
query = parse_query.metric_or_imperial(query, lang, us_ip=us_ip)
|
||||
|
||||
log(" ".join(map(str, [
|
||||
ip_addr, user_agent, orig_location.encode('utf-8'), location,
|
||||
ip_addr, user_agent, (orig_location or "").encode('utf-8'), location,
|
||||
query.get('use_imperial', False), lang
|
||||
])))
|
||||
|
||||
|
Reference in New Issue
Block a user