From ebf750ae3901c9b40320b169e9b48d7112d0a260 Mon Sep 17 00:00:00 2001 From: Samer Albahra Date: Wed, 18 Mar 2015 19:29:21 -0500 Subject: [PATCH] Prevent location change when using PWS or ICAO --- application.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/application.py b/application.py index 227256f..32dd90e 100644 --- a/application.py +++ b/application.py @@ -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: