Force CRS to upper (Darwin doesn't like lowercase CRS codes)
This commit is contained in:
parent
fc55e853e3
commit
25c214f363
1 changed files with 3 additions and 5 deletions
|
@ -34,7 +34,7 @@ class Module(object):
|
||||||
|
|
||||||
def arrivals(self, event):
|
def arrivals(self, event):
|
||||||
token = self.bot.config["nre-api-key"]
|
token = self.bot.config["nre-api-key"]
|
||||||
crs = event["args_split"][0]
|
crs = event["args_split"][0].upper()
|
||||||
|
|
||||||
client = Client(URL)
|
client = Client(URL)
|
||||||
|
|
||||||
|
@ -52,9 +52,7 @@ class Module(object):
|
||||||
"time" : self.span(query["generatedAt"], t["std"], t["etd"]),
|
"time" : self.span(query["generatedAt"], t["std"], t["etd"]),
|
||||||
"dest_name": t["destination"][0][0]["locationName"],
|
"dest_name": t["destination"][0][0]["locationName"],
|
||||||
"dest_id": t["destination"][0][0]["crs"],
|
"dest_id": t["destination"][0][0]["crs"],
|
||||||
# "via": t["destination"][0][0]["via"],
|
"via": '' if not "via" in t["destination"][0][0] else t["destination"][0][0]["via"],
|
||||||
""
|
|
||||||
"via": "",
|
|
||||||
"platform": "?" if not "platform" in t else t["platform"]
|
"platform": "?" if not "platform" in t else t["platform"]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -68,7 +66,7 @@ class Module(object):
|
||||||
train_dest_plat.append((train["dest_name"] + train["via"], train["platform"]))
|
train_dest_plat.append((train["dest_name"] + train["via"], train["platform"]))
|
||||||
trains_filtered.append(train)
|
trains_filtered.append(train)
|
||||||
|
|
||||||
trains_string = ", ".join(["%s (plat %s, %s)" % (t["dest_name"], t["platform"], t["time"],
|
trains_string = ", ".join(["%s %s (plat %s, %s)" % (t["dest_name"], t["via"], t["platform"], t["time"],
|
||||||
) for t in trains_filtered])
|
) for t in trains_filtered])
|
||||||
|
|
||||||
event["stdout"].write("%s (%s): %s" % (query["locationName"], crs,
|
event["stdout"].write("%s (%s): %s" % (query["locationName"], crs,
|
||||||
|
|
Loading…
Reference in a new issue