Move config attribute to dedicated class.

This commit is contained in:
clerie 2022-07-05 19:33:31 +02:00
parent a8f007d421
commit 9ff797edca

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
class ControllerConfig:
class ConfigBase:
def __init__(self, c):
self._c = c
@ -10,15 +10,15 @@ class ControllerConfig:
else:
raise AttributeError()
class DectConfig:
class ControllerConfig(ConfigBase):
def __init__(self, c):
self._c = c
def __getattr__(self, name):
if name in self._c.keys():
return self._c.get(name)
else:
raise AttributeError()
class DectConfig(ConfigBase):
def __init__(self, c):
self._c = c
def check(self):
return True
@ -39,12 +39,6 @@ class ExtensionConfig:
self.num = c[0]
self._c = c[1]
def __getattr__(self, name):
if name in self._c.keys():
return self._c.get(name)
else:
raise AttributeError()
class Extensions:
def __init__(self, c):