예제 #1
0
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
예제 #2
0
파일: template.py 프로젝트: Shasthojoy/veil
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
예제 #3
0
파일: misc.py 프로젝트: Shasthojoy/veil
def format_exception(exception_info):
    return to_unicode(b''.join(traceback.format_exception(*exception_info)),
                      strict=False)
예제 #4
0
def format_exception(exception_info):
    return to_unicode(b''.join(traceback.format_exception(*exception_info)))
예제 #5
0
파일: queue.py 프로젝트: chenxc/veil
 def __init__(self, resq):
     self.opened_by = to_unicode(str('').join(traceback.format_stack()))
     self.resq = resq
예제 #6
0
파일: queue.py 프로젝트: chenxc/veil
 def __init__(self):
     self.opened_by = to_unicode(str('').join(traceback.format_stack()))
     self.stopped = False
     self.queued_jobs = []