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
| 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
| str |
str |
The address of the start page. |
Raises
|
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))