From f3f7ab49b0f14dd2ec491eb3120f71f929d58f7c Mon Sep 17 00:00:00 2001 From: Lucas Date: Sun, 11 Jul 2021 16:48:38 -0400 Subject: [PATCH] Basic Website Design --- mta_manager/mta.py | 2 +- server.py | 5 ++- templates/layouts/index.html | 37 +++++++++++----- templates/static/css/style.css | 80 ++++++++++++++++++++++++++++++++++ test_closures.py | 9 ++++ 5 files changed, 119 insertions(+), 14 deletions(-) create mode 100644 templates/static/css/style.css create mode 100644 test_closures.py diff --git a/mta_manager/mta.py b/mta_manager/mta.py index 1d5364a..5557118 100644 --- a/mta_manager/mta.py +++ b/mta_manager/mta.py @@ -10,7 +10,7 @@ from time import time class MTA(object): def __init__(self, api_key: str, train_lines, station_ids, timing_callbacks=None, alert_callbacks=None, - endpoints_file="./endpoints.json", callback_frequency=5, max_arrival_time=30): + endpoints_file="./endpoints.json", callback_frequency=10, max_arrival_time=30): self.header = { "x-api-key": api_key } diff --git a/server.py b/server.py index ac49695..9af371c 100644 --- a/server.py +++ b/server.py @@ -24,6 +24,9 @@ def get_mta_data(): subway_data ) +@app.route("/stops", methods=["GET"]) +def get_routes(): + return jsonify() if __name__ == "__main__": api_key = os.getenv('MTA_API_KEY', '') @@ -62,7 +65,7 @@ if __name__ == "__main__": for t in threads: t.start() - app.run("0.0.0.0", port=5000) + app.run("0.0.0.0", port=5000, debug=True) # Wait for all threads to complete for t in threads: t.join() diff --git a/templates/layouts/index.html b/templates/layouts/index.html index 325df9e..f351b0a 100644 --- a/templates/layouts/index.html +++ b/templates/layouts/index.html @@ -10,19 +10,32 @@ -Yo This will be a kickass display coming soon^tm -
- - new test - -
- - - -
- +
+
+ PI MTA TRACKER +
+
+
+ Times Square Station +
+
+
North
+
Train 1 Info
+
Train 2 Info
+
Train 3 Info
+
+
+
South
+
Train 1 Info
+
Train 2 Info
+
Train 3 Info
+
+
- + + + +