3.7. sciexp2.expdef.templates

Source: sciexp2/expdef/templates.py

Common functionality for launcher templates.

Two files can be provided for each template:

  • template-name.tpl

    The template itself.

    This is the file that will be produced (through translation).

  • template-name.dsc

    The template descriptor.

    Contains a predefined set of attributes (see Template).

    The use of the parent attribute is encouraged to write template refinements, so that instead of writing new .dsc and .tpl files you can simply write a single .dsc and declare its parent. Then, any attribute in the .dsc file (other than the set of predefined attributes) will be used to refine the variables of the parent template.

The templates are searched for in the paths listed in SEARCH_PATH, where you can add new directories if necessary.

SEARCH_PATH = ['.', '/home/docs/checkouts/readthedocs.org/user_builds/sciexp2-expdef/checkouts/stable/sciexp2/expdef/templates']

Paths to search for available templates.

The order of the list establishes which template will be used in case it exists in more than one directory.

Includes the current directory and the templates directory shipped with SciExp².

Functions

get

Get a Template object by name.

get_description

Get a short description of all available templates.

Classes

Template

A launcher template.

Exceptions

TemplateError

Error retrieving template file.

3.7.2. get

get(name)

Get a Template object by name.

3.7.3. get_description

get_description()

Get a short description of all available templates.