def get_or_create_environment(): global env if env: return env jinja_tag = jinjatag.JinjaTag() env = Environment( loader=PrefixLoader(loaders, delimiter=':'), trim_blocks=True, lstrip_blocks=True, autoescape=True, extensions=['jinja2.ext.autoescape', 'jinja2.ext.i18n', jinja_tag]) jinja_tag.init() env.filters.update(filters) env.install_null_translations() env.created_by = to_unicode(b''.join(traceback.format_stack())) executing_test = get_executing_test(optional=True) if executing_test: executing_test.addCleanup(reset_template_environment) return env
def get_or_create_environment(): global env if env: return env jinja_tag = jinjatag.JinjaTag() env = Environment(loader=PrefixLoader(loaders, delimiter=':'), trim_blocks=True, lstrip_blocks=True, autoescape=True, extensions=['jinja2.ext.i18n', jinja_tag]) jinja_tag.init() env.filters.update(filters) env.install_null_translations() env.created_by = to_unicode(b''.join(traceback.format_stack()), strict=False) executing_test = get_executing_test(optional=True) if executing_test: executing_test.addCleanup(reset_template_environment) return env
def format_exception(exception_info): return to_unicode(b''.join(traceback.format_exception(*exception_info)), strict=False)
def format_exception(exception_info): return to_unicode(b''.join(traceback.format_exception(*exception_info)))
def __init__(self, resq): self.opened_by = to_unicode(str('').join(traceback.format_stack())) self.resq = resq
def __init__(self): self.opened_by = to_unicode(str('').join(traceback.format_stack())) self.stopped = False self.queued_jobs = []