Move config attribute to dedicated class.
This commit is contained in:
parent
a8f007d421
commit
9ff797edca
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
class ControllerConfig:
|
class ConfigBase:
|
||||||
def __init__(self, c):
|
def __init__(self, c):
|
||||||
self._c = c
|
self._c = c
|
||||||
|
|
||||||
@ -10,15 +10,15 @@ class ControllerConfig:
|
|||||||
else:
|
else:
|
||||||
raise AttributeError()
|
raise AttributeError()
|
||||||
|
|
||||||
class DectConfig:
|
|
||||||
|
class ControllerConfig(ConfigBase):
|
||||||
def __init__(self, c):
|
def __init__(self, c):
|
||||||
self._c = c
|
self._c = c
|
||||||
|
|
||||||
def __getattr__(self, name):
|
|
||||||
if name in self._c.keys():
|
class DectConfig(ConfigBase):
|
||||||
return self._c.get(name)
|
def __init__(self, c):
|
||||||
else:
|
self._c = c
|
||||||
raise AttributeError()
|
|
||||||
|
|
||||||
def check(self):
|
def check(self):
|
||||||
return True
|
return True
|
||||||
@ -39,12 +39,6 @@ class ExtensionConfig:
|
|||||||
self.num = c[0]
|
self.num = c[0]
|
||||||
self._c = c[1]
|
self._c = c[1]
|
||||||
|
|
||||||
def __getattr__(self, name):
|
|
||||||
if name in self._c.keys():
|
|
||||||
return self._c.get(name)
|
|
||||||
else:
|
|
||||||
raise AttributeError()
|
|
||||||
|
|
||||||
|
|
||||||
class Extensions:
|
class Extensions:
|
||||||
def __init__(self, c):
|
def __init__(self, c):
|
||||||
|
Loading…
Reference in New Issue
Block a user