From feea05b7c1fcd12ba8bf33670f4d2c40a773718d Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 5 Apr 2023 21:55:36 +0200 Subject: Renamed CLI utility to more obvious waterspout-pull --- waterspout_radar/cli.py | 18 ------------------ waterspout_radar/pull.py | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 18 deletions(-) delete mode 100644 waterspout_radar/cli.py create mode 100644 waterspout_radar/pull.py (limited to 'waterspout_radar') diff --git a/waterspout_radar/cli.py b/waterspout_radar/cli.py deleted file mode 100644 index b8fb041..0000000 --- a/waterspout_radar/cli.py +++ /dev/null @@ -1,18 +0,0 @@ -import argparse - -from . import _config, _radar, _storage - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument("-c", "--config", help="Overrides configuration file pathname.") - 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) - - -if __name__ == "__main__": - main() diff --git a/waterspout_radar/pull.py b/waterspout_radar/pull.py new file mode 100644 index 0000000..89c569d --- /dev/null +++ b/waterspout_radar/pull.py @@ -0,0 +1,23 @@ +""" +Pulls weather data, makes predictions and pushes them to persistent storage. +""" + +import argparse + +from . import _config, _radar, _storage + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("-c", "--config", help="Overrides configuration file pathname.") + args = parser.parse_args() + config = _config.load(_config.effective_pathname(args.config)) + storage = _storage.Storage(config.db) + 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__": + main() -- cgit v1.1