iota2.configuration_files.sections.cfg_utils

Definition of classes for configuration parameters

Functions

dataclass([cls, init, repr, eq, order, ...])

Add dunder methods based on the fields defined in the class.

Classes

Any(*args, **kwargs)

Special type indicating an unconstrained type.

FileParameter

https://field-idempotency--pydantic-docs.netlify.app/usage/types/#custom-data-types

Generator()

Iota2ParamSection(*args, **kwargs)

Iota2 parameter section base class.

Path(*args, **kwargs)

PurePath subclass that can make system calls.

PathParameter

https://field-idempotency--pydantic-docs.netlify.app/usage/types/#custom-data-types

TermColors()

Definition of colors for terminal output

Exceptions

ConfigError(msg[, blinking])

Throws exceptions related to i2 config file.

ConfigNotRecognisedParamWarning(msg)

Print warnings.

ConfigParamWarning(msg)

Print warnings.

exception iota2.configuration_files.sections.cfg_utils.ConfigError(msg, blinking=False)[source]

Throws exceptions related to i2 config file.

__init__(msg, blinking=False)[source]
exception iota2.configuration_files.sections.cfg_utils.ConfigNotRecognisedParamWarning(msg)[source]

Print warnings.

__init__(msg)[source]
exception iota2.configuration_files.sections.cfg_utils.ConfigParamWarning(msg)[source]

Print warnings.

__init__(msg)[source]
class iota2.configuration_files.sections.cfg_utils.FileParameter[source]

https://field-idempotency–pydantic-docs.netlify.app/usage/types/#custom-data-types

classmethod validate(value, field)[source]

Check if the value is a string and if the file exists.

Return type:

str

class iota2.configuration_files.sections.cfg_utils.Iota2ParamSection(*args, **kwargs)[source]

Iota2 parameter section base class.

It ensures: - unrecognized fields (print a warning) - deactivate non-mandatory parameters (regarding builders)

class Config[source]
classmethod add_fields(**field_definitions)[source]

Add fields to an existing BaseModel.

Tribute to https://github.com/samuelcolvin/pydantic/issues/1937 :rtype: None

Note

If the field already exists, it will be overwritten

deactivate_fields()

Deactivate non-mandatory parameters (regarding builders).

dict(**kwargs)[source]

Hide the builders section.

Return type:

dict

unrecognized_fields()

Check if the user supplied parameter is known by iota2. If it is not, a warning is displayed.

class iota2.configuration_files.sections.cfg_utils.PathParameter[source]

https://field-idempotency–pydantic-docs.netlify.app/usage/types/#custom-data-types

classmethod validate(value, field)[source]

Check if the value is a string and if the path exists.

Return type:

str

class iota2.configuration_files.sections.cfg_utils.TermColors[source]

Definition of colors for terminal output

BOLD = '\x1b[1m'
ENDC = '\x1b[0m'
FAIL = '\x1b[91m'
HEADER = '\x1b[95m'
OKBLUE = '\x1b[94m'
OKCYAN = '\x1b[96m'
OKGREEN = '\x1b[92m'
UNDERLINE = '\x1b[4m'
WARNING = '\x1b[93m'
__init__()