Improved comments of environment

This commit is contained in:
2021-03-14 16:20:29 +01:00
parent a604fca5cc
commit d1f1627214
7 changed files with 29 additions and 20 deletions

View File

@@ -20,7 +20,7 @@ __version__ = '2021.4.1.post1'
from collections import namedtuple
# imports:
from .environment_abc import EnvironmentABC
from .environment_abc import ApplicationEnvironmentABC
from .environment_name_enum import EnvironmentNameEnum
from .application_environment import ApplicationEnvironment

View File

@@ -1,14 +1,19 @@
from socket import gethostname
from typing import Optional
from cpl.environment.environment_abc import EnvironmentABC
from cpl.environment.environment_abc import ApplicationEnvironmentABC
from cpl.environment.environment_name_enum import EnvironmentNameEnum
class ApplicationEnvironment(EnvironmentABC):
class ApplicationEnvironment(ApplicationEnvironmentABC):
def __init__(self, name: EnvironmentNameEnum = EnvironmentNameEnum.production, crp: str = './'):
EnvironmentABC.__init__(self)
"""
Represents environment of the application
:param name:
:param crp:
"""
ApplicationEnvironmentABC.__init__(self)
self._environment_name: Optional[EnvironmentNameEnum] = name
self._app_name: Optional[str] = None

View File

@@ -1,31 +1,35 @@
from abc import ABC, abstractmethod
class EnvironmentABC(ABC):
class ApplicationEnvironmentABC(ABC):
@abstractmethod
def __init__(self): pass
def __init__(self):
"""
ABC of application environment
"""
pass
@property
@abstractmethod
def environment_name(self) -> str: pass
@environment_name.setter
@abstractmethod
def environment_name(self, environment_name: str): pass
@property
@abstractmethod
def application_name(self) -> str: pass
@application_name.setter
@abstractmethod
def application_name(self, application_name: str): pass
@property
@abstractmethod
def customer(self) -> str: pass
@customer.setter
@abstractmethod
def customer(self, customer: str): pass