Files
stapler/stapler/page.py
T
klemek 2bc2593bc9
Python Lint CI / ruff (push) Successful in 1m0s
Python Lint CI / ty (push) Successful in 1m0s
Python Lint CI / ruff-format-check (push) Successful in 1m0s
Docker CI / docker-build (push) Has been cancelled
Python Test CI / coverage (push) Has been cancelled
fix(registry): race condition handled with page 'ready'
2026-06-02 23:36:35 +02:00

31 lines
826 B
Python

import dataclasses
@dataclasses.dataclass(slots=True)
class Page:
path: str
with_index: bool = False
host: str | None = None
host_only: bool = False
token_hash: str | None = None
redirect: str | None = None
proxy: str | None = None
spa: str | None = None
ready: bool = True
def __repr__(self) -> str:
out = f"/{self.path}/"
if self.host is not None:
out += f" [{self.host}]"
if self.redirect is not None:
out += f" (redirect: {self.redirect})"
elif self.proxy is not None:
out += f" (proxy: {self.proxy})"
elif not self.with_index:
out += " (no index)"
if self.host_only:
out += " (host only)"
if self.spa:
out += f" (spa: {self.spa})"
return out