OCDocker.Workbench.Web module

Browser assets

The strict OCScore dashboard UI is shipped as static files under OCDocker/Workbench/static/:

  • index.html served at /app

  • app.css served at /app.css

  • app.js served at /app.js

build_workbench_web_asset() reads those files from disk at request time. The files are included in the wheel/sdist through pyproject.toml package data for OCDocker.Workbench. Brand images are served from repository or package asset paths when present:

  • /app-favicon.png

  • /app-brand-logo.png

API

Packaged browser assets for the strict OCScore Workbench dashboard.

OCDocker.Workbench.Web.build_workbench_web_asset(path)[source]

Load one packaged Workbench browser asset.

Parameters:

path (str) – Request path.

Returns:

Content type and response body.

Return type:

tuple[str, bytes]

Raises:
  • KeyError – If the request path is not a known Workbench web asset route.

  • FileNotFoundError – If a packaged static asset is missing from the installed package tree.

OCDocker.Workbench.Web.is_workbench_web_asset_path(path)[source]

Return whether a path is served by packaged Workbench web assets.

Parameters:

path (str) – Request path.

Returns:

True when the path is a packaged web asset route.

Return type:

bool