Weather.py 536 B

12345678910111213141516171819
  1. #!/usr/bin/env python
  2. import configparser;
  3. import sys
  4. class Weather():
  5. def __init__(self, config : configparser.ConfigParser):
  6. self.Provider = None
  7. self.PortReceiver = None
  8. self.PortNotification = None
  9. # search the required sections
  10. for key in config:
  11. if 'provider' == key:
  12. self.Provider = config['provider']
  13. if self.Provider is None:
  14. sys.stderr.write('No weather-provider configuration found!')
  15. sys.exit(-1)