Completed
Pull Request — master (#630)
by
unknown
56s
created

cookiecutter.StrictEnvironment   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %
Metric Value
wmc 1
dl 0
loc 9
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __init__() 0 5 1
1
# -*- coding: utf-8 -*-
2
3
from jinja2 import Environment, StrictUndefined
4
5
6
class StrictEnvironment(Environment):
7
    """Jinja2 environment that raises an error when it hits a variable
8
    which is not defined in the context used to render a template.
9
    """
10
    def __init__(self, **kwargs):
11
        super(StrictEnvironment, self).__init__(
12
            undefined=StrictUndefined,
13
            extensions=['jinja2_time.TimeExtension'],
14
            **kwargs
15
        )
16