A-0.1 - Modularer Aufbau #13
0
src/modules/__init__.py
Normal file
0
src/modules/__init__.py
Normal file
@ -1,23 +1,13 @@
|
|||||||
from cpl_core.configuration import Configuration, ConfigurationABC
|
from cpl_core.logging import LoggerABC
|
||||||
from cpl_core.console import Console
|
|
||||||
from cpl_core.dependency_injection import ServiceCollection, ServiceProviderABC
|
from gismo_core.abc.bot_service_abc import BotServiceABC
|
||||||
|
|
||||||
|
|
||||||
def configure_configuration() -> ConfigurationABC:
|
class BootLog:
|
||||||
config = Configuration()
|
|
||||||
return config
|
|
||||||
|
|
||||||
|
def __init__(self, logger: LoggerABC, bot: BotServiceABC):
|
||||||
|
self._logger = logger
|
||||||
|
self._bot = bot
|
||||||
|
|
||||||
def configure_services(config: ConfigurationABC) -> ServiceProviderABC:
|
def on_ready(self):
|
||||||
services = ServiceCollection(config)
|
self._logger.info(__name__, f'Bot started: {self._bot}')
|
||||||
return services.build_service_provider()
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
config = configure_configuration()
|
|
||||||
provider = configure_services(config)
|
|
||||||
Console.write_line('Hello World')
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
|
Reference in New Issue
Block a user