From fd4ab7ef4410a435f8c7339e111f791f5fdc9d0b Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 4 Apr 2023 23:37:03 +0200 Subject: Moved predictions page to templates --- waterspout_radar/web.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'waterspout_radar/web.py') diff --git a/waterspout_radar/web.py b/waterspout_radar/web.py index a3ee09b..37905c3 100644 --- a/waterspout_radar/web.py +++ b/waterspout_radar/web.py @@ -7,18 +7,5 @@ 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 += "" - body += f"" - body += "
TimeLow CloudsΔTempDepthWindSWI
{prediction.time}" - body += f"{prediction.low_clouds}" - body += f"{prediction.temperature_difference}" - body += f"{prediction.convective_cloud_depth}" - body += f"{prediction.wind}" - body += f"{prediction.swi}" - body += "
" - return body + predictions = sorted(_storage.Storage(".waterspout/predictions.json"), key=lambda x: (x.time, x.swi)) + return flask.render_template("predictions.html", predictions=predictions) -- cgit v1.1