spansh.py: exclude carriers from outdated stations list

fixes #8
This commit is contained in:
alterNERDtive 2020-12-09 17:39:46 +01:00
parent a7a44a34b2
commit fbfaeac64f

View file

@ -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: