add the weather to the system configuration
This commit is contained in:
@@ -4,6 +4,7 @@ import configparser
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from aman.config.Server import Server
|
from aman.config.Server import Server
|
||||||
|
from aman.config.Weather import Weather
|
||||||
|
|
||||||
class System:
|
class System:
|
||||||
def __init__(self, filepath : str):
|
def __init__(self, filepath : str):
|
||||||
@@ -15,9 +16,15 @@ class System:
|
|||||||
for key in config:
|
for key in config:
|
||||||
if 'SERVER' == key:
|
if 'SERVER' == key:
|
||||||
serverSectionAvailable = True
|
serverSectionAvailable = True
|
||||||
|
elif 'WEATHER' == key:
|
||||||
|
weatherSectionAvailable = True
|
||||||
|
|
||||||
if not serverSectionAvailable:
|
if not serverSectionAvailable:
|
||||||
sys.stderr.write('No server-configuration section found!')
|
sys.stderr.write('No server-configuration section found!')
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
if not weatherSectionAvailable:
|
||||||
|
sys.stderr.write('No weather-configuration section found!')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
self.Server = Server(config['SERVER'])
|
self.Server = Server(config['SERVER'])
|
||||||
|
self.Weather = Weather(config['WEATHER'])
|
||||||
|
|||||||
Reference in New Issue
Block a user