30 lines
803 B
Python
30 lines
803 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
|
|
|
|
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
|