Commit f9db590e authored by Julien Muchembled's avatar Julien Muchembled

jinja2: new assert function

parent 964d0f7c
2.8 (2015-06-25)
================
* jinja2: new assert function.
2.7 (2015-05-18) 2.7 (2015-05-18)
================ ================
......
from setuptools import setup, find_packages from setuptools import setup, find_packages
import os import os
version = '2.7' version = '2.8'
name = 'slapos.recipe.template' name = 'slapos.recipe.template'
long_description = open("README.txt").read() + "\n" + \ long_description = open("README.txt").read() + "\n" + \
open(os.path.join('slapos', 'recipe', open(os.path.join('slapos', 'recipe',
......
...@@ -38,6 +38,12 @@ DEFAULT_CONTEXT = {x.__name__: x for x in ( ...@@ -38,6 +38,12 @@ DEFAULT_CONTEXT = {x.__name__: x for x in (
isinstance, iter, len, list, map, max, min, next, oct, ord, isinstance, iter, len, list, map, max, min, next, oct, ord,
pow, repr, reversed, round, set, sorted, str, sum, tuple, zip)} pow, repr, reversed, round, set, sorted, str, sum, tuple, zip)}
def _assert(x, *args):
if x:
return ""
raise AssertionError(*args)
DEFAULT_CONTEXT['assert'] = _assert
_buildout_safe_dumps = getattr(zc.buildout.buildout, 'dumps', None) _buildout_safe_dumps = getattr(zc.buildout.buildout, 'dumps', None)
DUMPS_KEY = 'dumps' DUMPS_KEY = 'dumps'
DEFAULT_IMPORT_DELIMITER = '/' DEFAULT_IMPORT_DELIMITER = '/'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment