summaryrefslogtreecommitdiff
path: root/waterspout_radar
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-04-05 21:51:32 +0200
committerAki <please@ignore.pl>2023-04-05 21:51:32 +0200
commitfab6199135d75c38f3cdc463884c618784c3655a (patch)
tree12cfa47b89c101036070644905f0c26c25293b33 /waterspout_radar
parent9c863e9851cfe36bd2101d63a3db767738066331 (diff)
downloadwaterspout-radar-fab6199135d75c38f3cdc463884c618784c3655a.zip
waterspout-radar-fab6199135d75c38f3cdc463884c618784c3655a.tar.gz
waterspout-radar-fab6199135d75c38f3cdc463884c618784c3655a.tar.bz2
Tweaked suggested way of running web interface
Diffstat (limited to 'waterspout_radar')
-rw-r--r--waterspout_radar/web.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/waterspout_radar/web.py b/waterspout_radar/web.py
index 37905c3..f43d2c0 100644
--- a/waterspout_radar/web.py
+++ b/waterspout_radar/web.py
@@ -1,11 +1,12 @@
import flask
-from . import _storage
+from . import _config, _storage
app = flask.Flask(__name__)
+config = _config.load(_config.effective_pathname())
@app.route("/")
def predictions():
- predictions = sorted(_storage.Storage(".waterspout/predictions.json"), key=lambda x: (x.time, x.swi))
+ predictions = sorted(_storage.Storage(config.db), key=lambda x: (x.time, x.swi))
return flask.render_template("predictions.html", predictions=predictions)