validation#

@author: ☙ Ryan McConnell ❧

class grave_settings.validation.ValidationReport(settings: MutableMapping, settings_key: str, name: str, description: str, long_description: str, fixes: list[Callable[[MutableMapping, str], bool]] | None = None)[source]#

Bases: object

Parameters:
settings: MutableMapping#
settings_key: str#
name: str#
description: str#
long_description: str#
fixes: list[Callable[[MutableMapping, str], bool]] | None#
class grave_settings.validation.Validation(key)[source]#

Bases: object

Parameters:

key (str) –

validate(settings, settings_key)[source]#
Parameters:
Return type:

ValidationReport | None

make_validation_report(*args)[source]#
class grave_settings.validation.ValidationCapsule(key)[source]#

Bases: Validation

Parameters:

key (str) –

make_validation_report#

alias of ValidationReport

class grave_settings.validation.NotNoneValidation(key)[source]#

Bases: Validation

Parameters:

key (str) –

validate(settings, settings_key)[source]#
Parameters:
Return type:

ValidationReport | None

class grave_settings.validation.TypeCheckValidation(key, _type)[source]#

Bases: Validation

Parameters:
validate(settings, settings_key)[source]#
Parameters:
Return type:

ValidationReport | None

class grave_settings.validation.SettingsValidator(settings)[source]#

Bases: object

Parameters:

settings (MutableMapping) –

create_validation(name, validation_function, v_t=<class 'grave_settings.validation.Validation'>)[source]#
Parameters:
create_validations(validations, v_t=<class 'grave_settings.validation.Validation'>)[source]#
Parameters:
add_validation(validation)[source]#
Parameters:

validation (Validation) –

add_validations(validations)[source]#
Parameters:

validations (Iterable[Validation]) –

get_validation_issues()[source]#
Return type:

dict