httk.serve.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.

WidgetDiscoveryError

Base error for a widget invocation with source-aware diagnostics.

WidgetError

Base error for a widget invocation with source-aware diagnostics.

WidgetParseError

Base error for a widget invocation with source-aware diagnostics.

WidgetRenderingError

Base error for a widget invocation with source-aware diagnostics.

WidgetValidationError

Base error for a widget invocation with source-aware diagnostics.

Classes

Package Contents

class httk.serve.web.model.SiteConfig[source]
srcdir: pathlib.Path
content_subdir: str = 'content'
static_subdir: str = 'static'
template_subdir: str = 'templates'
functions_subdir: str = 'functions'
widgets_subdir: str = 'widgets'
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
property widgets_dir: pathlib.Path
exception httk.serve.web.model.FunctionInjectionError(message: str)[source]

Bases: WebError

Common base class for all non-exit exceptions.

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

Bases: WebError

Common base class for all non-exit exceptions.

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

Bases: Exception

Common base class for all non-exit exceptions.

status_code = 500
exception httk.serve.web.model.WidgetDiscoveryError(message: str, *, source_path: object | None = None, line: int | None = None, column: int | None = None, snippet: str | None = None, widget_name: str | None = None, widget_id: str | None = None, correction: str | None = None)[source]

Bases: WidgetError

Base error for a widget invocation with source-aware diagnostics.

phase = 'discovery'
exception httk.serve.web.model.WidgetError(message: str, *, source_path: object | None = None, line: int | None = None, column: int | None = None, snippet: str | None = None, widget_name: str | None = None, widget_id: str | None = None, correction: str | None = None)[source]

Bases: WebError

Base error for a widget invocation with source-aware diagnostics.

phase = 'widget'
exception httk.serve.web.model.WidgetParseError(message: str, *, source_path: object | None = None, line: int | None = None, column: int | None = None, snippet: str | None = None, widget_name: str | None = None, widget_id: str | None = None, correction: str | None = None)[source]

Bases: WidgetError

Base error for a widget invocation with source-aware diagnostics.

phase = 'parse'
exception httk.serve.web.model.WidgetRenderingError(message: str, *, source_path: object | None = None, line: int | None = None, column: int | None = None, snippet: str | None = None, widget_name: str | None = None, widget_id: str | None = None, correction: str | None = None)[source]

Bases: WidgetError

Base error for a widget invocation with source-aware diagnostics.

phase = 'rendering'
exception httk.serve.web.model.WidgetValidationError(message: str, *, source_path: object | None = None, line: int | None = None, column: int | None = None, snippet: str | None = None, widget_name: str | None = None, widget_id: str | None = None, correction: str | None = None)[source]

Bases: WidgetError

Base error for a widget invocation with source-aware diagnostics.

phase = 'validation'
class httk.serve.web.model.PageResult[source]
status_code: int
content_type: str
body: bytes
metadata: dict[str, object]
warnings: list[str] = []
assets: tuple[httk.serve.web.widgets.core.WidgetAsset, Ellipsis] = ()
class httk.serve.web.model.PublishReport[source]
written_files: list[pathlib.Path] = []
warnings: list[str] = []
class httk.serve.web.model.ResolvedRoute[source]
kind: Literal['static', 'content', 'missing']
route: str
source_path: pathlib.Path | None = None
class httk.serve.web.model.HttpRequestContext[source]
method: str = 'GET'
query: dict[str, str]
postvars: dict[str, str]
headers: dict[str, str]