geomancy.checks.Check#
- class geomancy.checks.Check(name: str, value: str | None = None, desc: str = '', children: list[geomancy.checks.base.Check] | None = None, **kwargs)#
Check base class and tree structure.
Changed in version 1.0.0: Rewrite and implemented threading using concurrent.futures.
Changed in version 0.9.3: Switch to
environment.sub_env()for value substitutions, which require a ‘$’ character and allow different expansion rules like defaults, errors and replacements.- __init__(name: str, value: str | None = None, desc: str = '', children: list[geomancy.checks.base.Check] | None = None, **kwargs)#
Methods
__init__(name[, value, desc, children])check([executor, level])Performs this check and the children checks.
condition()Return True if bool(x) is True for all values x in the iterable.
import_modules(*names)Import and return modules given by the module name(s).
load(d, name[, level, max_level])Load checks from a dict.
types()The available types of Check classes, including aliases.
Attributes
aliasesAlternative names for the class (used by
types())availableWhether this check class is available for use.
condition_aliasesAlternative parameter names (__init__ kwarg names) used to specify the condition
countThe number of children, sub-children, etc, including self
descDescription of the check
env_substitute_aliasesAlternative parameter names (__init__ kwarg names) for env_substitute
env_substitute_defaultThe default value for env_substitute
flattenReturn a flattened list of this check (first item) and children checks
h1_styleDefault message and style of h1 headers
h2_styleDefault message and style of h2 headers
h3_styleDefault message and style of h3 headers
h4_styleDefault message and style of h4 headers
h5_styleDefault message and style of h5 headers
h6_styleDefault message and style of h6 headers (and lower)
import_error_msgThe import_module() exception message to use if a module is missing (see the
import_modules())max_levelMaximum recursion depth of the load function
msgThe default message to include in results
valueCheck's value with optional environment substitution
nameThe name for the check
raw_valueUnprocessed value for the check
childrenA list of children checks
env_substituteSubstitute environment variables in check values