asphalt.templating.component

class asphalt.templating.component.TemplatingComponent(backend, resource_name='default', options=None)

Creates a template renderer resource.

The renderer resource will be available in the context as the following types:

Parameters:
  • backend – the name of the renderer backend

  • resource_name – the name of the renderer resource

  • options – a dictionary of keyword arguments passed to the template renderer backend class

async start(ctx)

Perform any necessary tasks to start the services provided by this component.

In this method, components typically use the context to:

It is advisable for Components to first add all the resources they can to the context before requesting any from it. This will speed up the dependency resolution and prevent deadlocks.

Parameters:

ctx (Context) – the containing context for this component