mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-05-03 17:01:07 -05:00
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:
parent
2cb0e38703
commit
ae4df05926
@ -491,7 +491,7 @@ class Weather(callbacks.Plugin):
|
||||
if args['alerts']: # only look for alerts if there.
|
||||
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'] = 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.
|
||||
else: # no alerts found (empty).
|
||||
outdata['alerts'] = "No alerts."
|
||||
|
Loading…
x
Reference in New Issue
Block a user