weather: deal with VRB returned for degrees
parent
4b199e9629
commit
900ac0c5c9
|
@ -221,25 +221,26 @@ def f_weather(self, origin, match, args):
|
||||||
description = 'Violent storm'
|
description = 'Violent storm'
|
||||||
else: description = 'Hurricane'
|
else: description = 'Hurricane'
|
||||||
|
|
||||||
degrees = float(wind[0:3])
|
if wind[0:3] == 'VRB':
|
||||||
#if degrees == 'VRB':
|
degrees = '\u21BB'
|
||||||
# degrees = '\u21BB'
|
else:
|
||||||
if (degrees <= 22.5) or (degrees > 337.5):
|
degrees = float(wind[0:3])
|
||||||
degrees = '\u2191'
|
if (degrees <= 22.5) or (degrees > 337.5):
|
||||||
elif (degrees > 22.5) and (degrees <= 67.5):
|
degrees = '\u2191'
|
||||||
degrees = '\u2197'
|
elif (degrees > 22.5) and (degrees <= 67.5):
|
||||||
elif (degrees > 67.5) and (degrees <= 112.5):
|
degrees = '\u2197'
|
||||||
degrees = '\u2192'
|
elif (degrees > 67.5) and (degrees <= 112.5):
|
||||||
elif (degrees > 112.5) and (degrees <= 157.5):
|
degrees = '\u2192'
|
||||||
degrees = '\u2198'
|
elif (degrees > 112.5) and (degrees <= 157.5):
|
||||||
elif (degrees > 157.5) and (degrees <= 202.5):
|
degrees = '\u2198'
|
||||||
degrees = '\u2193'
|
elif (degrees > 157.5) and (degrees <= 202.5):
|
||||||
elif (degrees > 202.5) and (degrees <= 247.5):
|
degrees = '\u2193'
|
||||||
degrees = '\u2199'
|
elif (degrees > 202.5) and (degrees <= 247.5):
|
||||||
elif (degrees > 247.5) and (degrees <= 292.5):
|
degrees = '\u2199'
|
||||||
degrees = '\u2190'
|
elif (degrees > 247.5) and (degrees <= 292.5):
|
||||||
elif (degrees > 292.5) and (degrees <= 337.5):
|
degrees = '\u2190'
|
||||||
degrees = '\u2196'
|
elif (degrees > 292.5) and (degrees <= 337.5):
|
||||||
|
degrees = '\u2196'
|
||||||
|
|
||||||
if not icao_code.startswith('EN') and not icao_code.startswith('ED'):
|
if not icao_code.startswith('EN') and not icao_code.startswith('ED'):
|
||||||
wind = '%s %skt (%s)' % (description, speed, degrees)
|
wind = '%s %skt (%s)' % (description, speed, degrees)
|
||||||
|
|
Loading…
Reference in New Issue