spansh.py: fixed tripping over missing parameter
This commit is contained in:
parent
0176f70c86
commit
4b8bf96c1c
1 changed files with 15 additions and 15 deletions
30
spansh.py
30
spansh.py
|
@ -162,26 +162,26 @@ APIURLS = {
|
||||||
"stations": "https://spansh.co.uk/api/stations/search",
|
"stations": "https://spansh.co.uk/api/stations/search",
|
||||||
"systems": "https://spansh.co.uk/api/systems/search",
|
"systems": "https://spansh.co.uk/api/systems/search",
|
||||||
}
|
}
|
||||||
FILTERS = {
|
|
||||||
"updated_at":
|
|
||||||
{
|
|
||||||
"value": [
|
|
||||||
"2017-11-06",
|
|
||||||
(datetime.now() - timedelta(days=args.minage)).strftime("%Y-%m-%d")
|
|
||||||
],
|
|
||||||
"comparison": "<=>"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SORT = {
|
|
||||||
"updated_at": {
|
|
||||||
"direction": "asc"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if args.subcommand == "nearestsystem":
|
if args.subcommand == "nearestsystem":
|
||||||
out = getNearestSystem(args.coordinate)
|
out = getNearestSystem(args.coordinate)
|
||||||
elif args.subcommand == "oldstations":
|
elif args.subcommand == "oldstations":
|
||||||
|
FILTERS = {
|
||||||
|
"updated_at":
|
||||||
|
{
|
||||||
|
"value": [
|
||||||
|
"2017-11-06",
|
||||||
|
(datetime.now() - timedelta(days=args.minage)).strftime("%Y-%m-%d")
|
||||||
|
],
|
||||||
|
"comparison": "<=>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SORT = {
|
||||||
|
"updated_at": {
|
||||||
|
"direction": "asc"
|
||||||
|
}
|
||||||
|
}
|
||||||
if args.system:
|
if args.system:
|
||||||
out = getOldStationsInSystem(args.system)
|
out = getOldStationsInSystem(args.system)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue