4:27 � 355Æ¿Ç c
The requested URL was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
# ˆl–ß=¿JJj"Tâ‚ÁàS�ÿË ƒh¹ÊÀÈ 1 ; ˆl–Ým_J22Ž¥@µq§n6%1hßÌ „l ÿËa–ß=¿JJj"Tâ‚Áà@¦-ÿÊ ?÷ # -*- coding: utf-8 -*- """Classes for managing templates and their runtime and compile time options. """ import os import sys import weakref from functools import partial from functools import reduce from markupsafe import Markup from . import nodes from ._compat import encode_filename from ._compat import implements_iterator from ._compat import implements_to_string from ._compat import iteritems from ._compat import PY2 from ._compat import PYPY from ._compat import reraise from ._compat import string_types from ._compat import text_type from .compiler import CodeGenerator from .compiler import generate from .defaults import BLOCK_END_STRING from .defaults import BLOCK_START_STRING from .defaults import COMMENT_END_STRING from .defaults import COMMENT_START_STRING from .defaults import DEFAULT_FILTERS from .defaults import DEFAULT_NAMESPACE from .defaults import DEFAULT_POLICIES from .defaults import DEFAULT_TESTS from .defaults import KEEP_TRAILING_NEWLINE from .defaults import LINE_COMMENT_PREFIX from .defaults import LINE_STATEMENT_PREFIX from .defaults import LSTRIP_BLOCKS from .defaults import NEWLINE_SEQUENCE from .defaults import TRIM_BLOCKS from .defaults import VARIABLE_END_STRING from .defaults import VARIABLE_START_STRING from .exceptions import TemplateNotFound from .exceptions import TemplateRuntimeError from .exceptions import TemplatesNotFound from .exceptions import TemplateSyntaxError from .exceptions import UndefinedError from .lexer import get_lexer from .lexer import TokenStream from .nodes import EvalContext from .parser import Parser from .runtime import Context from .runtime import new_context from .runtime import Undefined from .utils import concat from .utils import consume from .utils import have_async_gen from .utils import import_string from .utils import internalcode from .utils import LRUCache from .utils import missing # for direct template usage we have up to ten living environments _spontaneous_environments = LRUCache(10) def get_spontaneous_environment(cls, *args): """Return a new spontaneous environment. A spontaneous environment is used for templates created directly rather than through an existing environment. :param cls: Environment class to create. :param args: Positional arguments passed to environment. """ key = (cls, args) try: return _spontaneous_environments[key] except KeyError: _spontaneous_environments[key] = env = cls(*args) env.shared = True return env def create_cache(size): """Return the cache class for the given size.""" if size == 0: return None if size < 0: return {} return LRUCache(size) def copy_cache(cache): """Create an empty copy of the given cache.""" if cache is None: return None elif type(cache) is dict: return {} return LRUCache(cache.capacity) def load_extensions(environment, extensions): """Load the extensions from the list and bind it to the environment. Returns a dict of instantiated environments. """ result = {} for extension in extensions: if isinstance(extension, string_types): extension = import_string(extension) result[extension.identifier] = extension(environment) return result def fail_for_missing_callable(string, name): msg = string % name if isinstance(name, Undefined): try: name._fail_with_undefined_error() except Exception as e: msg = "%s (%s; did you forget to quote the callable name?)" %