-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRun.py
More file actions
31 lines (25 loc) · 980 Bytes
/
Run.py
File metadata and controls
31 lines (25 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- coding: utf-8 -*-
"""
Точка входа
"""
import sys,asyncio
from Common.Codes import ExitCode
from Interfaces.Main import Interface
from typing import NoReturn
#--------------------------------------------------------------------------------
class ExitStatus():
def __init__(self):
self.status:int = ExitCode.Ok.value
#--------------------------------------------------------------------------------
def main() -> NoReturn:
exitStatus:ExitStatus = ExitStatus()
loop:'asyncio.windows_events.ProactorEventLoop' = asyncio.get_event_loop()
appEntryPoint:Interface = Interface()
# Обеспечиваем асинхронный цикл работы
try:
loop.run_until_complete(appEntryPoint.Run(exitStatus))
sys.exit(exitStatus.status)
except asyncio.exceptions.CancelledError:
sys.exit(ExitCode.AsyncStartError.value)
if __name__ == '__main__':
main()