sh_cpl/src_old/sh_edraft/hosting/application_host.py

47 lines
1.4 KiB
Python
Raw Normal View History

2020-12-15 14:03:31 +01:00
import atexit
from datetime import datetime
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
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-25 21:41:45 +01:00
class ApplicationHost(ApplicationHostBase):
2020-11-26 11:20:21 +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
self._config = Configuration()
self._app_runtime = ApplicationRuntime(self._config)
self._services = ServiceProvider(self._app_runtime)
2020-12-10 18:11:05 +01:00
# Create
self._config.create()
self._services.create()
# Set vars
self._start_time: datetime = datetime.now()
2020-11-26 10:45:02 +01:00
self._end_time: datetime = datetime.now()
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
@property
2020-11-27 11:24:47 +01:00
def application_runtime(self) -> ApplicationRuntimeBase:
return self._app_runtime
2020-11-26 11:55:55 +01:00
@property
def services(self) -> ServiceProviderBase:
return self._services
def create(self): pass