mirror of
https://git.clerie.de/clerie/fieldpoc.git
synced 2026-01-02 22:18:11 +00:00
Move config attribute to dedicated class.
This commit is contained in:
parent
a8f007d421
commit
9ff797edca
1 changed files with 7 additions and 13 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue