Refactored code
This commit is contained in:
28
src_old/sh_edraft/hosting/base/__init__.py
Normal file
28
src_old/sh_edraft/hosting/base/__init__.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
sh_edraft.hosting.base
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
|
||||
:copyright: (c) 2020 sh-edraft.de
|
||||
:license: MIT, see LICENSE for more details.
|
||||
|
||||
"""
|
||||
|
||||
__title__ = 'sh_edraft.hosting.base'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 sh-edraft.de'
|
||||
__version__ = '2020.12.9'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
from .application_base import ApplicationBase
|
||||
from .application_host_base import ApplicationHostBase
|
||||
from .application_runtime_base import ApplicationRuntimeBase
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major=2020, minor=12, micro=9)
|
||||
19
src_old/sh_edraft/hosting/base/application_base.py
Normal file
19
src_old/sh_edraft/hosting/base/application_base.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class ApplicationBase(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self): pass
|
||||
|
||||
@abstractmethod
|
||||
def create_application_host(self): pass
|
||||
|
||||
@abstractmethod
|
||||
def create_configuration(self): pass
|
||||
|
||||
@abstractmethod
|
||||
def create_services(self): pass
|
||||
|
||||
@abstractmethod
|
||||
def main(self): pass
|
||||
26
src_old/sh_edraft/hosting/base/application_host_base.py
Normal file
26
src_old/sh_edraft/hosting/base/application_host_base.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from sh_edraft.configuration.base.configuration_base import ConfigurationBase
|
||||
from sh_edraft.hosting.base.application_runtime_base import ApplicationRuntimeBase
|
||||
from sh_edraft.service.providing.base.service_provider_base import ServiceProviderBase
|
||||
|
||||
|
||||
class ApplicationHostBase(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self): pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def configuration(self) -> ConfigurationBase: pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def application_runtime(self) -> ApplicationRuntimeBase: pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def services(self) -> ServiceProviderBase: pass
|
||||
|
||||
@abstractmethod
|
||||
def create(self): pass
|
||||
34
src_old/sh_edraft/hosting/base/application_runtime_base.py
Normal file
34
src_old/sh_edraft/hosting/base/application_runtime_base.py
Normal file
@@ -0,0 +1,34 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from datetime import datetime
|
||||
|
||||
from sh_edraft.configuration.base.configuration_base import ConfigurationBase
|
||||
|
||||
|
||||
class ApplicationRuntimeBase(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self): pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def configuration(self) -> ConfigurationBase: pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def start_time(self) -> datetime: pass
|
||||
|
||||
@start_time.setter
|
||||
@abstractmethod
|
||||
def start_time(self, start_time: datetime): pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def end_time(self): pass
|
||||
|
||||
@end_time.setter
|
||||
@abstractmethod
|
||||
def end_time(self, end_time: datetime): pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def date_time_now(self) -> datetime: pass
|
||||
Reference in New Issue
Block a user