本文整理汇总了Python中jinja.Environment.globals['fire_multiple_broken']方法的典型用法代码示例。如果您正苦于以下问题:Python Environment.globals['fire_multiple_broken']方法的具体用法?Python Environment.globals['fire_multiple_broken']怎么用?Python Environment.globals['fire_multiple_broken']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jinja.Environment
的用法示例。
在下文中一共展示了Environment.globals['fire_multiple_broken']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: broken
# 需要导入模块: from jinja import Environment [as 别名]
# 或者: from jinja.Environment import globals['fire_multiple_broken'] [as 别名]
{% set a = 1 / 0 %}''',
'syntax_broken': '''\
This is an included template
{% raw %}just some foo''',
'multiple_broken': '''\
Just some context:
{% include 'macro_broken' %}
{{ broken() }}
''',
'macro_broken': '''\
{% macro broken %}
{{ 1 / 0 }}
{% endmacro %}
'''
}))
e.globals['fire_multiple_broken'] = lambda: \
e.get_template('multiple_broken').render()
FAILING_STRING_TEMPLATE = '{{ 1 / 0 }}'
BROKEN_STRING_TEMPLATE = '{% if foo %}...{% endfor %}'
def broken():
raise RuntimeError("I'm broken")
def test(environ, start_response):
path = environ.get('PATH_INFO' or '/')
try:
tmpl = e.get_template(path)
except TemplateNotFound:
if path == '/syntax_from_string':