mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Finally fix bug #1034916, Weather.wunder exception
This commit is contained in:
parent
06c16396b0
commit
168e61aef8
@ -444,13 +444,22 @@ class Weather(callbacks.Privmsg):
|
|||||||
resp.append('Conditions: %s.' % info['Conditions'])
|
resp.append('Conditions: %s.' % info['Conditions'])
|
||||||
humidity = info['Humidity']
|
humidity = info['Humidity']
|
||||||
resp.append('Humidity: %s.' % info['Humidity'])
|
resp.append('Humidity: %s.' % info['Humidity'])
|
||||||
(dew, deg, unit) = info['Dew Point'].split()
|
# Apparently, the "Dew Point" and "Wind" categories are occasionally
|
||||||
if convert:
|
# set to "-" instead of an actual reading. So, we'll just catch
|
||||||
dew = self._getTemp(int(dew), deg, unit, msg.args[0])
|
# the ValueError from trying to unpack a tuple of the wrong size.
|
||||||
else:
|
try:
|
||||||
dew = deg.join((dew, unit))
|
(dew, deg, unit) = info['Dew Point'].split()
|
||||||
resp.append('Dew Point: %s.' % dew)
|
if convert:
|
||||||
resp.append('Wind: %s at %s %s.' % tuple(info['Wind'].split()))
|
dew = self._getTemp(int(dew), deg, unit, msg.args[0])
|
||||||
|
else:
|
||||||
|
dew = deg.join((dew, unit))
|
||||||
|
resp.append('Dew Point: %s.' % dew)
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
resp.append('Wind: %s at %s %s.' % tuple(info['Wind'].split()))
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
resp.append('Pressure: %s.' % info['Pressure'])
|
resp.append('Pressure: %s.' % info['Pressure'])
|
||||||
resp.append('Visibility: %s.' % info['Visibility'])
|
resp.append('Visibility: %s.' % info['Visibility'])
|
||||||
resp = map(utils.htmlToText, resp)
|
resp = map(utils.htmlToText, resp)
|
||||||
|
Loading…
Reference in New Issue
Block a user