diff options
author | Aki <please@ignore.pl> | 2023-04-02 23:46:40 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2023-04-02 23:46:40 +0200 |
commit | 7af2b763b955e68ef76b93ba2259f83529cf55db (patch) | |
tree | 5c71f1d23097e087182b7ef57793ffaf61a9db54 /waterspout_radar/cli.py | |
parent | c0e0bd9fd69e07298d94bd278ab018b5bb4f9759 (diff) | |
download | waterspout-radar-7af2b763b955e68ef76b93ba2259f83529cf55db.zip waterspout-radar-7af2b763b955e68ef76b93ba2259f83529cf55db.tar.gz waterspout-radar-7af2b763b955e68ef76b93ba2259f83529cf55db.tar.bz2 |
Connected processing all the way to storage
Diffstat (limited to 'waterspout_radar/cli.py')
-rw-r--r-- | waterspout_radar/cli.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/waterspout_radar/cli.py b/waterspout_radar/cli.py index ecf79d8..24f9e53 100644 --- a/waterspout_radar/cli.py +++ b/waterspout_radar/cli.py @@ -11,8 +11,9 @@ def main(): args = parser.parse_args() config = _config.load(args.config) storage = _storage.Storage(config.db) - predictions = _radar.calculate(config) - storage.extend(predictions) + storage.extend(_radar.calculate(config)) + for prediction in sorted(storage, key=lambda x: (x.time, x.swi)): + print(prediction.time, prediction.low_clouds, prediction.swi) if __name__ == "__main__": |