Files
stapler/src/page.py
T
2026-04-20 11:36:56 +02:00

21 lines
514 B
Python

import dataclasses
@dataclasses.dataclass(slots=True)
class Page:
path: str
with_index: bool = False
host: str | None = None
token_hash: str | None = None
redirect: str | None = None
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 not self.with_index:
out += " (no index)"
return out