starcluster.templates

Package starcluster :: Package templates |
[hide private]
[frames] | no frames]

# Source Code for Package starcluster.templates

     1  #!/usr/bin/env python
     2  import jinja2
     3  import pkg_resources
     4
     5  __all__ = [
     6      'config',
     7      'sge',
     8      'user_msgs',
     9  ]
    10
    11  loader = jinja2.Environment(loader=jinja2.PrefixLoader({
    12      'web': jinja2.PackageLoader('starcluster.templates', 'web'),
    13  }))
    14
    15  get_template = loader.get_template
    16
    17
    18 -def get_resource(pkg_data_path, stream=True):
    19      pkg_res_meth = pkg_resources.resource_filename
    20      if stream:
    21          pkg_res_meth = pkg_resources.resource_stream
    22      return pkg_res_meth('starcluster.templates', pkg_data_path)
    23
    24
    25  TemplateNotFound = jinja2.TemplateNotFound
    26