From e7167c36ef2d930078182fc1c469993f632c4696 Mon Sep 17 00:00:00 2001 From: Mason10198 <31994327+Mason10198@users.noreply.github.com> Date: Wed, 14 Jun 2023 19:33:54 -0500 Subject: [PATCH] Remove leftover debug line --- SkywarnPlus.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/SkywarnPlus.py b/SkywarnPlus.py index 92f4414..1585006 100644 --- a/SkywarnPlus.py +++ b/SkywarnPlus.py @@ -292,8 +292,7 @@ def getAlerts(countyCodes): logger.debug("Checking for alerts in {}".format(countyCodes)) for countyCode in countyCodes: logger.debug("Checking for alerts in {}".format(countyCode)) - # url = "https://api.weather.gov/alerts/active?zone={}".format(countyCode) - url = "https://api.weather.gov/alerts/active?area=AR" # THIS RETURNS ALL ACTIVE ALERTS IN THE US + url = "https://api.weather.gov/alerts/active?zone={}".format(countyCode) logger.debug("Requesting {}".format(url)) response = requests.get(url) logger.debug("Response: {}\n\n".format(response.text)) @@ -332,8 +331,8 @@ def getAlerts(countyCodes): ) ) - # Convert list to set to eliminate duplicates, then convert back to list - alerts = list(set(alerts)) + # Eliminate duplicates in a way that preserves order + alerts = [x for i, x in enumerate(alerts) if alerts.index(x) == i] # Sort by both API-provided severity and 'words' severity alerts.sort(