Weather: don't limit alerts output to 300 characters (it will be handled automatically via mores)

From upstream commit reticulatingspline/Weather@5ed7db7a8e.
This commit is contained in:
James Lu 2015-03-25 20:52:25 -07:00
parent 2cb0e38703
commit ae4df05926

View File

@ -491,7 +491,7 @@ class Weather(callbacks.Plugin):
if args['alerts']: # only look for alerts if there. if args['alerts']: # only look for alerts if there.
if data['alerts']: # alerts is a list. it can also be empty. if data['alerts']: # alerts is a list. it can also be empty.
outdata['alerts'] = data['alerts'][0]['message'] # need to do some formatting below. outdata['alerts'] = data['alerts'][0]['message'] # need to do some formatting below.
outdata['alerts'] = outdata['alerts'].replace('\n', ' ')[:300] # \n->' ' and max 300 chars. outdata['alerts'] = outdata['alerts'].replace('\n', ' ')
outdata['alerts'] = utils.str.normalizeWhitespace(outdata['alerts']) # fix pesky double whitespacing. outdata['alerts'] = utils.str.normalizeWhitespace(outdata['alerts']) # fix pesky double whitespacing.
else: # no alerts found (empty). else: # no alerts found (empty).
outdata['alerts'] = "No alerts." outdata['alerts'] = "No alerts."