progfiguration.progfigsite_validator#

Validate progfigsite modules

Progfigsite modules must follow a certain API. This module validates compliance.

Module Contents#

Classes#

ProgfigsiteProperty

A property of a progfigsite module.

ValidationResult

The result of validating a module

Functions#

validate(→ ValidationResult)

Validate a progfigsite module

class progfiguration.progfigsite_validator.ProgfigsiteProperty#

A property of a progfigsite module.

property errstr: str#

A string describing the error

submodule: str#

The name of the submodule that the attribute is in.

An empty string for the root module.

attribute: str#

The string name of the attribute in the module to check for.

If this is empty, we just check if the module exists.

type: Any#

The type of the attribute.

required: bool = True#

Whether the attribute is required.

class progfiguration.progfigsite_validator.ValidationResult(path: str)#

The result of validating a module

property is_valid: bool#

True if the module is valid, False otherwise

valid_properties#

A list of attributes that a progfigsite module must have

path#

The path to the module (must already be present in Python module path)

errors: List[ProgfigsiteProperty] = []#

A list of errors that were found

progfiguration.progfigsite_validator.validate(module_path: str) ValidationResult#

Validate a progfigsite module

Return a ValidationResult object.