A-0.1 - Modularer Aufbau #13

Merged
edraft merged 118 commits from 0.1 into Alpha 2021-11-25 21:02:12 +01:00
2 changed files with 7 additions and 7 deletions
Showing only changes of commit 118ba99b92 - Show all commits

View File

@ -7,7 +7,7 @@ from gismo_core.abc.bot_service_abc import BotServiceABC
from gismo_core.service.bot_service import BotService from gismo_core.service.bot_service import BotService
class Application(ApplicationABC): class Gismo(ApplicationABC):
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC): def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
ApplicationABC.__init__(self, config, services) ApplicationABC.__init__(self, config, services)

View File

@ -3,24 +3,24 @@ from typing import Optional
from cpl_core.application import ApplicationABC, ApplicationBuilder from cpl_core.application import ApplicationABC, ApplicationBuilder
from gismo.application import Application from gismo.application import Gismo
from gismo.startup import Startup from gismo.startup import Startup
from modules.boot_log.boot_log_extension import BootLogExtension from modules.boot_log.boot_log_extension import BootLogExtension
class Main: class Main:
def __init__(self): def __init__(self):
self._app: Optional[ApplicationABC] = None self._gismo: Optional[Gismo] = None
async def main(self): async def main(self):
app_builder = ApplicationBuilder(Application) app_builder = ApplicationBuilder(Gismo)
app_builder.use_extension(BootLogExtension) app_builder.use_extension(BootLogExtension)
app_builder.use_startup(Startup) app_builder.use_startup(Startup)
self._app: ApplicationABC = await app_builder.build_async() self._gismo: Gismo = await app_builder.build_async()
await self._app.run_async() await self._gismo.run_async()
async def stop(self): async def stop(self):
await self._app.stop_async() await self._gismo.stop_async()
if __name__ == '__main__': if __name__ == '__main__':
main = Main() main = Main()