httk.web.model

Submodules

Exceptions

FunctionInjectionError

Common base class for all non-exit exceptions.

NotFoundError

Common base class for all non-exit exceptions.

WebError

Common base class for all non-exit exceptions.

Classes

Package Contents

class httk.web.model.SiteConfig[source]
srcdir: pathlib.Path
content_subdir: str = 'content'
static_subdir: str = 'static'
template_subdir: str = 'templates'
functions_subdir: str = 'functions'
baseurl: str | None = None
host_static: str | None = None
compatibility_mode: bool = False
config_name: str = 'config'
publish_use_urls_without_ext: bool = True
classmethod from_srcdir(srcdir: str | pathlib.Path, *, baseurl: str | None = None, host_static: str | None = None, compatibility_mode: bool = False, config_name: str = 'config', publish_use_urls_without_ext: bool = True) Self[source]
property content_dir: pathlib.Path
property static_dir: pathlib.Path
property template_dir: pathlib.Path
property functions_dir: pathlib.Path
exception httk.web.model.FunctionInjectionError(message: str)[source]

Bases: WebError

Common base class for all non-exit exceptions.

exception httk.web.model.NotFoundError(message: str = 'Not Found')[source]

Bases: WebError

Common base class for all non-exit exceptions.

exception httk.web.model.WebError(message: str, *, status_code: int = 500)[source]

Bases: Exception

Common base class for all non-exit exceptions.

status_code = 500
class httk.web.model.PageResult[source]
status_code: int
content_type: str
body: bytes
metadata: dict[str, object]
warnings: list[str] = []
class httk.web.model.PublishReport[source]
written_files: list[pathlib.Path] = []
warnings: list[str] = []
class httk.web.model.ResolvedRoute[source]
kind: Literal['static', 'content', 'missing']
route: str
source_path: pathlib.Path | None = None
class httk.web.model.HttpRequestContext[source]
method: str = 'GET'
query: dict[str, str]
postvars: dict[str, str]
headers: dict[str, str]