Prevent location change when using PWS or ICAO

This commit is contained in:
Samer Albahra
2015-03-18 19:29:21 -05:00
parent 19b63b7b4c
commit ebf750ae39

View File

@@ -138,8 +138,8 @@ def application(environ, start_response):
tzone = None
if (lat) and (lon):
owm_loc = 'lat='+lat+'&lon='+lon
loc = ''+lat+','+lon
if not loc.startswith('pws:') and not loc.startswith('icao:'):
loc = ''+lat+','+lon
home = ephem.Observer()
@@ -151,8 +151,6 @@ def application(environ, start_response):
sunrise = calendar.timegm(home.next_rising(sun).datetime().utctimetuple())
sunset = calendar.timegm(home.next_setting(sun).datetime().utctimetuple())
else:
owm_loc = 'q='+urllib.quote(loc)
if tzone:
try: