sh_cpl/src/cpl/configuration/configuration_abc.py

32 lines
854 B
Python
Raw Normal View History

from abc import abstractmethod, ABC
2020-11-25 21:41:45 +01:00
from collections import Callable
from typing import Type
2020-11-25 21:41:45 +01:00
2021-03-03 10:47:52 +01:00
from cpl.configuration.configuration_model_abc import ConfigurationModelABC
from cpl.environment.environment_abc import EnvironmentABC
2020-11-25 21:41:45 +01:00
2021-03-03 10:47:52 +01:00
class ConfigurationABC(ABC):
2020-11-25 21:41:45 +01:00
@abstractmethod
def __init__(self): pass
2020-11-25 21:41:45 +01:00
@property
2020-11-25 21:41:45 +01:00
@abstractmethod
2021-03-03 10:47:52 +01:00
def environment(self) -> EnvironmentABC: pass
2020-11-25 21:41:45 +01:00
@abstractmethod
def add_environment_variables(self, prefix: str): pass
@abstractmethod
def add_argument_variables(self): pass
@abstractmethod
def add_json_file(self, name: str, optional: bool = None): pass
@abstractmethod
def add_configuration(self, key_type: type, value: object): pass
@abstractmethod
2021-03-03 10:47:52 +01:00
def get_configuration(self, search_type: Type[ConfigurationModelABC]) -> Callable[ConfigurationModelABC]: pass