Files
aman-sys/aman/config/Weather.py
2021-10-13 12:52:38 +02:00

18 lines
464 B
Python

#!/usr/bin/env python
import configparser;
import sys
class Weather():
def __init__(self, config : configparser.ConfigParser):
self.Provider = None
# search the required sections
for key in config:
if 'provider' == key:
self.Provider = config['provider']
if self.Provider is None:
sys.stderr.write('No weather-provider configuration found!')
sys.exit(-1)