cpl_core.configuration
cpl_core.configuration.configuration
- class cpl_core.configuration.configuration.Configuration
Bases:
cpl_core.configuration.configuration_abc.ConfigurationABC
- add_configuration(key_type: Union[str, type], value: cpl_core.configuration.configuration_model_abc.ConfigurationModelABC)
Add configuration object
- key_type: Union[
str
,type
] Type of the value
- value: Union[
str
,cpl_core.configuration.configuration_model_abc.ConfigurationModelABC
] Object of the value
- key_type: Union[
- add_console_argument(argument: cpl_core.configuration.console_argument.ConsoleArgument)
Adds console argument to known console arguments
- argument:
cpl_core.configuration.console_argument.ConsoleArgument
Specifies the console argument
- argument:
- add_console_arguments(error: Optional[bool] = None)
Reads the console arguments
- error:
bool
Defines is invalid argument error will be shown or not
- error:
- add_environment_variables(prefix: str)
Reads the environment variables
- prefix:
str
Prefix of the variables
- prefix:
- add_json_file(name: str, optional: Optional[bool] = None, output: bool = True, path: Optional[str] = None)
Reads and saves settings from given json file
- name:
str
Name of the file
- optional:
str
Specifies whether an error should occur if the file was not found
- output:
bool
Specifies whether an output should take place
- path:
str
Path in which the file should be stored
- name:
- property additional_arguments: list[str]
- property argument_error_function: Optional[collections.abc.Callable]
- property environment: cpl_core.environment.application_environment_abc.ApplicationEnvironmentABC
- get_configuration(search_type: Union[str, Type[cpl_core.configuration.configuration_model_abc.ConfigurationModelABC]]) Union[str, collections.abc.Callable[cpl_core.configuration.configuration_model_abc.ConfigurationModelABC]]
Returns value from configuration by given type
- search_type: Union[
str
, Type[cpl_core.configuration.configuration_model_abc.ConfigurationModelABC
]] Type to search for
Object of Union[
str
, Callable[cpl_core.configuration.configuration_model_abc.ConfigurationModelABC
]]- search_type: Union[
cpl_core.configuration.configuration_abc
- class cpl_core.configuration.configuration_abc.ConfigurationABC
Bases:
abc.ABC
- abstract add_configuration(key_type: Union[str, type], value: Union[str, cpl_core.configuration.configuration_model_abc.ConfigurationModelABC])
Add configuration object
- key_type: Union[
str
,type
] Type of the value
- value: Union[
str
,cpl_core.configuration.configuration_model_abc.ConfigurationModelABC
] Object of the value
- key_type: Union[
- abstract add_console_argument(argument: cpl_core.configuration.console_argument.ConsoleArgument)
Adds console argument to known console arguments
- argument:
cpl_core.configuration.console_argument.ConsoleArgument
Specifies the console argument
- argument:
- abstract add_console_arguments(error: Optional[bool] = None)
Reads the console arguments
- error:
bool
Defines is invalid argument error will be shown or not
- error:
- abstract add_environment_variables(prefix: str)
Reads the environment variables
- prefix:
str
Prefix of the variables
- prefix:
- abstract add_json_file(name: str, optional: Optional[bool] = None, output: bool = True, path: Optional[str] = None)
Reads and saves settings from given json file
- name:
str
Name of the file
- optional:
str
Specifies whether an error should occur if the file was not found
- output:
bool
Specifies whether an output should take place
- path:
str
Path in which the file should be stored
- name:
- abstract property additional_arguments: list[str]
- abstract property argument_error_function: Optional[collections.abc.Callable]
- abstract property environment: cpl_core.environment.application_environment_abc.ApplicationEnvironmentABC
- abstract get_configuration(search_type: Union[str, Type[cpl_core.configuration.configuration_model_abc.ConfigurationModelABC]]) Union[str, collections.abc.Callable[cpl_core.configuration.configuration_model_abc.ConfigurationModelABC]]
Returns value from configuration by given type
- search_type: Union[
str
, Type[cpl_core.configuration.configuration_model_abc.ConfigurationModelABC
]] Type to search for
Object of Union[
str
, Callable[cpl_core.configuration.configuration_model_abc.ConfigurationModelABC
]]- search_type: Union[
cpl_core.configuration.configuration_model_abc
cpl_core.configuration.configuration_variable_name_enum
cpl_core.configuration.console_argument
- class cpl_core.configuration.console_argument.ConsoleArgument(token: str, name: str, aliases: list[str], value_token: str, is_value_token_optional: Optional[bool] = None, console_arguments: Optional[list['ConsoleArgument']] = None)
Bases:
object
- property aliases: list[str]
- property console_arguments: list['ConsoleArgument']
- property is_value_token_optional: bool
- property name: str
- property token: str
- property value_token: str