From 4c71fabb859823cec4fa53d4a84b4025346a6ebd Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 3 Mar 2014 22:27:17 +0100 Subject: weather bug fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/plugins/weather.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/weather.py b/src/plugins/weather.py index 0f84d9d..a02bf85 100644 --- a/src/plugins/weather.py +++ b/src/plugins/weather.py @@ -61,7 +61,7 @@ class Weather: station_header, self.headers, decoded = decoded[0].split(', '), decoded[:2], decoded[2:] self.station, station_header = station_header[0], ', '.join(station_header[1:]) self.location = station_header.split(' (')[0] - self.latitude, self.longitude = station_header.split(') ').split(' ')[2:] + self.latitude, self.longitude = station_header.split(') ')[1].split(' ')[:2] self.latitude, ysign = self.latitude[:-1], self.latitude[-1] == 'S' self.longitude, xsign = self.longitude[:-1], self.longitude[-1] == 'W' self.latitude = [float(x) for x in self.latitude.split('-')] @@ -112,7 +112,7 @@ class Weather: self.wind_dir = None if ob.startswith('VRB') else float(ob[:3]) ob = ob[3:] i = ob.find('G') if 'G' in ob else ob.find('K') - self.wind_speed, ob = float(ob[:i]), wind[i:] + self.wind_speed, ob = float(ob[:i]), ob[i:] self.wind_gusts = float(ob[1 : -2]) if ob[0] == 'G' else None def __wind_var(self, ob): -- cgit v1.2.3-70-g09d2