From 0179369fc1405583d3bcd332b14564d2b717e71f Mon Sep 17 00:00:00 2001 From: alterNERDtive Date: Mon, 29 Jun 2020 09:25:16 +0200 Subject: [PATCH] spansh.py: fixed `oldstation` search results for partial system name fixes #3 --- spansh.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/spansh.py b/spansh.py index 69a467b..5300011 100755 --- a/spansh.py +++ b/spansh.py @@ -80,10 +80,13 @@ def getOldStationsInSystem(system): ret = "" for station in json["results"]: - if args.short: - ret += "{}\n".format(station["name"]) - else: - ret += "{} ({})\n".format(station["name"], station["updated_at"]) + # 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: + if args.short: + ret += "{}\n".format(station["name"]) + else: + ret += "{} ({})\n".format(station["name"], station["updated_at"]) return ret[:-1]