From 3743f31b84082586accec4a56e0e98894a0e338c Mon Sep 17 00:00:00 2001 From: Sven Czarnian Date: Sun, 5 Sep 2021 19:27:47 +0200 Subject: [PATCH] introduce the weather configuration --- aman/config/Weather.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 aman/config/Weather.py diff --git a/aman/config/Weather.py b/aman/config/Weather.py new file mode 100644 index 0000000..f2aa2d0 --- /dev/null +++ b/aman/config/Weather.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +import configparser; +import sys + +class Weather(): + def __init__(self, config : configparser.ConfigParser): + self.Provider = None + self.PortReceiver = None + self.PortNotification = None + + # search the required sections + for key in config: + if 'provider' == key: + self.Provider = config['address'] + + if self.Provider is None: + sys.stderr.write('No weather-provider configuration found!') + sys.exit(-1)