diff options
Diffstat (limited to 'waterspout_radar')
-rw-r--r-- | waterspout_radar/pull.py (renamed from waterspout_radar/cli.py) | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/waterspout_radar/cli.py b/waterspout_radar/pull.py index b8fb041..89c569d 100644 --- a/waterspout_radar/cli.py +++ b/waterspout_radar/pull.py @@ -1,3 +1,7 @@ +""" +Pulls weather data, makes predictions and pushes them to persistent storage. +""" + import argparse from . import _config, _radar, _storage @@ -9,9 +13,10 @@ def main(): args = parser.parse_args() config = _config.load(_config.effective_pathname(args.config)) storage = _storage.Storage(config.db) - 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) + predictions = _radar.calculate(config) + storage.extend(predictions) + for prediction in sorted(predictions, key=lambda x: (x.time, x.swi)): + print(prediction.time, prediction.swi) if __name__ == "__main__": |