From: Jeremy Stanley Date: Sat, 11 May 2024 00:42:09 +0000 (+0000) Subject: Fix alert content filtering X-Git-Tag: 2.5.0~6 X-Git-Url: https://yuggoth.org/gitweb?a=commitdiff_plain;h=af6955376b8cf40bb20225bf4f16c56d52bfc883;p=weather.git Fix alert content filtering At some point, the NWS stopped printing its name in all capitals in alerts and forecasts, which had the effect of turning off the "smart" header/footer trimming in the script. Switch to match the current string they've been using lately. --- diff --git a/weather.py b/weather.py index 6b42a84..8df769e 100644 --- a/weather.py +++ b/weather.py @@ -336,7 +336,7 @@ def get_alert( if alert: if verbose: return alert else: - if alert.find("\nNATIONAL WEATHER SERVICE") == -1: + if alert.find("\nNational Weather Service") == -1: muted = False else: muted = True @@ -360,7 +360,7 @@ def get_alert( if line.startswith("Expires:") \ and "Expires:" + valid_time > line: return "" - if muted and line.startswith("NATIONAL WEATHER SERVICE"): + if muted and line.startswith("National Weather Service"): muted = False line = "" elif line == "&&":