|
|
@ -35,12 +35,13 @@ class Config:
|
|
|
|
def load(self, config_pathname):
|
|
|
|
def load(self, config_pathname):
|
|
|
|
self._cfg.read(config_pathname)
|
|
|
|
self._cfg.read(config_pathname)
|
|
|
|
|
|
|
|
|
|
|
|
def _split_key(self, key: ConfigParameter):
|
|
|
|
@staticmethod
|
|
|
|
|
|
|
|
def _split_key(key: ConfigParameter):
|
|
|
|
section, param = str(key.value).split(".")
|
|
|
|
section, param = str(key.value).split(".")
|
|
|
|
if not param:
|
|
|
|
if not param:
|
|
|
|
param = section
|
|
|
|
param = section
|
|
|
|
section = ""
|
|
|
|
section = ""
|
|
|
|
return (section, param)
|
|
|
|
return section, param
|
|
|
|
|
|
|
|
|
|
|
|
def exists(self, key: ConfigParameter):
|
|
|
|
def exists(self, key: ConfigParameter):
|
|
|
|
section, param = self._split_key(key)
|
|
|
|
section, param = self._split_key(key)
|
|
|
@ -77,8 +78,8 @@ class Config:
|
|
|
|
def check(self):
|
|
|
|
def check(self):
|
|
|
|
for key in ConfigParameter:
|
|
|
|
for key in ConfigParameter:
|
|
|
|
if not self.get(key):
|
|
|
|
if not self.get(key):
|
|
|
|
return (False, key.value)
|
|
|
|
return False, key.value
|
|
|
|
return (True, None)
|
|
|
|
return True, None
|
|
|
|
|
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
def __repr__(self):
|
|
|
|
dict_repr = {}
|
|
|
|
dict_repr = {}
|
|
|
|