Improved BootLog module

This commit is contained in:
Sven Heidemann 2021-11-15 20:38:57 +01:00
parent 26a93c5ea1
commit a3bf5535f6
2 changed files with 9 additions and 19 deletions

0
src/modules/__init__.py Normal file
View File

View File

@ -1,23 +1,13 @@
from cpl_core.configuration import Configuration, ConfigurationABC
from cpl_core.console import Console
from cpl_core.dependency_injection import ServiceCollection, ServiceProviderABC
from cpl_core.logging import LoggerABC
from gismo_core.abc.bot_service_abc import BotServiceABC
def configure_configuration() -> ConfigurationABC:
config = Configuration()
return config
class BootLog:
def __init__(self, logger: LoggerABC, bot: BotServiceABC):
self._logger = logger
self._bot = bot
def configure_services(config: ConfigurationABC) -> ServiceProviderABC:
services = ServiceCollection(config)
return services.build_service_provider()
def main():
config = configure_configuration()
provider = configure_services(config)
Console.write_line('Hello World')
if __name__ == '__main__':
main()
def on_ready(self):
self._logger.info(__name__, f'Bot started: {self._bot}')