kerno.utility_registry module

A registry to store various utilities in an application.

exception kerno.utility_registry.ConfigurationError[source]

Bases: Exception

Represents an error during application startup.

class kerno.utility_registry.UtilityRegistryBuilder(kerno: kerno.kerno.Kerno)[source]

Bases: object

Gradually builds Kerno’s utility registry, which is immutable.

ensure(name: str, component: str = 'The application') None[source]

Raise if no utility has been registered under name.

register(name: str, utility: Any) Any[source]

Register utility under name at startup for later use.

set_default(name: str, utility: Any) Any[source]

Register utility as name only if name not yet registered.