New Addon

Google BK
This commit is contained in:
2023-04-23 18:17:03 +07:00
parent 1c7fd2b476
commit 702d080a1e
248 changed files with 72745 additions and 0 deletions
@@ -0,0 +1,24 @@
from injector import inject, singleton
from typing import List
from .config import Startable, Config, Setting
from .logger import getLogger
logger = getLogger(__name__)
@singleton
class Starter(Startable):
@inject
def __init__(self, config: Config, startables: List[Startable]):
self.startables = startables
self.config = config
async def start(self):
logger.overrideLevel(self.config.get(Setting.CONSOLE_LOG_LEVEL), self.config.get(Setting.LOG_LEVEL))
for startable in self.startables:
await startable.start()
async def stop(self):
for startable in self.startables:
await startable.stop()