Added docs for cpl.environment

This commit is contained in:
Sven Heidemann 2021-05-17 17:28:52 +02:00
parent 4adf6bc834
commit adf9a33e83
5 changed files with 32 additions and 15 deletions

View File

@ -21,7 +21,9 @@ class ServiceCollectionABC(ABC):
Parameter
---------
db_context: Type[:class:`cpl.database.context.database_context_abc.DatabaseContextABC`]
Database context
db_settings: :class:`cpl.database.database_settings.DatabaseSettings`
Database settings
"""
pass
@ -37,7 +39,9 @@ class ServiceCollectionABC(ABC):
Parameter
---------
service_type: :class:`Type`
Type of the service
service: :class:`Callable`
Object of the service
"""
pass
@ -48,7 +52,9 @@ class ServiceCollectionABC(ABC):
Parameter
---------
service_type: :class:`Type`
Type of the service
service: :class:`Callable`
Object of the service
"""
pass
@ -59,7 +65,9 @@ class ServiceCollectionABC(ABC):
Parameter
---------
service_type: :class:`Type`
Type of the service
service: :class:`Callable`
Object of the service
"""
pass

View File

@ -9,7 +9,9 @@ class ServiceDescriptor:
Parameter
---------
implementation: Union[:class:`type`, Optional[:class:`object`]]
Object or type of service
lifetime: :class:`cpl.dependency_injection.service_lifetime_enum.ServiceLifetimeEnum`
Lifetime of the service
"""
def __init__(self, implementation: Union[type, Optional[object]], lifetime: ServiceLifetimeEnum):

View File

@ -17,8 +17,11 @@ class ServiceProvider(ServiceProviderABC):
Parameter
---------
service_descriptors: list[:class:`cpl.dependency_injection.service_descriptor.ServiceDescriptor`]
Descriptor of the service
config: :class:`cpl.configuration.configuration_abc.ConfigurationABC`
CPL Configuration
db_context: Optional[:class:`cpl.database.context.database_context_abc.DatabaseContextABC`]
Database representation
"""
def __init__(self, service_descriptors: list[ServiceDescriptor], config: ConfigurationABC, db_context: Optional[DatabaseContextABC]):

View File

@ -8,12 +8,14 @@ from cpl.environment.environment_name_enum import EnvironmentNameEnum
class ApplicationEnvironment(ApplicationEnvironmentABC):
r"""Represents environment of the application
Parameter
---------
name: :class:`cpl.environment.environment_name_enum.EnvironmentNameEnum`
"""
def __init__(self, name: EnvironmentNameEnum = EnvironmentNameEnum.production):
"""
Represents environment of the application
:param name:
"""
ApplicationEnvironmentABC.__init__(self)
self._environment_name: Optional[EnvironmentNameEnum] = name

View File

@ -3,12 +3,10 @@ from datetime import datetime
class ApplicationEnvironmentABC(ABC):
r"""ABC of the class :class:`cpl.environment.application_environment.ApplicationEnvironment`"""
@abstractmethod
def __init__(self):
"""
ABC of application environment
"""
pass
@property
@ -69,18 +67,22 @@ class ApplicationEnvironmentABC(ABC):
@abstractmethod
def set_runtime_directory(self, runtime_directory: str):
"""
Sets the current runtime directory
:param runtime_directory:
:return:
r"""Sets the current runtime directory
Parameter
---------
runtime_directory: :class:`str`
Path of the runtime directory
"""
pass
@abstractmethod
def set_working_directory(self, working_directory: str):
"""
Sets the current working directory
:param working_directory:
:return:
r"""Sets the current working directory
Parameter
---------
working_directory: :class:`str`
Path of the current working directory
"""
pass