seq  1.1.0
 All Classes Namespaces Files Functions Variables Groups Pages
Public Member Functions | Static Public Attributes | List of all members
etr.plugins.jinja2.Plugin Class Reference

Jinja2 plugin. More...

Public Member Functions

def __init__
 
def setup
 Render template files. More...
 
def teardown
 Delete files generated during setup(). More...
 

Static Public Attributes

string config_schema
 
int order = 1000
 
dictionary utils_ctx = {"get_random_port": get_random_port}
 

Detailed Description

Jinja2 plugin.

Configuration schema:

jinja2:
    files:
        # Files are relative etr working directory
        "foo/bar.j2" : "foo/bar.config"

        # Environment expansion also works.
        "baz.j2.yaml" : "$DATAROOT/config/baz.yaml"

Constructor & Destructor Documentation

def etr.plugins.jinja2.Plugin.__init__ (   self,
  ctx 
)

Member Function Documentation

def etr.plugins.jinja2.Plugin.setup (   self,
  ctx 
)

Render template files.

def etr.plugins.jinja2.Plugin.teardown (   self,
  ctx 
)

Delete files generated during setup().

The cleanup is oppertunistic and failures are logged but otherwise ignored to avoid cancelling any other pending plugin teardowns.

Member Data Documentation

string etr.plugins.jinja2.Plugin.config_schema
static
Initial value:
1 = """
2 type: object
3 properties:
4  files:
5  type: object
6  additionalProperties:
7  type: string
8 """
int etr.plugins.jinja2.Plugin.order = 1000
static
dictionary etr.plugins.jinja2.Plugin.utils_ctx = {"get_random_port": get_random_port}
static

The documentation for this class was generated from the following file: