20 lines
		
	
	
		
			535 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			535 B
		
	
	
	
		
			Python
		
	
	
	
	
	
#!/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)
 |