server.collection

Module Contents

Classes

CachedApplication

Wraps an application class with a configuration, returning a new

ApplicationCollection

Keeps a list of applications and their roots.

class server.collection.CachedApplication(application_class: type[server.application.Application], namespace: str, configuration: dict[str, Any] | None = None)[source]

Wraps an application class with a configuration, returning a new instance the first time get() is called and the same instance very time after that.

instance: Application | None[source]
get() server.application.Application[source]
class server.collection.ApplicationCollection(applications: Iterable[ApplicationConfig] | None = None)[source]

Keeps a list of applications and their roots.

The applications are registered lazily and only instantiated/configured once the get() is called.

applications: dict[str, CachedApplication][source]
register(root: str, application_class: type[server.application.Application], namespace: str, configuration: dict[str, Any] | None = None) None[source]

Registers the given path for the given application_class and configuration.

get(root: str) Application | None[source]

Returns the applicaton for the given path, creating a new instance if none exists already.

morepath_applications() Iterator[CachedApplication][source]

Iterates through the applications that depend on morepath.