gui.model.CheckResult

gui.model.CheckResult(findings, seconds, finished)

The outcome of spotregen check on a loaded spec.

Attributes

Name Type Description
findings tuple[Finding, …] The findings, errors first.
seconds float How long the checks took.
finished datetime When they finished.

Examples

from pathlib import Path
from tempfile import TemporaryDirectory

from spotregen import make_sample_repo
from spotregen.gui.model import load_repository, run_check

with TemporaryDirectory() as tmp:
    result = run_check(load_repository(make_sample_repo(Path(tmp) / "demo")).spec)
    print(len(result.findings), result.exit_code())
0 0

Methods

Name Description
exit_code The exit code spotregen check would return.
summary The summary line spotregen check prints.

exit_code

gui.model.CheckResult.exit_code(strict=False)

The exit code spotregen check would return.

Parameters

Name Type Description Default
strict bool Whether warnings fail the check as well. False

Returns

Name Type Description
int int 0 or 1.

summary

gui.model.CheckResult.summary(spec)

The summary line spotregen check prints.

Parameters

Name Type Description Default
spec RegenSpec The spec that was checked. required

Returns

Name Type Description
str str regen check: N units, E errors, W warnings.