# Path: shpkpr/exceptions.py
# class ShpkprException(ClickException):
# def _args_from_exception(exception):
# def rewrap(exceptions_to_catch, exception_to_rewrap_with=ShpkprException):
#     def real_decorator(function):
#         def wrapper(*args, **kwargs):
# 
# Path: shpkpr/template_filters.py
# def filter_items(value, startswith=None, strip_prefix=False):
# def require_int(value, min=None, max=None):
# def require_float(value, min=None, max=None):
# def slugify(value, *args, **kwargs):
# class IntegerRequired(exceptions.ShpkprException):
# class IntegerTooSmall(exceptions.ShpkprException):
# class IntegerTooLarge(exceptions.ShpkprException):
# class FloatRequired(exceptions.ShpkprException):
# class FloatTooSmall(exceptions.ShpkprException):
# class FloatTooLarge(exceptions.ShpkprException):


import json
import os
import jinja2
from shpkpr import exceptions
from shpkpr import template_filters
    The template, once rendered is treated as JSON and converted into a python
    dictionary. If the template is not valid JSON after rendering then an
    exception will be raised.

    If a template defines a placeholder for a variable that is not included in
    `values` an `UndefinedError` will be raised.

    ``template_path`` should be the base directory in which your templates are
    stored.
    ``template_name`` is the name (path) of the template being used to render.
    ``values`` should be regular keyword arguments to the function which will
    be passed to the template at render time.
    """
    # shpkpr ships with a number of built-in templates for each deployment type,
    # so we need to tell jinja where to look for them
    here = os.path.dirname(os.path.abspath(__file__))
    built_in_template_path = os.path.join(here, "resources", "templates")

    # build a new Jinja2 environment so we can inject some custom filters into
    # the template we're rendering.
    template_env = jinja2.Environment(
        undefined=jinja2.StrictUndefined,
        loader=jinja2.FileSystemLoader([
            built_in_template_path,
            template_path,
        ]),
    )
    template_env.filters['filter_items'] = template_filters.filter_items
    template_env.filters['require_int'] = template_filters.require_int
    template_env.filters['require_float'] = template_filters.require_float

# Path: shpkpr/exceptions.py
# class ShpkprException(ClickException):
# def _args_from_exception(exception):
# def rewrap(exceptions_to_catch, exception_to_rewrap_with=ShpkprException):
#     def real_decorator(function):
#         def wrapper(*args, **kwargs):
# 
# Path: shpkpr/template_filters.py
# def filter_items(value, startswith=None, strip_prefix=False):
# def require_int(value, min=None, max=None):
# def require_float(value, min=None, max=None):
# def slugify(value, *args, **kwargs):
# class IntegerRequired(exceptions.ShpkprException):
# class IntegerTooSmall(exceptions.ShpkprException):
# class IntegerTooLarge(exceptions.ShpkprException):
# class FloatRequired(exceptions.ShpkprException):
# class FloatTooSmall(exceptions.ShpkprException):
# class FloatTooLarge(exceptions.ShpkprException):


# Path: shpkpr/template.py
import json
import os
import jinja2
from shpkpr import exceptions
from shpkpr import template_filters

    The template, once rendered is treated as JSON and converted into a python
    dictionary. If the template is not valid JSON after rendering then an
    exception will be raised.

    If a template defines a placeholder for a variable that is not included in
    `values` an `UndefinedError` will be raised.

    ``template_path`` should be the base directory in which your templates are
    stored.
    ``template_name`` is the name (path) of the template being used to render.
    ``values`` should be regular keyword arguments to the function which will
    be passed to the template at render time.
    """
    # shpkpr ships with a number of built-in templates for each deployment type,
    # so we need to tell jinja where to look for them
    here = os.path.dirname(os.path.abspath(__file__))
    built_in_template_path = os.path.join(here, "resources", "templates")

    # build a new Jinja2 environment so we can inject some custom filters into
    # the template we're rendering.
    template_env = jinja2.Environment(
        undefined=jinja2.StrictUndefined,
        loader=jinja2.FileSystemLoader([
            built_in_template_path,
            template_path,
        ]),
    )
    template_env.filters['filter_items'] = template_filters.filter_items
    template_env.filters['require_int'] = template_filters.require_int
    template_env.filters['require_float'] = template_filters.require_float

    template_env.filters['slugify'] = template_filters.slugify