2020-12-15 14:03:31 +01:00
|
|
|
import atexit
|
2020-11-22 20:17:57 +01:00
|
|
|
from datetime import datetime
|
|
|
|
|
2020-11-26 18:58:08 +01:00
|
|
|
from sh_edraft.configuration.configuration import Configuration
|
|
|
|
from sh_edraft.configuration.base.configuration_base import ConfigurationBase
|
2020-11-27 11:24:47 +01:00
|
|
|
from sh_edraft.hosting.base.application_runtime_base import ApplicationRuntimeBase
|
2020-11-26 18:58:08 +01:00
|
|
|
from sh_edraft.hosting.application_runtime import ApplicationRuntime
|
2020-11-26 10:45:02 +01:00
|
|
|
from sh_edraft.hosting.base.application_host_base import ApplicationHostBase
|
2020-12-10 18:11:05 +01:00
|
|
|
from sh_edraft.service.providing.service_provider import ServiceProvider
|
|
|
|
from sh_edraft.service.providing.base.service_provider_base import ServiceProviderBase
|
2020-12-15 16:54:15 +01:00
|
|
|
from sh_edraft.console.console import Console
|
2020-11-22 20:17:57 +01:00
|
|
|
|
|
|
|
|
2020-11-25 21:41:45 +01:00
|
|
|
class ApplicationHost(ApplicationHostBase):
|
2020-11-26 11:20:21 +01:00
|
|
|
|
2020-11-28 15:13:54 +01:00
|
|
|
def __init__(self):
|
2020-11-25 21:41:45 +01:00
|
|
|
ApplicationHostBase.__init__(self)
|
2020-12-10 18:11:05 +01:00
|
|
|
|
|
|
|
# Init
|
2020-11-26 18:58:08 +01:00
|
|
|
self._config = Configuration()
|
2020-11-28 15:13:54 +01:00
|
|
|
self._app_runtime = ApplicationRuntime(self._config)
|
2020-11-26 18:58:08 +01:00
|
|
|
self._services = ServiceProvider(self._app_runtime)
|
|
|
|
|
2020-12-10 18:11:05 +01:00
|
|
|
# Create
|
|
|
|
self._config.create()
|
|
|
|
self._services.create()
|
|
|
|
|
|
|
|
# Set vars
|
2020-11-22 20:17:57 +01:00
|
|
|
self._start_time: datetime = datetime.now()
|
2020-11-26 10:45:02 +01:00
|
|
|
self._end_time: datetime = datetime.now()
|
2020-11-22 20:17:57 +01:00
|
|
|
|
2020-12-15 14:03:31 +01:00
|
|
|
atexit.register(Console.close)
|
|
|
|
|
2020-11-27 11:24:47 +01:00
|
|
|
@property
|
|
|
|
def configuration(self) -> ConfigurationBase:
|
|
|
|
return self._config
|
|
|
|
|
2020-11-22 20:17:57 +01:00
|
|
|
@property
|
2020-11-27 11:24:47 +01:00
|
|
|
def application_runtime(self) -> ApplicationRuntimeBase:
|
|
|
|
return self._app_runtime
|
2020-11-22 20:17:57 +01:00
|
|
|
|
2020-11-26 11:55:55 +01:00
|
|
|
@property
|
|
|
|
def services(self) -> ServiceProviderBase:
|
|
|
|
return self._services
|
2020-11-26 18:58:08 +01:00
|
|
|
|
|
|
|
def create(self): pass
|