spansh.py: fixed oldstation
search results for partial system name
fixes #3
This commit is contained in:
parent
79bc2d49d4
commit
0179369fc1
1 changed files with 7 additions and 4 deletions
11
spansh.py
11
spansh.py
|
@ -80,10 +80,13 @@ def getOldStationsInSystem(system):
|
||||||
|
|
||||||
ret = ""
|
ret = ""
|
||||||
for station in json["results"]:
|
for station in json["results"]:
|
||||||
if args.short:
|
# systems including the given name as a word will also trigger;
|
||||||
ret += "{}\n".format(station["name"])
|
# looking for e.g. “Mari” will also give you stuff in “Mac Mari”!
|
||||||
else:
|
if station["system_name"] == system:
|
||||||
ret += "{} ({})\n".format(station["name"], station["updated_at"])
|
if args.short:
|
||||||
|
ret += "{}\n".format(station["name"])
|
||||||
|
else:
|
||||||
|
ret += "{} ({})\n".format(station["name"], station["updated_at"])
|
||||||
|
|
||||||
return ret[:-1]
|
return ret[:-1]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue