Improved project structure
This commit is contained in:
3
src/sh_edraft/hosting/__init__.py
Normal file
3
src/sh_edraft/hosting/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# imports:
|
||||
|
||||
from .application_host import ApplicationHost
|
37
src/sh_edraft/hosting/application_host.py
Normal file
37
src/sh_edraft/hosting/application_host.py
Normal file
@@ -0,0 +1,37 @@
|
||||
from datetime import datetime
|
||||
|
||||
from sh_edraft.hosting.base.application_host_base import ApplicationHostBase
|
||||
from sh_edraft.service.service_provider import ServiceProvider
|
||||
|
||||
|
||||
class ApplicationHost(ApplicationHostBase):
|
||||
|
||||
def __init__(self):
|
||||
ApplicationHostBase.__init__(self)
|
||||
self._services = ServiceProvider()
|
||||
self._start_time: datetime = datetime.now()
|
||||
self._end_time: datetime = datetime.now()
|
||||
|
||||
@property
|
||||
def services(self):
|
||||
return self._services
|
||||
|
||||
@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 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 date_time_now(self) -> datetime:
|
||||
return datetime.now()
|
2
src/sh_edraft/hosting/base/__init__.py
Normal file
2
src/sh_edraft/hosting/base/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# imports:
|
||||
from .application_host_base import ApplicationHostBase
|
22
src/sh_edraft/hosting/base/application_host_base.py
Normal file
22
src/sh_edraft/hosting/base/application_host_base.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class ApplicationHostBase(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self): pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def start_time(self) -> datetime: pass
|
||||
|
||||
@start_time.setter
|
||||
def start_time(self, start_time: datetime): pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def end_time(self): pass
|
||||
|
||||
@end_time.setter
|
||||
def end_time(self, end_time: datetime): pass
|
0
src/sh_edraft/hosting/model/__init__.py
Normal file
0
src/sh_edraft/hosting/model/__init__.py
Normal file
Reference in New Issue
Block a user