Skip to main content

ui.check

ui.check(root, port=None)

Load the configuration of the project at root and return the address.

Nothing is served and nothing is written. The address has no token.

Parameters

Name Type Description Default
root Path The project root, inside a git repository. required
port int | None The port; None takes the one in machine.toml or the default. None

Returns

Name Type Description
str str The address of the start page.

Raises

Name Type Description
ConfigurationError If root is not in a git repository, or regen/ui.toml or machine.toml does not load.

Examples

import subprocess
from pathlib import Path
from tempfile import TemporaryDirectory

from babregen import make_sample_repo
from babregen.ui import check

with TemporaryDirectory() as tmp:
    root = make_sample_repo(Path(tmp) / "demo")
    subprocess.run(["git", "init", "-q"], cwd=root, check=True)
    print(check(root))
http://127.0.0.1:8765/