From 9451fa019cb084db820f3255b0da2cc863d0f990 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 3 Apr 2023 23:15:09 +0200 Subject: Implemented naive web view --- waterspout_radar/web.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 waterspout_radar/web.py (limited to 'waterspout_radar/web.py') diff --git a/waterspout_radar/web.py b/waterspout_radar/web.py new file mode 100644 index 0000000..67ac4ca --- /dev/null +++ b/waterspout_radar/web.py @@ -0,0 +1,17 @@ +import flask + +from . import _storage + +app = flask.Flask(__name__) + + +@app.route("/") +def predictions(): + body = "Predictions" + body += "

Prediction


" + body += "" + body += "" + for prediction in sorted(_storage.Storage(".waterspout/predictions.json"), key=lambda x: (x.time, x.swi)): + body += f"" + body += "
TimeΔTempDepthSWI
{prediction.time}{prediction.temperature_difference}{prediction.convective_cloud_depth}{prediction.swi}
" + return body -- cgit v1.1