Improved package files

This commit is contained in:
2021-11-19 09:21:04 +01:00
parent 118ba99b92
commit 7a9e127df3
8 changed files with 184 additions and 3 deletions

View File

@@ -7,8 +7,9 @@ from gismo.application import Gismo
from gismo.startup import Startup
from modules.boot_log.boot_log_extension import BootLogExtension
class Main:
def __init__(self):
self._gismo: Optional[Gismo] = None
@@ -18,14 +19,26 @@ class Main:
app_builder.use_startup(Startup)
self._gismo: Gismo = await app_builder.build_async()
await self._gismo.run_async()
async def stop(self):
await self._gismo.stop_async()
if __name__ == '__main__':
main = Main()
ml = asyncio.get_event_loop()
try:
ml.run_until_complete(main.main())
except KeyboardInterrupt:
ml.run_until_complete(main.stop())
ml.run_until_complete(main.stop())
# ((
# ( `)
# ; / ,
# / \/
# / |
# / ~/
# / ) ) ~ edraft
# ___// | /
# `--' \_~-,