sh_cpl/src/cpl/application/application_runtime.py

39 lines
1.0 KiB
Python
Raw Normal View History

from datetime import datetime
2021-03-03 10:47:52 +01:00
from cpl.application.application_runtime_abc import ApplicationRuntimeABC
from cpl.configuration.configuration_abc import ConfigurationABC
2021-03-03 10:47:52 +01:00
class ApplicationRuntime(ApplicationRuntimeABC):
2021-03-03 10:47:52 +01:00
def __init__(self, config: ConfigurationABC):
ApplicationRuntimeABC.__init__(self)
self._app_configuration = config
self._start_time: datetime = datetime.now()
self._end_time: datetime = datetime.now()
@property
2021-03-03 10:47:52 +01:00
def configuration(self) -> ConfigurationABC:
return self._app_configuration
2020-11-27 18:18:07 +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()