diff options
| author | 2017-04-04 10:16:36 +0100 | |
|---|---|---|
| committer | 2017-04-04 10:16:36 +0100 | |
| commit | b3b6ac823bf5fc81b383adbae9adf5803ae2f1b7 (patch) | |
| tree | edc4f2f6a196e1c650998a7ac0db9570a6753dd0 /modules | |
| parent | NR: Change service info to use same time system as trains, add departure time... (diff) | |
| signature | ||
NR: Put arrived/departed status in map, not local variable (oops)
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/nr.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/nr.py b/modules/nr.py index 968081cb..6b7ec54c 100644 --- a/modules/nr.py +++ b/modules/nr.py @@ -100,7 +100,7 @@ class Module(object): a["estimate"] = k[0] == "e" a["on_time"] = a["ut"] - times["s"+ k[1:]]["ut"] < 300 a["status"] = 1 if a["on_time"] else 2 - if "a" + k[1:] in service: status = {"d": 3, "a": 0}[k[2]] + if "a" + k[1:] in service: a["status"] = {"d": 3, "a": 0}[k[2]] times["arrival"] = [times[a] for a in a_types + d_types if times[a]["ut"]][0] times["departure"] = [times[a] for a in d_types + a_types if times[a]["ut"]][0] @@ -213,11 +213,13 @@ class Module(object): train_locs_toc.append((train["destinations"], train["toc"])) trains_filtered.append(train) - trains_string = ", ".join(["%s%s (%s, %s%s, %s%s%s%s)" % ( + trains_string = ", ".join(["%s%s (%s, %s%s%s, %s%s%s%s)" % ( "from " if not filter["type"][0] in "ad" and t["terminating"] else '', t["origin_summary"] if t["terminating"] or filter["type"]=="arrival" else t["dest_summary"], t["uid"], - "bus" if t["bus"] else t["platform"], "*" if t["platform_hidden"] else '', + "bus" if t["bus"] else t["platform"], + "*" if t["platform_hidden"] else '', + "?" if "platformsAreUnreliable" in query and query["platformsAreUnreliable"] else '', t["times"][filter["type"]]["prefix"].replace(filter["type"][0], '') if not t["cancelled"] else "", Utils.color(colours[t["times"][filter["type"]]["status"]]), t["times"][filter["type"]]["short"], |
