From fbfaeac64fc789652cb6551a104c9d14e56ad42d Mon Sep 17 00:00:00 2001 From: alterNERDtive Date: Wed, 9 Dec 2020 17:39:46 +0100 Subject: [PATCH] spansh.py: exclude carriers from outdated stations list fixes #8 --- spansh.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spansh.py b/spansh.py index cfc6115..9e7f9b8 100755 --- a/spansh.py +++ b/spansh.py @@ -80,7 +80,11 @@ def getOldStationsInSystem(system): json = querystations(APIURLS["stations"], params) ret = "" - for station in json["results"]: + # exclude carriers + stations = list(filter(lambda station: not station["type"] == "Drake-Class Carrier", json["results"])) + if len(stations) == 0: + raise NotFoundError() + for station in stations: # systems including the given name as a word will also trigger; # looking for e.g. “Mari” will also give you stuff in “Mac Mari”! if station["system_name"] == system: