added app_class and governor
This commit is contained in:
+4
-8
@@ -1,12 +1,10 @@
|
||||
from logger import getLogger
|
||||
from app_class import AppClass
|
||||
from config import Config, TriggerTuple, MissingConfig
|
||||
|
||||
class Trigger:
|
||||
def __init__(self, name: str, _config: Config) -> None:
|
||||
class Trigger(AppClass):
|
||||
def __init__(self, name: str, _config: Config, testmode: bool = False) -> None:
|
||||
super().__init__(_config, testmode)
|
||||
self.name = name
|
||||
self._config = _config
|
||||
self.log = getLogger('trigger', loglevel=_config.loglevel.upper())
|
||||
self.log.info(f'initializing {self.__class__.__name__}')
|
||||
|
||||
@property
|
||||
def config(self) -> TriggerTuple:
|
||||
@@ -14,5 +12,3 @@ class Trigger:
|
||||
if _config is None:
|
||||
raise MissingConfig(f"Trigger {self.name} hasn't been properly configured")
|
||||
return _config
|
||||
|
||||
|
||||
Reference in New Issue
Block a user