2020-11-26 18:58:08 +01:00
|
|
|
from datetime import datetime
|
|
|
|
|
2020-11-26 19:17:05 +01:00
|
|
|
from sh_edraft.configuration.base.configuration_base import ConfigurationBase
|
|
|
|
from sh_edraft.hosting.base.environment_base import EnvironmentBase
|
2020-11-26 18:58:08 +01:00
|
|
|
from sh_edraft.hosting.base.application_runtime_base import ApplicationRuntimeBase
|
|
|
|
|
|
|
|
|
|
|
|
class ApplicationRuntime(ApplicationRuntimeBase):
|
|
|
|
|
2020-11-26 19:17:05 +01:00
|
|
|
def __init__(self, config: ConfigurationBase, runtime: EnvironmentBase):
|
2020-11-26 18:58:08 +01:00
|
|
|
ApplicationRuntimeBase.__init__(self)
|
|
|
|
|
2020-11-26 19:17:05 +01:00
|
|
|
self._app_runtime = runtime
|
|
|
|
self._app_configuration = config
|
2020-11-26 18:58:08 +01:00
|
|
|
self._start_time: datetime = datetime.now()
|
|
|
|
self._end_time: datetime = datetime.now()
|
2020-11-26 19:17:05 +01:00
|
|
|
|
|
|
|
@property
|
|
|
|
def environment(self) -> EnvironmentBase:
|
|
|
|
return self._app_runtime
|
2020-11-26 18:58:08 +01:00
|
|
|
|
|
|
|
@property
|
|
|
|
def configuration(self) -> ConfigurationBase:
|
2020-11-26 19:17:05 +01:00
|
|
|
return self._app_configuration
|
2020-11-26 18:58:08 +01:00
|
|
|
|
|
|
|
@property
|
|
|
|
def start_time(self) -> datetime:
|
|
|
|
return self._start_time
|
|
|
|
|
|
|
|
@start_time.setter
|
|
|
|
def start_time(self, start_time: datetime):
|
|
|
|
self._start_time = start_time
|
|
|
|
|
|
|
|
@property
|
|
|
|
def end_time(self) -> datetime:
|
|
|
|
return self._end_time
|
|
|
|
|
|
|
|
@end_time.setter
|
|
|
|
def end_time(self, end_time: datetime):
|
|
|
|
self._end_time = end_time
|
|
|
|
|
|
|
|
@property
|
|
|
|
def date_time_now(self) -> datetime:
|
|
|
|
return datetime.now()
|