2021.4.post1 #31
@ -21,7 +21,9 @@ class ServiceCollectionABC(ABC):
|
|||||||
Parameter
|
Parameter
|
||||||
---------
|
---------
|
||||||
db_context: Type[:class:`cpl.database.context.database_context_abc.DatabaseContextABC`]
|
db_context: Type[:class:`cpl.database.context.database_context_abc.DatabaseContextABC`]
|
||||||
|
Database context
|
||||||
db_settings: :class:`cpl.database.database_settings.DatabaseSettings`
|
db_settings: :class:`cpl.database.database_settings.DatabaseSettings`
|
||||||
|
Database settings
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -37,7 +39,9 @@ class ServiceCollectionABC(ABC):
|
|||||||
Parameter
|
Parameter
|
||||||
---------
|
---------
|
||||||
service_type: :class:`Type`
|
service_type: :class:`Type`
|
||||||
|
Type of the service
|
||||||
service: :class:`Callable`
|
service: :class:`Callable`
|
||||||
|
Object of the service
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -48,7 +52,9 @@ class ServiceCollectionABC(ABC):
|
|||||||
Parameter
|
Parameter
|
||||||
---------
|
---------
|
||||||
service_type: :class:`Type`
|
service_type: :class:`Type`
|
||||||
|
Type of the service
|
||||||
service: :class:`Callable`
|
service: :class:`Callable`
|
||||||
|
Object of the service
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -59,7 +65,9 @@ class ServiceCollectionABC(ABC):
|
|||||||
Parameter
|
Parameter
|
||||||
---------
|
---------
|
||||||
service_type: :class:`Type`
|
service_type: :class:`Type`
|
||||||
|
Type of the service
|
||||||
service: :class:`Callable`
|
service: :class:`Callable`
|
||||||
|
Object of the service
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -9,7 +9,9 @@ class ServiceDescriptor:
|
|||||||
Parameter
|
Parameter
|
||||||
---------
|
---------
|
||||||
implementation: Union[:class:`type`, Optional[:class:`object`]]
|
implementation: Union[:class:`type`, Optional[:class:`object`]]
|
||||||
|
Object or type of service
|
||||||
lifetime: :class:`cpl.dependency_injection.service_lifetime_enum.ServiceLifetimeEnum`
|
lifetime: :class:`cpl.dependency_injection.service_lifetime_enum.ServiceLifetimeEnum`
|
||||||
|
Lifetime of the service
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, implementation: Union[type, Optional[object]], lifetime: ServiceLifetimeEnum):
|
def __init__(self, implementation: Union[type, Optional[object]], lifetime: ServiceLifetimeEnum):
|
||||||
|
@ -17,8 +17,11 @@ class ServiceProvider(ServiceProviderABC):
|
|||||||
Parameter
|
Parameter
|
||||||
---------
|
---------
|
||||||
service_descriptors: list[:class:`cpl.dependency_injection.service_descriptor.ServiceDescriptor`]
|
service_descriptors: list[:class:`cpl.dependency_injection.service_descriptor.ServiceDescriptor`]
|
||||||
|
Descriptor of the service
|
||||||
config: :class:`cpl.configuration.configuration_abc.ConfigurationABC`
|
config: :class:`cpl.configuration.configuration_abc.ConfigurationABC`
|
||||||
|
CPL Configuration
|
||||||
db_context: Optional[:class:`cpl.database.context.database_context_abc.DatabaseContextABC`]
|
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]):
|
def __init__(self, service_descriptors: list[ServiceDescriptor], config: ConfigurationABC, db_context: Optional[DatabaseContextABC]):
|
||||||
|
@ -8,12 +8,14 @@ from cpl.environment.environment_name_enum import EnvironmentNameEnum
|
|||||||
|
|
||||||
|
|
||||||
class ApplicationEnvironment(ApplicationEnvironmentABC):
|
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):
|
def __init__(self, name: EnvironmentNameEnum = EnvironmentNameEnum.production):
|
||||||
"""
|
|
||||||
Represents environment of the application
|
|
||||||
:param name:
|
|
||||||
"""
|
|
||||||
ApplicationEnvironmentABC.__init__(self)
|
ApplicationEnvironmentABC.__init__(self)
|
||||||
|
|
||||||
self._environment_name: Optional[EnvironmentNameEnum] = name
|
self._environment_name: Optional[EnvironmentNameEnum] = name
|
||||||
|
@ -3,12 +3,10 @@ from datetime import datetime
|
|||||||
|
|
||||||
|
|
||||||
class ApplicationEnvironmentABC(ABC):
|
class ApplicationEnvironmentABC(ABC):
|
||||||
|
r"""ABC of the class :class:`cpl.environment.application_environment.ApplicationEnvironment`"""
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
"""
|
|
||||||
ABC of application environment
|
|
||||||
"""
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -69,18 +67,22 @@ class ApplicationEnvironmentABC(ABC):
|
|||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def set_runtime_directory(self, runtime_directory: str):
|
def set_runtime_directory(self, runtime_directory: str):
|
||||||
"""
|
r"""Sets the current runtime directory
|
||||||
Sets the current runtime directory
|
|
||||||
:param runtime_directory:
|
Parameter
|
||||||
:return:
|
---------
|
||||||
|
runtime_directory: :class:`str`
|
||||||
|
Path of the runtime directory
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def set_working_directory(self, working_directory: str):
|
def set_working_directory(self, working_directory: str):
|
||||||
"""
|
r"""Sets the current working directory
|
||||||
Sets the current working directory
|
|
||||||
:param working_directory:
|
Parameter
|
||||||
:return:
|
---------
|
||||||
|
working_directory: :class:`str`
|
||||||
|
Path of the current working directory
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user