From 6c611770e07c935576f1fd8d9aba90e257c98d7b Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Tue, 1 Jan 2019 13:15:14 +1100 Subject: [PATCH] Implement clock --- virtual_metro/__init__.py | 1 + virtual_metro/static/template.svg | 4 +-- virtual_metro/templates/index.html | 55 ++++++++++++++++++++++-------- 3 files changed, 43 insertions(+), 17 deletions(-) diff --git a/virtual_metro/__init__.py b/virtual_metro/__init__.py index 8c14b7a..484ccb2 100755 --- a/virtual_metro/__init__.py +++ b/virtual_metro/__init__.py @@ -47,6 +47,7 @@ def index(): def latest(): timenow = pytz.utc.localize(datetime.utcnow()).astimezone(timezone) result = {} + result['time_offset'] = timenow.utcoffset().total_seconds() departures = do_request('/v3/departures/route_type/{}/stop/{}'.format(ROUTE_TYPE, flask.request.args['stop_id']), {'platform_numbers': flask.request.args['plat_id'], 'max_results': '5', 'expand': 'all'}) departures['departures'].sort(key=lambda x: x['scheduled_departure_utc']) diff --git a/virtual_metro/static/template.svg b/virtual_metro/static/template.svg index 90f6103..6e58d12 100644 --- a/virtual_metro/static/template.svg +++ b/virtual_metro/static/template.svg @@ -29,7 +29,7 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.7" - inkscape:cx="989.80651" + inkscape:cx="1809.3071" inkscape:cy="258.31501" inkscape:document-units="mm" inkscape:current-layer="layer2" @@ -517,7 +517,7 @@ id="tspan970" sodipodi:role="line">{{min}}