Added cpl-mail
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Optional
|
||||
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl.core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl.core.console.console import Console
|
||||
from cpl.core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl.core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
|
||||
|
||||
class ApplicationABC(ABC):
|
||||
r"""ABC for the Application class
|
||||
|
||||
Parameters:
|
||||
config: :class:`cpl_core.configuration.configuration_abc.ConfigurationABC`
|
||||
config: :class:`cpl.core.configuration.configuration_abc.ConfigurationABC`
|
||||
Contains object loaded from appsettings
|
||||
services: :class:`cpl_core.dependency_injection.service_provider_abc.ServiceProviderABC`
|
||||
services: :class:`cpl.core.dependency_injection.service_provider_abc.ServiceProviderABC`
|
||||
Contains instances of prepared objects
|
||||
"""
|
||||
|
||||
@@ -49,12 +49,12 @@ class ApplicationABC(ABC):
|
||||
def configure(self):
|
||||
r"""Configure the application
|
||||
|
||||
Called by :class:`cpl_core.application.application_abc.ApplicationABC.run`
|
||||
Called by :class:`cpl.core.application.application_abc.ApplicationABC.run`
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def main(self):
|
||||
r"""Custom entry point
|
||||
|
||||
Called by :class:`cpl_core.application.application_abc.ApplicationABC.run`
|
||||
Called by :class:`cpl.core.application.application_abc.ApplicationABC.run`
|
||||
"""
|
||||
@@ -1,19 +1,19 @@
|
||||
from typing import Type, Optional, Callable, Union
|
||||
|
||||
from cpl_core.application.application_abc import ApplicationABC
|
||||
from cpl_core.application.application_builder_abc import ApplicationBuilderABC
|
||||
from cpl_core.application.application_extension_abc import ApplicationExtensionABC
|
||||
from cpl_core.application.startup_abc import StartupABC
|
||||
from cpl_core.application.startup_extension_abc import StartupExtensionABC
|
||||
from cpl_core.configuration.configuration import Configuration
|
||||
from cpl_core.dependency_injection.service_collection import ServiceCollection
|
||||
from cpl.core.application.application_abc import ApplicationABC
|
||||
from cpl.core.application.application_builder_abc import ApplicationBuilderABC
|
||||
from cpl.core.application.application_extension_abc import ApplicationExtensionABC
|
||||
from cpl.core.application.startup_abc import StartupABC
|
||||
from cpl.core.application.startup_extension_abc import StartupExtensionABC
|
||||
from cpl.core.configuration.configuration import Configuration
|
||||
from cpl.core.dependency_injection.service_collection import ServiceCollection
|
||||
|
||||
|
||||
class ApplicationBuilder(ApplicationBuilderABC):
|
||||
r"""This is class is used to build an object of :class:`cpl_core.application.application_abc.ApplicationABC`
|
||||
r"""This is class is used to build an object of :class:`cpl.core.application.application_abc.ApplicationABC`
|
||||
|
||||
Parameter:
|
||||
app: Type[:class:`cpl_core.application.application_abc.ApplicationABC`]
|
||||
app: Type[:class:`cpl.core.application.application_abc.ApplicationABC`]
|
||||
Application to build
|
||||
"""
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Type
|
||||
|
||||
from cpl_core.application.application_abc import ApplicationABC
|
||||
from cpl_core.application.startup_abc import StartupABC
|
||||
from cpl.core.application.application_abc import ApplicationABC
|
||||
from cpl.core.application.startup_abc import StartupABC
|
||||
|
||||
|
||||
class ApplicationBuilderABC(ABC):
|
||||
r"""ABC for the :class:`cpl_core.application.application_builder.ApplicationBuilder`"""
|
||||
r"""ABC for the :class:`cpl.core.application.application_builder.ApplicationBuilder`"""
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self, *args):
|
||||
@@ -17,7 +17,7 @@ class ApplicationBuilderABC(ABC):
|
||||
r"""Sets the custom startup class to use
|
||||
|
||||
Parameter:
|
||||
startup: Type[:class:`cpl_core.application.startup_abc.StartupABC`]
|
||||
startup: Type[:class:`cpl.core.application.startup_abc.StartupABC`]
|
||||
Startup class to use
|
||||
"""
|
||||
|
||||
@@ -26,7 +26,7 @@ class ApplicationBuilderABC(ABC):
|
||||
r"""Sets the custom startup class to use async
|
||||
|
||||
Parameter:
|
||||
startup: Type[:class:`cpl_core.application.startup_abc.StartupABC`]
|
||||
startup: Type[:class:`cpl.core.application.startup_abc.StartupABC`]
|
||||
Startup class to use
|
||||
"""
|
||||
|
||||
@@ -35,7 +35,7 @@ class ApplicationBuilderABC(ABC):
|
||||
r"""Creates custom application object
|
||||
|
||||
Returns:
|
||||
Object of :class:`cpl_core.application.application_abc.ApplicationABC`
|
||||
Object of :class:`cpl.core.application.application_abc.ApplicationABC`
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -43,5 +43,5 @@ class ApplicationBuilderABC(ABC):
|
||||
r"""Creates custom application object async
|
||||
|
||||
Returns:
|
||||
Object of :class:`cpl_core.application.application_abc.ApplicationABC`
|
||||
Object of :class:`cpl.core.application.application_abc.ApplicationABC`
|
||||
"""
|
||||
@@ -1,7 +1,7 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from cpl_core.configuration import ConfigurationABC
|
||||
from cpl_core.dependency_injection import ServiceProviderABC
|
||||
from cpl.core.configuration import ConfigurationABC
|
||||
from cpl.core.dependency_injection import ServiceProviderABC
|
||||
|
||||
|
||||
class ApplicationExtensionABC(ABC):
|
||||
@@ -1,9 +1,9 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.dependency_injection.service_collection_abc import ServiceCollectionABC
|
||||
from cpl_core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl.core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl.core.dependency_injection.service_collection_abc import ServiceCollectionABC
|
||||
from cpl.core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl.core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
|
||||
|
||||
class StartupABC(ABC):
|
||||
@@ -18,11 +18,11 @@ class StartupABC(ABC):
|
||||
r"""Creates configuration of application
|
||||
|
||||
Parameter:
|
||||
config: :class:`cpl_core.configuration.configuration_abc.ConfigurationABC`
|
||||
env: :class:`cpl_core.environment.application_environment_abc`
|
||||
config: :class:`cpl.core.configuration.configuration_abc.ConfigurationABC`
|
||||
env: :class:`cpl.core.environment.application_environment_abc`
|
||||
|
||||
Returns:
|
||||
Object of :class:`cpl_core.configuration.configuration_abc.ConfigurationABC`
|
||||
Object of :class:`cpl.core.configuration.configuration_abc.ConfigurationABC`
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -30,9 +30,9 @@ class StartupABC(ABC):
|
||||
r"""Creates service provider
|
||||
|
||||
Parameter:
|
||||
services: :class:`cpl_core.dependency_injection.service_collection_abc`
|
||||
env: :class:`cpl_core.environment.application_environment_abc`
|
||||
services: :class:`cpl.core.dependency_injection.service_collection_abc`
|
||||
env: :class:`cpl.core.environment.application_environment_abc`
|
||||
|
||||
Returns:
|
||||
Object of :class:`cpl_core.dependency_injection.service_provider_abc.ServiceProviderABC`
|
||||
Object of :class:`cpl.core.dependency_injection.service_provider_abc.ServiceProviderABC`
|
||||
"""
|
||||
@@ -1,8 +1,8 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.dependency_injection.service_collection_abc import ServiceCollectionABC
|
||||
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl.core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl.core.dependency_injection.service_collection_abc import ServiceCollectionABC
|
||||
from cpl.core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
|
||||
|
||||
class StartupExtensionABC(ABC):
|
||||
@@ -17,8 +17,8 @@ class StartupExtensionABC(ABC):
|
||||
r"""Creates configuration of application
|
||||
|
||||
Parameter:
|
||||
config: :class:`cpl_core.configuration.configuration_abc.ConfigurationABC`
|
||||
env: :class:`cpl_core.environment.application_environment_abc`
|
||||
config: :class:`cpl.core.configuration.configuration_abc.ConfigurationABC`
|
||||
env: :class:`cpl.core.environment.application_environment_abc`
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -26,6 +26,6 @@ class StartupExtensionABC(ABC):
|
||||
r"""Creates service provider
|
||||
|
||||
Parameter:
|
||||
services: :class:`cpl_core.dependency_injection.service_collection_abc`
|
||||
env: :class:`cpl_core.environment.application_environment_abc`
|
||||
services: :class:`cpl.core.dependency_injection.service_collection_abc`
|
||||
env: :class:`cpl.core.environment.application_environment_abc`
|
||||
"""
|
||||
@@ -1,6 +1,6 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from cpl_core.configuration.argument_type_enum import ArgumentTypeEnum
|
||||
from cpl.core.configuration.argument_type_enum import ArgumentTypeEnum
|
||||
|
||||
|
||||
class ArgumentABC(ABC):
|
||||
@@ -19,7 +19,7 @@ class ArgumentABC(ABC):
|
||||
token: :class:`str`
|
||||
name: :class:`str`
|
||||
aliases: list[:class:`str`]
|
||||
console_arguments: List[:class:`cpl_core.configuration.console_argument.ConsoleArgument`]
|
||||
console_arguments: List[:class:`cpl.core.configuration.console_argument.ConsoleArgument`]
|
||||
"""
|
||||
self._token = token
|
||||
self._name = name
|
||||
@@ -55,9 +55,9 @@ class ArgumentABC(ABC):
|
||||
Specifies the specific type of the argument
|
||||
|
||||
Returns:
|
||||
self :class:`cpl_core.configuration.console_argument.ConsoleArgument` not created argument!
|
||||
self :class:`cpl.core.configuration.console_argument.ConsoleArgument` not created argument!
|
||||
"""
|
||||
from cpl_core.configuration.argument_builder import ArgumentBuilder
|
||||
from cpl.core.configuration.argument_builder import ArgumentBuilder
|
||||
|
||||
argument = ArgumentBuilder.build_argument(arg_type, *args, *kwargs)
|
||||
self._console_arguments.append(argument)
|
||||
@@ -1,10 +1,10 @@
|
||||
from typing import Union
|
||||
|
||||
from cpl_core.configuration.argument_type_enum import ArgumentTypeEnum
|
||||
from cpl_core.configuration.executable_argument import ExecutableArgument
|
||||
from cpl_core.configuration.flag_argument import FlagArgument
|
||||
from cpl_core.configuration.variable_argument import VariableArgument
|
||||
from cpl_core.console import Console
|
||||
from cpl.core.configuration.argument_type_enum import ArgumentTypeEnum
|
||||
from cpl.core.configuration.executable_argument import ExecutableArgument
|
||||
from cpl.core.configuration.flag_argument import FlagArgument
|
||||
from cpl.core.configuration.variable_argument import VariableArgument
|
||||
from cpl.core.console import Console
|
||||
|
||||
|
||||
class ArgumentBuilder:
|
||||
@@ -5,25 +5,25 @@ import traceback
|
||||
from collections.abc import Callable
|
||||
from typing import Union, Optional
|
||||
|
||||
from cpl_core.configuration.argument_abc import ArgumentABC
|
||||
from cpl_core.configuration.argument_builder import ArgumentBuilder
|
||||
from cpl_core.configuration.argument_type_enum import ArgumentTypeEnum
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
from cpl_core.configuration.configuration_variable_name_enum import (
|
||||
from cpl.core.configuration.argument_abc import ArgumentABC
|
||||
from cpl.core.configuration.argument_builder import ArgumentBuilder
|
||||
from cpl.core.configuration.argument_type_enum import ArgumentTypeEnum
|
||||
from cpl.core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl.core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
from cpl.core.configuration.configuration_variable_name_enum import (
|
||||
ConfigurationVariableNameEnum,
|
||||
)
|
||||
from cpl_core.configuration.executable_argument import ExecutableArgument
|
||||
from cpl_core.configuration.flag_argument import FlagArgument
|
||||
from cpl_core.configuration.variable_argument import VariableArgument
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_core.console.foreground_color_enum import ForegroundColorEnum
|
||||
from cpl_core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl_core.environment.application_environment import ApplicationEnvironment
|
||||
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl_core.environment.environment_name_enum import EnvironmentNameEnum
|
||||
from cpl_core.type import T, R
|
||||
from cpl_core.utils.json_processor import JSONProcessor
|
||||
from cpl.core.configuration.executable_argument import ExecutableArgument
|
||||
from cpl.core.configuration.flag_argument import FlagArgument
|
||||
from cpl.core.configuration.variable_argument import VariableArgument
|
||||
from cpl.core.console.console import Console
|
||||
from cpl.core.console.foreground_color_enum import ForegroundColorEnum
|
||||
from cpl.core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl.core.environment.application_environment import ApplicationEnvironment
|
||||
from cpl.core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl.core.environment.environment_name_enum import EnvironmentNameEnum
|
||||
from cpl.core.type import T, R
|
||||
from cpl.core.utils.json_processor import JSONProcessor
|
||||
|
||||
|
||||
class Configuration(ConfigurationABC):
|
||||
@@ -2,16 +2,16 @@ from abc import abstractmethod, ABC
|
||||
from collections.abc import Callable
|
||||
from typing import Optional
|
||||
|
||||
from cpl_core.configuration.argument_abc import ArgumentABC
|
||||
from cpl_core.configuration.argument_type_enum import ArgumentTypeEnum
|
||||
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl_core.type import T, R
|
||||
from cpl.core.configuration.argument_abc import ArgumentABC
|
||||
from cpl.core.configuration.argument_type_enum import ArgumentTypeEnum
|
||||
from cpl.core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl.core.type import T, R
|
||||
|
||||
|
||||
class ConfigurationABC(ABC):
|
||||
@abstractmethod
|
||||
def __init__(self):
|
||||
r"""ABC for the :class:`cpl_core.configuration.configuration.Configuration`"""
|
||||
r"""ABC for the :class:`cpl.core.configuration.configuration.Configuration`"""
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
@@ -52,7 +52,7 @@ class ConfigurationABC(ABC):
|
||||
r"""Adds console argument to known console arguments
|
||||
|
||||
Parameter:
|
||||
argument: :class:`cpl_core.configuration.console_argument.ConsoleArgumentABC`
|
||||
argument: :class:`cpl.core.configuration.console_argument.ConsoleArgumentABC`
|
||||
Specifies the console argument
|
||||
"""
|
||||
|
||||
@@ -76,7 +76,7 @@ class ConfigurationABC(ABC):
|
||||
r"""Add configuration object
|
||||
|
||||
Parameter:
|
||||
key_type: :class:`cpl_core.type.T`
|
||||
key_type: :class:`cpl.core.type.T`
|
||||
Type of the value
|
||||
value: any
|
||||
Object of the value
|
||||
@@ -99,11 +99,11 @@ class ConfigurationABC(ABC):
|
||||
Specifies were the value begins
|
||||
is_value_token_optional :class:`bool`
|
||||
Specifies if values are optional
|
||||
runnable: :class:`cpl_core.configuration.console_argument.ConsoleArgumentABC`
|
||||
runnable: :class:`cpl.core.configuration.console_argument.ConsoleArgumentABC`
|
||||
Specifies class to run when called if value is not None
|
||||
|
||||
Returns:
|
||||
Object of :class:`cpl_core.configuration.console_argument.ConsoleArgumentABC`
|
||||
Object of :class:`cpl.core.configuration.console_argument.ConsoleArgumentABC`
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -120,11 +120,11 @@ class ConfigurationABC(ABC):
|
||||
r"""Returns value from configuration by given type
|
||||
|
||||
Parameter:
|
||||
search_type: :class:`cpl_core.type.T`
|
||||
search_type: :class:`cpl.core.type.T`
|
||||
Type to search for
|
||||
|
||||
Returns:
|
||||
Object of Union[:class:`str`, :class:`cpl_core.configuration.configuration_model_abc.ConfigurationModelABC`]
|
||||
Object of Union[:class:`str`, :class:`cpl.core.configuration.configuration_model_abc.ConfigurationModelABC`]
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -1,8 +1,8 @@
|
||||
from typing import Type, Optional
|
||||
|
||||
from cpl_core.configuration.argument_executable_abc import ArgumentExecutableABC
|
||||
from cpl_core.configuration.argument_abc import ArgumentABC
|
||||
from cpl_core.configuration.validator_abc import ValidatorABC
|
||||
from cpl.core.configuration.argument_executable_abc import ArgumentExecutableABC
|
||||
from cpl.core.configuration.argument_abc import ArgumentABC
|
||||
from cpl.core.configuration.validator_abc import ValidatorABC
|
||||
|
||||
|
||||
class ExecutableArgument(ArgumentABC):
|
||||
@@ -1,4 +1,4 @@
|
||||
from cpl_core.configuration.argument_abc import ArgumentABC
|
||||
from cpl.core.configuration.argument_abc import ArgumentABC
|
||||
|
||||
|
||||
class FlagArgument(ArgumentABC):
|
||||
@@ -1,4 +1,4 @@
|
||||
from cpl_core.configuration.argument_abc import ArgumentABC
|
||||
from cpl.core.configuration.argument_abc import ArgumentABC
|
||||
|
||||
|
||||
class VariableArgument(ArgumentABC):
|
||||
@@ -9,10 +9,10 @@ import colorama
|
||||
from tabulate import tabulate
|
||||
from termcolor import colored
|
||||
|
||||
from cpl_core.console.background_color_enum import BackgroundColorEnum
|
||||
from cpl_core.console.console_call import ConsoleCall
|
||||
from cpl_core.console.foreground_color_enum import ForegroundColorEnum
|
||||
from cpl_core.console.spinner_thread import SpinnerThread
|
||||
from cpl.core.console.background_color_enum import BackgroundColorEnum
|
||||
from cpl.core.console.console_call import ConsoleCall
|
||||
from cpl.core.console.foreground_color_enum import ForegroundColorEnum
|
||||
from cpl.core.console.spinner_thread import SpinnerThread
|
||||
|
||||
|
||||
class Console:
|
||||
@@ -62,7 +62,7 @@ class Console:
|
||||
r"""Sets the background color
|
||||
|
||||
Parameter:
|
||||
color: Union[:class:`cpl_core.console.background_color_enum.BackgroundColorEnum`, :class:`str`]
|
||||
color: Union[:class:`cpl.core.console.background_color_enum.BackgroundColorEnum`, :class:`str`]
|
||||
Background color of the console
|
||||
"""
|
||||
if type(color) is str:
|
||||
@@ -75,7 +75,7 @@ class Console:
|
||||
r"""Sets the foreground color
|
||||
|
||||
Parameter:
|
||||
color: Union[:class:`cpl_core.console.background_color_enum.BackgroundColorEnum`, :class:`str`]
|
||||
color: Union[:class:`cpl.core.console.background_color_enum.BackgroundColorEnum`, :class:`str`]
|
||||
Foreground color of the console
|
||||
"""
|
||||
if type(color) is str:
|
||||
@@ -366,17 +366,17 @@ class Console:
|
||||
Message or header of the selection
|
||||
options: List[:class:`str`]
|
||||
Selectable options
|
||||
header_foreground_color: Union[:class:`str`, :class:`cpl_core.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
header_foreground_color: Union[:class:`str`, :class:`cpl.core.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
Foreground color of the header
|
||||
header_background_color: Union[:class:`str`, :class:`cpl_core.console.background_color_enum.BackgroundColorEnum`]
|
||||
header_background_color: Union[:class:`str`, :class:`cpl.core.console.background_color_enum.BackgroundColorEnum`]
|
||||
Background color of the header
|
||||
option_foreground_color: Union[:class:`str`, :class:`cpl_core.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
option_foreground_color: Union[:class:`str`, :class:`cpl.core.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
Foreground color of the options
|
||||
option_background_color: Union[:class:`str`, :class:`cpl_core.console.background_color_enum.BackgroundColorEnum`]
|
||||
option_background_color: Union[:class:`str`, :class:`cpl.core.console.background_color_enum.BackgroundColorEnum`]
|
||||
Background color of the options
|
||||
cursor_foreground_color: Union[:class:`str`, :class:`cpl_core.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
cursor_foreground_color: Union[:class:`str`, :class:`cpl.core.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
Foreground color of the cursor
|
||||
cursor_background_color: Union[:class:`str`, :class:`cpl_core.console.background_color_enum.BackgroundColorEnum`]
|
||||
cursor_background_color: Union[:class:`str`, :class:`cpl.core.console.background_color_enum.BackgroundColorEnum`]
|
||||
Background color of the cursor
|
||||
|
||||
Returns:
|
||||
@@ -430,13 +430,13 @@ class Console:
|
||||
Function to call
|
||||
args: :class:`list`
|
||||
Arguments of the function
|
||||
text_foreground_color: Union[:class:`str`, :class:`cpl_core.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
text_foreground_color: Union[:class:`str`, :class:`cpl.core.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
Foreground color of the text
|
||||
spinner_foreground_color: Union[:class:`str`, :class:`cpl_core.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
spinner_foreground_color: Union[:class:`str`, :class:`cpl.core.console.foreground_color_enum.ForegroundColorEnum`]
|
||||
Foreground color of the spinner
|
||||
text_background_color: Union[:class:`str`, :class:`cpl_core.console.background_color_enum.BackgroundColorEnum`]
|
||||
text_background_color: Union[:class:`str`, :class:`cpl.core.console.background_color_enum.BackgroundColorEnum`]
|
||||
Background color of the text
|
||||
spinner_background_color: Union[:class:`str`, :class:`cpl_core.console.background_color_enum.BackgroundColorEnum`]
|
||||
spinner_background_color: Union[:class:`str`, :class:`cpl.core.console.background_color_enum.BackgroundColorEnum`]
|
||||
Background color of the spinner
|
||||
kwargs: :class:`dict`
|
||||
Keyword arguments of the call
|
||||
@@ -5,8 +5,8 @@ import time
|
||||
|
||||
from termcolor import colored
|
||||
|
||||
from cpl_core.console.background_color_enum import BackgroundColorEnum
|
||||
from cpl_core.console.foreground_color_enum import ForegroundColorEnum
|
||||
from cpl.core.console.background_color_enum import BackgroundColorEnum
|
||||
from cpl.core.console.foreground_color_enum import ForegroundColorEnum
|
||||
|
||||
|
||||
class SpinnerThread(threading.Thread):
|
||||
@@ -15,9 +15,9 @@ class SpinnerThread(threading.Thread):
|
||||
Parameter:
|
||||
msg_len: :class:`int`
|
||||
Length of the message
|
||||
foreground_color: :class:`cpl_core.console.foreground_color.ForegroundColorEnum`
|
||||
foreground_color: :class:`cpl.core.console.foreground_color.ForegroundColorEnum`
|
||||
Foreground color of the spinner
|
||||
background_color: :class:`cpl_core.console.background_color.BackgroundColorEnum`
|
||||
background_color: :class:`cpl.core.console.background_color.BackgroundColorEnum`
|
||||
Background color of the spinner
|
||||
"""
|
||||
|
||||
@@ -4,9 +4,9 @@ import mysql.connector as sql
|
||||
from mysql.connector.abstracts import MySQLConnectionAbstract
|
||||
from mysql.connector.cursor import MySQLCursorBuffered
|
||||
|
||||
from cpl_core.database.connection.database_connection_abc import DatabaseConnectionABC
|
||||
from cpl_core.database.database_settings import DatabaseSettings
|
||||
from cpl_core.utils.credential_manager import CredentialManager
|
||||
from cpl.core.database.connection.database_connection_abc import DatabaseConnectionABC
|
||||
from cpl.core.database.database_settings import DatabaseSettings
|
||||
from cpl.core.utils.credential_manager import CredentialManager
|
||||
|
||||
|
||||
class DatabaseConnection(DatabaseConnectionABC):
|
||||
@@ -1,12 +1,12 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from cpl_core.database.database_settings import DatabaseSettings
|
||||
from cpl.core.database.database_settings import DatabaseSettings
|
||||
from mysql.connector.abstracts import MySQLConnectionAbstract
|
||||
from mysql.connector.cursor import MySQLCursorBuffered
|
||||
|
||||
|
||||
class DatabaseConnectionABC(ABC):
|
||||
r"""ABC for the :class:`cpl_core.database.connection.database_connection.DatabaseConnection`"""
|
||||
r"""ABC for the :class:`cpl.core.database.connection.database_connection.DatabaseConnection`"""
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self):
|
||||
@@ -1,10 +1,10 @@
|
||||
from typing import Optional
|
||||
|
||||
|
||||
from cpl_core.database.connection.database_connection import DatabaseConnection
|
||||
from cpl_core.database.connection.database_connection_abc import DatabaseConnectionABC
|
||||
from cpl_core.database.context.database_context_abc import DatabaseContextABC
|
||||
from cpl_core.database.database_settings import DatabaseSettings
|
||||
from cpl.core.database.connection.database_connection import DatabaseConnection
|
||||
from cpl.core.database.connection.database_connection_abc import DatabaseConnectionABC
|
||||
from cpl.core.database.context.database_context_abc import DatabaseContextABC
|
||||
from cpl.core.database.database_settings import DatabaseSettings
|
||||
from mysql.connector.cursor import MySQLCursorBuffered
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class DatabaseContext(DatabaseContextABC):
|
||||
r"""Representation of the database context
|
||||
|
||||
Parameter:
|
||||
database_settings: :class:`cpl_core.database.database_settings.DatabaseSettings`
|
||||
database_settings: :class:`cpl.core.database.database_settings.DatabaseSettings`
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
@@ -1,11 +1,11 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from cpl_core.database.database_settings import DatabaseSettings
|
||||
from cpl.core.database.database_settings import DatabaseSettings
|
||||
from mysql.connector.cursor import MySQLCursorBuffered
|
||||
|
||||
|
||||
class DatabaseContextABC(ABC):
|
||||
r"""ABC for the :class:`cpl_core.database.context.database_context.DatabaseContext`"""
|
||||
r"""ABC for the :class:`cpl.core.database.context.database_context.DatabaseContext`"""
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self, *args):
|
||||
@@ -21,7 +21,7 @@ class DatabaseContextABC(ABC):
|
||||
r"""Connects to a database by connection settings
|
||||
|
||||
Parameter:
|
||||
database_settings :class:`cpl_core.database.database_settings.DatabaseSettings`
|
||||
database_settings :class:`cpl.core.database.database_settings.DatabaseSettings`
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
from cpl.core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
|
||||
|
||||
class DatabaseSettings(ConfigurationModelABC):
|
||||
@@ -1,5 +1,5 @@
|
||||
from cpl_core.dependency_injection.scope_abc import ScopeABC
|
||||
from cpl_core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl.core.dependency_injection.scope_abc import ScopeABC
|
||||
from cpl.core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
|
||||
|
||||
class Scope(ScopeABC):
|
||||
@@ -2,7 +2,7 @@ from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class ScopeABC(ABC):
|
||||
r"""ABC for the class :class:`cpl_core.dependency_injection.scope.Scope`"""
|
||||
r"""ABC for the class :class:`cpl.core.dependency_injection.scope.Scope`"""
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
@@ -13,7 +13,7 @@ class ScopeABC(ABC):
|
||||
r"""Returns to service provider of scope
|
||||
|
||||
Returns:
|
||||
Object of type :class:`cpl_core.dependency_injection.service_provider_abc.ServiceProviderABC`
|
||||
Object of type :class:`cpl.core.dependency_injection.service_provider_abc.ServiceProviderABC`
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -1,10 +1,10 @@
|
||||
from cpl_core.dependency_injection.scope import Scope
|
||||
from cpl_core.dependency_injection.scope_abc import ScopeABC
|
||||
from cpl_core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl.core.dependency_injection.scope import Scope
|
||||
from cpl.core.dependency_injection.scope_abc import ScopeABC
|
||||
from cpl.core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
|
||||
|
||||
class ScopeBuilder:
|
||||
r"""Class to build :class:`cpl_core.dependency_injection.scope.Scope`"""
|
||||
r"""Class to build :class:`cpl.core.dependency_injection.scope.Scope`"""
|
||||
|
||||
def __init__(self, service_provider: ServiceProviderABC) -> None:
|
||||
self._service_provider = service_provider
|
||||
@@ -13,6 +13,6 @@ class ScopeBuilder:
|
||||
r"""Returns scope
|
||||
|
||||
Returns:
|
||||
Object of type :class:`cpl_core.dependency_injection.scope.Scope`
|
||||
Object of type :class:`cpl.core.dependency_injection.scope.Scope`
|
||||
"""
|
||||
return Scope(self._service_provider)
|
||||
@@ -1,17 +1,17 @@
|
||||
from typing import Union, Type, Callable, Optional
|
||||
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.database.context.database_context_abc import DatabaseContextABC
|
||||
from cpl_core.database.database_settings import DatabaseSettings
|
||||
from cpl_core.dependency_injection.service_collection_abc import ServiceCollectionABC
|
||||
from cpl_core.dependency_injection.service_descriptor import ServiceDescriptor
|
||||
from cpl_core.dependency_injection.service_lifetime_enum import ServiceLifetimeEnum
|
||||
from cpl_core.dependency_injection.service_provider import ServiceProvider
|
||||
from cpl_core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl_core.log.logger_abc import LoggerABC
|
||||
from cpl_core.log.logger_service import Logger
|
||||
from cpl_core.pipes.pipe_abc import PipeABC
|
||||
from cpl_core.type import T
|
||||
from cpl.core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl.core.database.context.database_context_abc import DatabaseContextABC
|
||||
from cpl.core.database.database_settings import DatabaseSettings
|
||||
from cpl.core.dependency_injection.service_collection_abc import ServiceCollectionABC
|
||||
from cpl.core.dependency_injection.service_descriptor import ServiceDescriptor
|
||||
from cpl.core.dependency_injection.service_lifetime_enum import ServiceLifetimeEnum
|
||||
from cpl.core.dependency_injection.service_provider import ServiceProvider
|
||||
from cpl.core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl.core.log.logger_abc import LoggerABC
|
||||
from cpl.core.log.logger_service import Logger
|
||||
from cpl.core.pipes.pipe_abc import PipeABC
|
||||
from cpl.core.type import T
|
||||
|
||||
|
||||
class ServiceCollection(ServiceCollectionABC):
|
||||
@@ -1,14 +1,14 @@
|
||||
from abc import abstractmethod, ABC
|
||||
from typing import Type
|
||||
|
||||
from cpl_core.database.database_settings import DatabaseSettings
|
||||
from cpl_core.database.context.database_context_abc import DatabaseContextABC
|
||||
from cpl_core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl_core.type import T
|
||||
from cpl.core.database.database_settings import DatabaseSettings
|
||||
from cpl.core.database.context.database_context_abc import DatabaseContextABC
|
||||
from cpl.core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl.core.type import T
|
||||
|
||||
|
||||
class ServiceCollectionABC(ABC):
|
||||
r"""ABC for the class :class:`cpl_core.dependency_injection.service_collection.ServiceCollection`"""
|
||||
r"""ABC for the class :class:`cpl.core.dependency_injection.service_collection.ServiceCollection`"""
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self):
|
||||
@@ -19,7 +19,7 @@ class ServiceCollectionABC(ABC):
|
||||
r"""Adds database context
|
||||
|
||||
Parameter:
|
||||
db_context: Type[:class:`cpl_core.database.context.database_context_abc.DatabaseContextABC`]
|
||||
db_context: Type[:class:`cpl.core.database.context.database_context_abc.DatabaseContextABC`]
|
||||
Database context
|
||||
"""
|
||||
|
||||
@@ -50,7 +50,7 @@ class ServiceCollectionABC(ABC):
|
||||
Object of the service
|
||||
|
||||
Returns:
|
||||
self: :class:`cpl_core.dependency_injection.service_collection_abc.ServiceCollectionABC`
|
||||
self: :class:`cpl.core.dependency_injection.service_collection_abc.ServiceCollectionABC`
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -64,7 +64,7 @@ class ServiceCollectionABC(ABC):
|
||||
Object of the service
|
||||
|
||||
Returns:
|
||||
self: :class:`cpl_core.dependency_injection.service_collection_abc.ServiceCollectionABC`
|
||||
self: :class:`cpl.core.dependency_injection.service_collection_abc.ServiceCollectionABC`
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -78,7 +78,7 @@ class ServiceCollectionABC(ABC):
|
||||
Object of the service
|
||||
|
||||
Returns:
|
||||
self: :class:`cpl_core.dependency_injection.service_collection_abc.ServiceCollectionABC`
|
||||
self: :class:`cpl.core.dependency_injection.service_collection_abc.ServiceCollectionABC`
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -86,5 +86,5 @@ class ServiceCollectionABC(ABC):
|
||||
r"""Creates instance of the service provider
|
||||
|
||||
Returns:
|
||||
Object of type :class:`cpl_core.dependency_injection.service_provider_abc.ServiceProviderABC`
|
||||
Object of type :class:`cpl.core.dependency_injection.service_provider_abc.ServiceProviderABC`
|
||||
"""
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import Union, Optional
|
||||
|
||||
from cpl_core.dependency_injection.service_lifetime_enum import ServiceLifetimeEnum
|
||||
from cpl.core.dependency_injection.service_lifetime_enum import ServiceLifetimeEnum
|
||||
|
||||
|
||||
class ServiceDescriptor:
|
||||
@@ -9,7 +9,7 @@ class ServiceDescriptor:
|
||||
Parameter:
|
||||
implementation: Union[:class:`type`, Optional[:class:`object`]]
|
||||
Object or type of service
|
||||
lifetime: :class:`cpl_core.dependency_injection.service_lifetime_enum.ServiceLifetimeEnum`
|
||||
lifetime: :class:`cpl.core.dependency_injection.service_lifetime_enum.ServiceLifetimeEnum`
|
||||
Lifetime of the service
|
||||
"""
|
||||
|
||||
@@ -3,16 +3,16 @@ import typing
|
||||
from inspect import signature, Parameter, Signature
|
||||
from typing import Optional
|
||||
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
from cpl_core.database.context.database_context_abc import DatabaseContextABC
|
||||
from cpl_core.dependency_injection.scope_abc import ScopeABC
|
||||
from cpl_core.dependency_injection.scope_builder import ScopeBuilder
|
||||
from cpl_core.dependency_injection.service_descriptor import ServiceDescriptor
|
||||
from cpl_core.dependency_injection.service_lifetime_enum import ServiceLifetimeEnum
|
||||
from cpl_core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl_core.type import T, R
|
||||
from cpl.core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl.core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
from cpl.core.database.context.database_context_abc import DatabaseContextABC
|
||||
from cpl.core.dependency_injection.scope_abc import ScopeABC
|
||||
from cpl.core.dependency_injection.scope_builder import ScopeBuilder
|
||||
from cpl.core.dependency_injection.service_descriptor import ServiceDescriptor
|
||||
from cpl.core.dependency_injection.service_lifetime_enum import ServiceLifetimeEnum
|
||||
from cpl.core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl.core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl.core.type import T, R
|
||||
|
||||
|
||||
class ServiceProvider(ServiceProviderABC):
|
||||
@@ -20,11 +20,11 @@ class ServiceProvider(ServiceProviderABC):
|
||||
|
||||
Parameter
|
||||
---------
|
||||
service_descriptors: list[:class:`cpl_core.dependency_injection.service_descriptor.ServiceDescriptor`]
|
||||
service_descriptors: list[:class:`cpl.core.dependency_injection.service_descriptor.ServiceDescriptor`]
|
||||
Descriptor of the service
|
||||
config: :class:`cpl_core.configuration.configuration_abc.ConfigurationABC`
|
||||
config: :class:`cpl.core.configuration.configuration_abc.ConfigurationABC`
|
||||
CPL Configuration
|
||||
db_context: Optional[:class:`cpl_core.database.context.database_context_abc.DatabaseContextABC`]
|
||||
db_context: Optional[:class:`cpl.core.database.context.database_context_abc.DatabaseContextABC`]
|
||||
Database representation
|
||||
"""
|
||||
|
||||
@@ -3,12 +3,12 @@ from abc import abstractmethod, ABC
|
||||
from inspect import Signature, signature
|
||||
from typing import Optional
|
||||
|
||||
from cpl_core.dependency_injection.scope_abc import ScopeABC
|
||||
from cpl_core.type import T, R
|
||||
from cpl.core.dependency_injection.scope_abc import ScopeABC
|
||||
from cpl.core.type import T, R
|
||||
|
||||
|
||||
class ServiceProviderABC(ABC):
|
||||
r"""ABC for the class :class:`cpl_core.dependency_injection.service_provider.ServiceProvider`"""
|
||||
r"""ABC for the class :class:`cpl.core.dependency_injection.service_provider.ServiceProvider`"""
|
||||
|
||||
_provider: Optional["ServiceProviderABC"] = None
|
||||
|
||||
@@ -44,7 +44,7 @@ class ServiceProviderABC(ABC):
|
||||
|
||||
Parameter
|
||||
---------
|
||||
Object of type :class:`cpl_core.dependency_injection.scope_abc.ScopeABC`
|
||||
Object of type :class:`cpl.core.dependency_injection.scope_abc.ScopeABC`
|
||||
Service scope
|
||||
"""
|
||||
|
||||
@@ -54,7 +54,7 @@ class ServiceProviderABC(ABC):
|
||||
|
||||
Returns
|
||||
-------
|
||||
Object of type :class:`cpl_core.dependency_injection.scope_abc.ScopeABC`
|
||||
Object of type :class:`cpl.core.dependency_injection.scope_abc.ScopeABC`
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -63,12 +63,12 @@ class ServiceProviderABC(ABC):
|
||||
|
||||
Parameter
|
||||
---------
|
||||
instance_type: :class:`cpl_core.type.T`
|
||||
instance_type: :class:`cpl.core.type.T`
|
||||
The type of the searched instance
|
||||
|
||||
Returns
|
||||
-------
|
||||
Object of type Optional[:class:`cpl_core.type.T`]
|
||||
Object of type Optional[:class:`cpl.core.type.T`]
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -77,12 +77,12 @@ class ServiceProviderABC(ABC):
|
||||
|
||||
Parameter
|
||||
---------
|
||||
service_type: :class:`cpl_core.type.T`
|
||||
service_type: :class:`cpl.core.type.T`
|
||||
The type of the searched instance
|
||||
|
||||
Returns
|
||||
-------
|
||||
Object of type list[Optional[:class:`cpl_core.type.T`]
|
||||
Object of type list[Optional[:class:`cpl.core.type.T`]
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
@@ -3,15 +3,15 @@ from datetime import datetime
|
||||
from socket import gethostname
|
||||
from typing import Optional
|
||||
|
||||
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl_core.environment.environment_name_enum import EnvironmentNameEnum
|
||||
from cpl.core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl.core.environment.environment_name_enum import EnvironmentNameEnum
|
||||
|
||||
|
||||
class ApplicationEnvironment(ApplicationEnvironmentABC):
|
||||
r"""Represents environment of the application
|
||||
|
||||
Parameter:
|
||||
name: :class:`cpl_core.environment.environment_name_enum.EnvironmentNameEnum`
|
||||
name: :class:`cpl.core.environment.environment_name_enum.EnvironmentNameEnum`
|
||||
"""
|
||||
|
||||
def __init__(self, name: EnvironmentNameEnum = EnvironmentNameEnum.production):
|
||||
@@ -3,7 +3,7 @@ from datetime import datetime
|
||||
|
||||
|
||||
class ApplicationEnvironmentABC(ABC):
|
||||
r"""ABC of the class :class:`cpl_core.environment.application_environment.ApplicationEnvironment`"""
|
||||
r"""ABC of the class :class:`cpl.core.environment.application_environment.ApplicationEnvironment`"""
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self):
|
||||
@@ -2,7 +2,7 @@ from abc import abstractmethod, ABC
|
||||
|
||||
|
||||
class LoggerABC(ABC):
|
||||
r"""ABC for :class:`cpl_core.log.logger_service.Logger`"""
|
||||
r"""ABC for :class:`cpl.core.log.logger_service.Logger`"""
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self):
|
||||
@@ -4,25 +4,25 @@ import sys
|
||||
import traceback
|
||||
from string import Template
|
||||
|
||||
from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_core.console.foreground_color_enum import ForegroundColorEnum
|
||||
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl_core.log.logger_abc import LoggerABC
|
||||
from cpl_core.log.logging_level_enum import LoggingLevelEnum
|
||||
from cpl_core.log.logging_settings import LoggingSettings
|
||||
from cpl_core.time.time_format_settings import TimeFormatSettings
|
||||
from cpl.core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
from cpl.core.console.console import Console
|
||||
from cpl.core.console.foreground_color_enum import ForegroundColorEnum
|
||||
from cpl.core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl.core.log.logger_abc import LoggerABC
|
||||
from cpl.core.log.logging_level_enum import LoggingLevelEnum
|
||||
from cpl.core.log.logging_settings import LoggingSettings
|
||||
from cpl.core.time.time_format_settings import TimeFormatSettings
|
||||
|
||||
|
||||
class Logger(LoggerABC):
|
||||
r"""Service for logging
|
||||
|
||||
Parameter:
|
||||
logging_settings: :class:`cpl_core.log.logging_settings.LoggingSettings`
|
||||
logging_settings: :class:`cpl.core.log.logging_settings.LoggingSettings`
|
||||
Settings for the logger
|
||||
time_format: :class:`cpl_core.time.time_format_settings.TimeFormatSettings`
|
||||
time_format: :class:`cpl.core.time.time_format_settings.TimeFormatSettings`
|
||||
Time format settings
|
||||
env: :class:`cpl_core.environment.application_environment_abc.ApplicationEnvironmentABC`
|
||||
env: :class:`cpl.core.environment.application_environment_abc.ApplicationEnvironmentABC`
|
||||
Environment of the application
|
||||
"""
|
||||
|
||||
@@ -138,7 +138,7 @@ class Logger(LoggerABC):
|
||||
Parameter:
|
||||
name: :class:`str`
|
||||
Name of the message
|
||||
level: :class:`cpl_core.log.logging_level_enum.LoggingLevelEnum`
|
||||
level: :class:`cpl.core.log.logging_level_enum.LoggingLevelEnum`
|
||||
Logging level
|
||||
message: :class:`str`
|
||||
Log message
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Optional
|
||||
|
||||
from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
from cpl_core.log.logging_level_enum import LoggingLevelEnum
|
||||
from cpl.core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
from cpl.core.log.logging_level_enum import LoggingLevelEnum
|
||||
|
||||
|
||||
class LoggingSettings(ConfigurationModelABC):
|
||||
@@ -1,4 +1,4 @@
|
||||
from cpl_core.pipes.pipe_abc import PipeABC
|
||||
from cpl.core.pipes.pipe_abc import PipeABC
|
||||
|
||||
|
||||
class BoolPipe(PipeABC):
|
||||
@@ -1,4 +1,4 @@
|
||||
from cpl_core.pipes.pipe_abc import PipeABC
|
||||
from cpl.core.pipes.pipe_abc import PipeABC
|
||||
|
||||
|
||||
class IPAddressPipe(PipeABC):
|
||||
@@ -1,5 +1,5 @@
|
||||
from cpl_cli.configuration import VersionSettingsNameEnum
|
||||
from cpl_core.pipes.pipe_abc import PipeABC
|
||||
from cpl.core.pipes.pipe_abc import PipeABC
|
||||
|
||||
|
||||
class VersionPipe(PipeABC):
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
from cpl.core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
|
||||
|
||||
class TimeFormatSettings(ConfigurationModelABC):
|
||||
@@ -1,7 +1,7 @@
|
||||
import enum
|
||||
from inspect import signature, Parameter
|
||||
|
||||
from cpl_core.utils import String
|
||||
from cpl.core.utils import String
|
||||
|
||||
|
||||
class JSONProcessor:
|
||||
@@ -8,7 +8,7 @@ version = "2024.7.0"
|
||||
description = "CPL core"
|
||||
readme = "CPL core package"
|
||||
requires-python = ">=3.12"
|
||||
license = { text = "MIT" }
|
||||
license = "MIT"
|
||||
authors = [
|
||||
{ name = "Sven Heidemann", email = "sven.heidemann@sh-edraft.de" }
|
||||
]
|
||||
@@ -19,18 +19,9 @@ dynamic = ["dependencies", "optional-dependencies"]
|
||||
[project.urls]
|
||||
Homepage = "https://www.sh-edraft.de"
|
||||
|
||||
[tool.setuptools]
|
||||
package-dir = { "" = "." }
|
||||
include-package-data = true
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
where = ["."]
|
||||
include = ["cpl_core*"]
|
||||
exclude = [
|
||||
"__pycache__",
|
||||
"logs",
|
||||
"tests",
|
||||
]
|
||||
include = ["cpl*"]
|
||||
|
||||
[tool.setuptools.dynamic]
|
||||
dependencies = { file = ["requirements.txt"] }
|
||||
5
src/cpl-mail/cpl/mail/__init__.py
Normal file
5
src/cpl-mail/cpl/mail/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from .email_model import EMail
|
||||
from .email_client_service import EMailClient
|
||||
from .abc.email_client_abc import EMailClientABC
|
||||
from .email_client_settings import EMailClientSettings
|
||||
from .email_client_settings_name_enum import EMailClientSettingsNameEnum
|
||||
@@ -1,10 +1,10 @@
|
||||
from abc import abstractmethod, ABC
|
||||
|
||||
from cpl_mail.email_model import EMail
|
||||
from cpl.mail.email_model import EMail
|
||||
|
||||
|
||||
class EMailClientABC(ABC):
|
||||
"""ABC of :class:`cpl_mail.email_client_service.EMailClient`"""
|
||||
"""ABC of :class:`cpl.mail.email_client_service.EMailClient`"""
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self):
|
||||
@@ -19,6 +19,6 @@ class EMailClientABC(ABC):
|
||||
r"""Sends email
|
||||
|
||||
Parameter:
|
||||
email: :class:`cpl_mail.email.EMail`
|
||||
email: :class:`cpl.mail.email.EMail`
|
||||
Object of the E-Mail to send
|
||||
"""
|
||||
@@ -2,23 +2,23 @@ import ssl
|
||||
from smtplib import SMTP
|
||||
from typing import Optional
|
||||
|
||||
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl_core.log.logger_abc import LoggerABC
|
||||
from cpl_core.utils.credential_manager import CredentialManager
|
||||
from cpl_mail.abc.email_client_abc import EMailClientABC
|
||||
from cpl_mail.email_model import EMail
|
||||
from cpl_mail.email_client_settings import EMailClientSettings
|
||||
from cpl.core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl.core.log.logger_abc import LoggerABC
|
||||
from cpl.core.utils.credential_manager import CredentialManager
|
||||
from cpl.mail.abc.email_client_abc import EMailClientABC
|
||||
from cpl.mail.email_model import EMail
|
||||
from cpl.mail.email_client_settings import EMailClientSettings
|
||||
|
||||
|
||||
class EMailClient(EMailClientABC):
|
||||
r"""Service to send emails
|
||||
|
||||
Parameter:
|
||||
environment: :class:`cpl_core.environment.application_environment_abc.ApplicationEnvironmentABC`
|
||||
environment: :class:`cpl.core.environment.application_environment_abc.ApplicationEnvironmentABC`
|
||||
Environment of the application
|
||||
logger: :class:`cpl_core.log.logger_abc.LoggerABC`
|
||||
logger: :class:`cpl.core.log.logger_abc.LoggerABC`
|
||||
The logger to use
|
||||
mail_settings: :class:`cpl_mail.email_client_settings.EMailClientSettings`
|
||||
mail_settings: :class:`cpl.mail.email_client_settings.EMailClientSettings`
|
||||
Settings for mailing
|
||||
"""
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
from cpl.core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
|
||||
|
||||
class EMailClientSettings(ConfigurationModelABC):
|
||||
@@ -19,18 +19,9 @@ dynamic = ["dependencies", "optional-dependencies"]
|
||||
[project.urls]
|
||||
Homepage = "https://www.sh-edraft.de"
|
||||
|
||||
[tool.setuptools]
|
||||
package-dir = { "" = "." }
|
||||
include-package-data = true
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
where = ["."]
|
||||
include = ["cpl_mail*"]
|
||||
exclude = [
|
||||
"__pycache__",
|
||||
"logs",
|
||||
"tests",
|
||||
]
|
||||
include = ["cpl*"]
|
||||
|
||||
[tool.setuptools.dynamic]
|
||||
dependencies = { file = ["requirements.txt"] }
|
||||
@@ -1,5 +1,5 @@
|
||||
from .default_lambda import default_lambda
|
||||
from .ordered_queryable import OrderedQueryable
|
||||
from .sequence import Sequence
|
||||
from .ordered_queryable_abc import OrderedQueryableABC
|
||||
from .queryable_abc import QueryableABC
|
||||
from .sequence import Sequence
|
||||
@@ -1,14 +1,13 @@
|
||||
from collections.abc import Callable
|
||||
|
||||
from cpl_query.base.queryable_abc import QueryableABC
|
||||
from cpl_query.base.ordered_queryable_abc import OrderedQueryableABC
|
||||
from cpl_query.exceptions import ArgumentNoneException, ExceptionArgument
|
||||
from cpl.query.base.ordered_queryable_abc import OrderedQueryableABC
|
||||
from cpl.query.exceptions import ArgumentNoneException, ExceptionArgument
|
||||
|
||||
|
||||
class OrderedQueryable(OrderedQueryableABC):
|
||||
r"""Implementation of :class: `cpl_query.base.ordered_queryable_abc.OrderedQueryableABC`"""
|
||||
r"""Implementation of :class: `cpl.query.base.ordered_queryable_abc.OrderedQueryableABC`"""
|
||||
|
||||
def __init__(self, _t: type, _values: QueryableABC = None, _func: Callable = None):
|
||||
def __init__(self, _t: type, _values: OrderedQueryableABC = None, _func: Callable = None):
|
||||
OrderedQueryableABC.__init__(self, _t, _values, _func)
|
||||
|
||||
def then_by(self, _func: Callable) -> OrderedQueryableABC:
|
||||
@@ -4,7 +4,7 @@ from abc import abstractmethod
|
||||
from collections.abc import Callable
|
||||
from typing import Iterable
|
||||
|
||||
from cpl_query.base.queryable_abc import QueryableABC
|
||||
from cpl.query.base.queryable_abc import QueryableABC
|
||||
|
||||
|
||||
class OrderedQueryableABC(QueryableABC):
|
||||
@@ -23,7 +23,7 @@ class OrderedQueryableABC(QueryableABC):
|
||||
func: :class:`Callable`
|
||||
|
||||
Returns:
|
||||
list of :class:`cpl_query.base.ordered_queryable_abc.OrderedQueryableABC`
|
||||
list of :class:`cpl.query.base.ordered_queryable_abc.OrderedQueryableABC`
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -34,5 +34,5 @@ class OrderedQueryableABC(QueryableABC):
|
||||
func: :class:`Callable`
|
||||
|
||||
Returns:
|
||||
list of :class:`cpl_query.base.ordered_queryable_abc.OrderedQueryableABC`
|
||||
list of :class:`cpl.query.base.ordered_queryable_abc.OrderedQueryableABC`
|
||||
"""
|
||||
@@ -1,14 +1,11 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional, Callable, Union, Iterable, Any, TYPE_CHECKING
|
||||
from typing import Optional, Callable, Union, Iterable, Any
|
||||
|
||||
from cpl_query._helper import is_number
|
||||
from cpl_query.base import default_lambda
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from cpl_query.base.ordered_queryable_abc import OrderedQueryableABC
|
||||
from cpl_query.base.sequence import Sequence
|
||||
from cpl_query.exceptions import (
|
||||
from cpl.query._helper import is_number
|
||||
from cpl.query.base import default_lambda
|
||||
from cpl.query.base.sequence import Sequence
|
||||
from cpl.query.exceptions import (
|
||||
InvalidTypeException,
|
||||
ArgumentNoneException,
|
||||
ExceptionArgument,
|
||||
@@ -115,7 +112,7 @@ class QueryableABC(Sequence):
|
||||
|
||||
Returns
|
||||
-------
|
||||
:class: `cpl_query.base.queryable_abc.QueryableABC`
|
||||
:class: `cpl.query.base.queryable_abc.QueryableABC`
|
||||
"""
|
||||
if _func is None:
|
||||
_func = default_lambda
|
||||
@@ -317,7 +314,7 @@ class QueryableABC(Sequence):
|
||||
|
||||
return _func(min(self, key=_func))
|
||||
|
||||
def order_by(self, _func: Callable = None) -> OrderedQueryableABC:
|
||||
def order_by(self, _func: Callable = None) -> "OrderedQueryableABC":
|
||||
r"""Sorts elements by function in ascending order
|
||||
|
||||
Parameter
|
||||
@@ -327,12 +324,12 @@ class QueryableABC(Sequence):
|
||||
|
||||
Returns
|
||||
-------
|
||||
:class: `cpl_query.base.ordered_queryable_abc.OrderedQueryableABC`
|
||||
:class: `cpl.query.base.ordered_queryable_abc.OrderedQueryableABC`
|
||||
"""
|
||||
if _func is None:
|
||||
_func = default_lambda
|
||||
|
||||
from cpl_query.base.ordered_queryable import OrderedQueryable
|
||||
from cpl.query.base.ordered_queryable import OrderedQueryable
|
||||
|
||||
return OrderedQueryable(self.type, sorted(self, key=_func), _func)
|
||||
|
||||
@@ -346,12 +343,12 @@ class QueryableABC(Sequence):
|
||||
|
||||
Returns
|
||||
-------
|
||||
:class: `cpl_query.base.ordered_queryable_abc.OrderedQueryableABC`
|
||||
:class: `cpl.query.base.ordered_queryable_abc.OrderedQueryableABC`
|
||||
"""
|
||||
if _func is None:
|
||||
_func = default_lambda
|
||||
|
||||
from cpl_query.base.ordered_queryable import OrderedQueryable
|
||||
from cpl.query.base.ordered_queryable import OrderedQueryable
|
||||
|
||||
return OrderedQueryable(self.type, sorted(self, key=_func, reverse=True), _func)
|
||||
|
||||
@@ -360,7 +357,7 @@ class QueryableABC(Sequence):
|
||||
|
||||
Returns
|
||||
-------
|
||||
:class: `cpl_query.base.queryable_abc.QueryableABC`
|
||||
:class: `cpl.query.base.queryable_abc.QueryableABC`
|
||||
"""
|
||||
return type(self)(self._type, reversed(self._values))
|
||||
|
||||
@@ -369,7 +366,7 @@ class QueryableABC(Sequence):
|
||||
|
||||
Returns
|
||||
-------
|
||||
:class: `cpl_query.base.queryable_abc.QueryableABC`
|
||||
:class: `cpl.query.base.queryable_abc.QueryableABC`
|
||||
"""
|
||||
if _func is None:
|
||||
_func = default_lambda
|
||||
@@ -384,7 +381,7 @@ class QueryableABC(Sequence):
|
||||
|
||||
Returns
|
||||
-------
|
||||
:class: `cpl_query.base.queryable_abc.QueryableABC`
|
||||
:class: `cpl.query.base.queryable_abc.QueryableABC`
|
||||
"""
|
||||
# The line below is pain. I don't understand anything of it...
|
||||
# written on 09.11.2022 by Sven Heidemann
|
||||
@@ -433,7 +430,7 @@ class QueryableABC(Sequence):
|
||||
|
||||
Returns
|
||||
-------
|
||||
:class: `cpl_query.base.queryable_abc.QueryableABC`
|
||||
:class: `cpl.query.base.queryable_abc.QueryableABC`
|
||||
"""
|
||||
if _index is None:
|
||||
raise ArgumentNoneException(ExceptionArgument.index)
|
||||
@@ -450,7 +447,7 @@ class QueryableABC(Sequence):
|
||||
|
||||
Returns
|
||||
-------
|
||||
:class: `cpl_query.base.queryable_abc.QueryableABC`
|
||||
:class: `cpl.query.base.queryable_abc.QueryableABC`
|
||||
"""
|
||||
if _index is None:
|
||||
raise ArgumentNoneException(ExceptionArgument.index)
|
||||
@@ -493,7 +490,7 @@ class QueryableABC(Sequence):
|
||||
|
||||
Returns
|
||||
-------
|
||||
:class: `cpl_query.base.queryable_abc.QueryableABC`
|
||||
:class: `cpl.query.base.queryable_abc.QueryableABC`
|
||||
"""
|
||||
groups = []
|
||||
group = []
|
||||
@@ -525,7 +522,7 @@ class QueryableABC(Sequence):
|
||||
|
||||
Returns
|
||||
-------
|
||||
:class: `cpl_query.base.queryable_abc.QueryableABC`
|
||||
:class: `cpl.query.base.queryable_abc.QueryableABC`
|
||||
"""
|
||||
if _index is None:
|
||||
raise ArgumentNoneException(ExceptionArgument.index)
|
||||
@@ -542,7 +539,7 @@ class QueryableABC(Sequence):
|
||||
|
||||
Returns
|
||||
-------
|
||||
:class: `cpl_query.base.queryable_abc.QueryableABC`
|
||||
:class: `cpl.query.base.queryable_abc.QueryableABC`
|
||||
"""
|
||||
index = self.count() - _index
|
||||
|
||||
@@ -561,7 +558,7 @@ class QueryableABC(Sequence):
|
||||
|
||||
Returns
|
||||
-------
|
||||
:class: `cpl_query.base.queryable_abc.QueryableABC`
|
||||
:class: `cpl.query.base.queryable_abc.QueryableABC`
|
||||
"""
|
||||
if _func is None:
|
||||
raise ArgumentNoneException(ExceptionArgument.func)
|
||||
@@ -5,6 +5,10 @@ from typing import Iterable
|
||||
class Sequence(ABC):
|
||||
@abstractmethod
|
||||
def __init__(self, t: type, values: Iterable = None):
|
||||
assert t is not None
|
||||
assert isinstance(t, type) or t == any
|
||||
assert values is None or isinstance(values, Iterable)
|
||||
|
||||
if values is None:
|
||||
values = []
|
||||
|
||||
@@ -48,7 +52,7 @@ class Sequence(ABC):
|
||||
raise Exception(f"Unexpected type: {type(__object)}\nExpected type: {self._type}")
|
||||
|
||||
def to_list(self) -> list:
|
||||
r"""Converts :class: `cpl_query.base.sequence_abc.SequenceABC` to :class: `list`
|
||||
r"""Converts :class: `cpl.query.base.sequence_abc.SequenceABC` to :class: `list`
|
||||
|
||||
Returns:
|
||||
:class: `list`
|
||||
@@ -1,4 +1,4 @@
|
||||
from cpl_query.enumerable.enumerable_abc import EnumerableABC
|
||||
from cpl.query.enumerable.enumerable_abc import EnumerableABC
|
||||
|
||||
|
||||
def _default_lambda(x: object):
|
||||
@@ -6,7 +6,7 @@ def _default_lambda(x: object):
|
||||
|
||||
|
||||
class Enumerable(EnumerableABC):
|
||||
r"""Implementation of :class: `cpl_query.enumerable.enumerable_abc.EnumerableABC`"""
|
||||
r"""Implementation of :class: `cpl.query.enumerable.enumerable_abc.EnumerableABC`"""
|
||||
|
||||
def __init__(self, t: type = None, values: list = None):
|
||||
EnumerableABC.__init__(self, t, values)
|
||||
@@ -1,6 +1,6 @@
|
||||
from abc import abstractmethod
|
||||
|
||||
from cpl_query.base.queryable_abc import QueryableABC
|
||||
from cpl.query.base.queryable_abc import QueryableABC
|
||||
|
||||
|
||||
class EnumerableABC(QueryableABC):
|
||||
@@ -11,11 +11,11 @@ class EnumerableABC(QueryableABC):
|
||||
QueryableABC.__init__(self, t, values)
|
||||
|
||||
def to_iterable(self) -> "IterableABC":
|
||||
r"""Converts :class: `cpl_query.enumerable.enumerable_abc.EnumerableABC` to :class: `cpl_query.iterable.iterable_abc.IterableABC`
|
||||
r"""Converts :class: `cpl.query.enumerable.enumerable_abc.EnumerableABC` to :class: `cpl.query.iterable.iterable_abc.IterableABC`
|
||||
|
||||
Returns:
|
||||
:class: `cpl_query.iterable.iterable_abc.IterableABC`
|
||||
:class: `cpl.query.iterable.iterable_abc.IterableABC`
|
||||
"""
|
||||
from cpl_query.iterable.iterable import Iterable
|
||||
from cpl.query.iterable.iterable import Iterable
|
||||
|
||||
return Iterable(self._type, self.to_list())
|
||||
36
src/cpl-query/cpl/query/extension/list.py
Normal file
36
src/cpl-query/cpl/query/extension/list.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from cpl.query.enumerable.enumerable_abc import EnumerableABC
|
||||
from cpl.query.iterable.iterable import Iterable
|
||||
|
||||
|
||||
class List(Iterable):
|
||||
r"""Implementation of :class: `cpl.query.extension.iterable.Iterable`"""
|
||||
|
||||
def __init__(self, t: type = None, values: Iterable = None):
|
||||
Iterable.__init__(self, t, values)
|
||||
|
||||
def __getitem__(self, *args):
|
||||
return self._values.__getitem__(*args)
|
||||
|
||||
def __setitem__(self, *args):
|
||||
self._values.__setitem__(*args)
|
||||
|
||||
def __delitem__(self, *args):
|
||||
self._values.__delitem__(*args)
|
||||
|
||||
def to_enumerable(self) -> EnumerableABC:
|
||||
r"""Converts :class: `cpl.query.iterable.iterable_abc.IterableABC` to :class: `cpl.query.enumerable.enumerable_abc.EnumerableABC`
|
||||
|
||||
Returns:
|
||||
:class: `cpl.query.enumerable.enumerable_abc.EnumerableABC`
|
||||
"""
|
||||
from cpl.query.enumerable.enumerable import Enumerable
|
||||
|
||||
return Enumerable(self._type, self.to_list())
|
||||
|
||||
def to_iterable(self) -> Iterable:
|
||||
r"""Converts :class: `cpl.query.enumerable.enumerable_abc.EnumerableABC` to :class: `cpl.query.iterable.iterable_abc.IterableABC`
|
||||
|
||||
Returns:
|
||||
:class: `cpl.query.iterable.iterable_abc.IterableABC`
|
||||
"""
|
||||
return Iterable(self._type, self.to_list())
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user