diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-03-03 22:27:17 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-03-03 22:27:17 +0100 |
commit | 4c71fabb859823cec4fa53d4a84b4025346a6ebd (patch) | |
tree | dc7e856cb16ccef4378335518f8a7349856cd515 /src | |
parent | add moderate example and multiple column printing functions (diff) | |
download | xpybar-4c71fabb859823cec4fa53d4a84b4025346a6ebd.tar.gz xpybar-4c71fabb859823cec4fa53d4a84b4025346a6ebd.tar.bz2 xpybar-4c71fabb859823cec4fa53d4a84b4025346a6ebd.tar.xz |
weather bug fix
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/weather.py | 4 |
1 files 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): |