spansh.py: misc fixes

This commit is contained in:
alterNERDtive 2020-03-09 17:59:35 +01:00
parent 15a8deca65
commit 07a6db2595

View file

@ -41,7 +41,7 @@ def getOldStations():
}
json = requests.post(APIURLS["stations"], params).json()
ret =""
ret = ""
for station in json["results"]:
if args.short:
ret += "{}\n".format(station["system_name"])
@ -61,7 +61,7 @@ def getOldStationsInSystem(system):
}
json = requests.post(APIURLS["stations"], params).json()
ret =""
ret = ""
for station in json["results"]:
if args.short:
ret += "{}\n".format(station["name"])
@ -122,7 +122,7 @@ SORT = {
}
}
out =""
out = None
if args.subcommand == "nearestsystem":
out = getNearestSystem(args.coordinate)
elif args.subcommand == "oldstations":
@ -130,12 +130,6 @@ elif args.subcommand == "oldstations":
out = getOldStationsInSystem(args.system)
else:
out = getOldStations()
else:
parser.print_usage(sys.stderr)
sys.exit(1)
if out == "":
sys.exit(3)
else:
print(out)
sys.exit(0)
print(out)
sys.exit(0)