관리-도구
편집 파일: runtime.cpython-39.opt-1.pyc
a �����`�w����������������������@���sJ��d�Z�ddlZddlmZ�ddlmZ�ddlmZ�ddlmZ�ddlm Z �dd l mZ�dd l mZ�ddl m Z �ddl mZ�dd l mZ�ddl mZ�ddl mZ�ddl mZ�ddl mZ�ddlmZ�ddlmZ�ddlmZ�ddlmZ�ddlmZ�ddlmZ�ddlmZ�ddlmZ�ddlmZ�ddlm Z �g�d�Z!eZ"dd��Z#dd ��Z$d!d"��Z%d?d#d$�Z&G�d%d&��d&e'�Z(d'd(��Z)G�d)d*��d*e*�Z+efd+d,�Z,G�d-d.��d.ee+��Z-ej.�/e-��G�d/d0��d0e'�Z0e G�d1d2��d2��Z1G�d3d4��d4e'�Z2eG�d5d6��d6e'��Z3d@d7d8�Z4G�d9d:��d:e3�Z5eG�d;d<��d<e3��Z6eG�d=d>��d>e3��Z7e3`8e5`8e6`8e7`8dS�)Az;The runtime functions and state used by compiled templates.�����N)�chain)� MethodType)�escape)�Markup)�soft_unicode����)�abc)�imap)�implements_iterator)�implements_to_string)� iteritems)�PY2)�string_types)� text_type)�with_metaclass)�TemplateNotFound)�TemplateRuntimeError)�UndefinedError)�EvalContext)�concat)�evalcontextfunction)�internalcode)�missing)� Namespace)�object_type_repr)�LoopContext�TemplateReference�Macror���r���r���r���r����markup_join�unicode_join� to_string�identityr���r���� Undefinedc�����������������C���s���|�S�)zLReturns its argument. Useful for certain things in the environment. ����xr#���r#����2/usr/lib/python3.9/site-packages/jinja2/runtime.pyr!���7���s����r!���c�����������������C���sL���g�}t�t|��}|D�]0}|�|��t|d�rtd��t||����S�qt|�S�)z@Concatenation that escapes if necessary and converts to unicode.�__html__��)r ���r����append�hasattrr����joinr���r���)�seq�buf�iterator�argr#���r#���r&���r���>���s���� r���c�����������������C���s���t�tt|���S�)z4Simple args to unicode conversion and concatenation.)r���r ���r���)r,���r#���r#���r&���r���I���s����r���c����������� ������C���sl���|du�ri�}|r|}nt�|pdfi�|��}|r\|r:t�|�}t|�D�]\}} | turB| ||<�qB|��|�|||�S�)z%Internal helper for context creation.Nr#���)�dictr���r���Z context_class) �environmentZ template_name�blocks�varsZshared�globals�locals�parent�key�valuer#���r#���r&����new_contextN���s���� r9���c�������������������@���s(���e�Zd�ZdZdd��Zdd��Zdd��ZdS�) r���zThe `self` in templates.c�����������������C���s ���||�_�d�S��N)�_TemplateReference__context)�self�contextr#���r#���r&����__init__l���s����zTemplateReference.__init__c�����������������C���s���|�j�j|�}t||�j�|d�S��Nr���)r;���r2����BlockReference)r<����namer2���r#���r#���r&����__getitem__o���s����zTemplateReference.__getitem__c�����������������C���s���d|�j�j|�jjf�S�)Nz<%s %r>)� __class__�__name__r;���rA����r<���r#���r#���r&����__repr__s���s����zTemplateReference.__repr__N)rD���� __module__�__qualname__�__doc__r>���rB���rF���r#���r#���r#���r&���r���i���s���r���c�����������������C���s���t�|�d|��S�)N�__func__)�getattrr$���r#���r#���r&���� _get_funcw���s����rL���c�������������������@���s���e�Zd�Zdd��ZdS�)�ContextMetac����������� ������C���sv���t��|�|||�}|dkr|S�t|j�}ttj�}t|j�}ttj�}||ur\||u�r\d|_n||u�rr||u�rrd|_|S�)Nr#���T)�type�__new__rL����resolve�Context�resolve_or_missing�_legacy_resolve_mode�_fast_resolve_mode) ZmcsrA����bases�d�rvrP���Zdefault_resolverR���Zdefault_resolve_or_missingr#���r#���r&���rO���|���s$���� ����zContextMeta.__new__N)rD���rG���rH���rO���r#���r#���r#���r&���rM���{���s���rM���c�����������������C���s,���||�j�v�r|�j�|�S�||�jv�r(|�j|�S�|S�r:����r3���r6���)r=���r7���r���r#���r#���r&���rR�������s ���� rR���c�������������������@���s����e�Zd�ZdZdZdZdd��Zdd��Zd$dd �Zd d��Z dd ��Z dd��Zdd��Ze dd���Zd%dd�Zdd��Zed�Zed�Zed�Zer�ed�Zed�Zed�Z[dd��Zd d!��Zd"d#��ZdS�)&rQ���a���The template context holds the variables of a template. It stores the values passed to the template and also the names the template exports. Creating instances is neither supported nor useful as it's created automatically at various stages of the template evaluation and should not be created by hand. The context is immutable. Modifications on :attr:`parent` **must not** happen and modifications on :attr:`vars` are allowed from generated template code only. Template filters and global functions marked as :func:`contextfunction`\s get the active context passed as first argument and are allowed to access the context read-only. The template context supports read only dict operations (`get`, `keys`, `values`, `items`, `iterkeys`, `itervalues`, `iteritems`, `__getitem__`, `__contains__`). Additionally there is a :meth:`resolve` method that doesn't fail with a `KeyError` but returns an :class:`Undefined` object for missing variables. Fc�����������������C���s\���||�_�i�|�_||�_t|�j|�|�_t��|�_||�_tdd��t |�D���|�_ |�jrXtt |��|�_ d�S�)Nc�����������������s���s���|�]\}}||gfV��qd�S�r:���r#�����.0�k�vr#���r#���r&���� <genexpr>���������z#Context.__init__.<locals>.<genexpr>)r6���r3���r1���r����eval_ctx�set� exported_varsrA���r0���r���r2���rT���r���rR���)r<���r1���r6���rA���r2���r#���r#���r&���r>�������s����zContext.__init__c�����������������C���sZ���z$|�j�|�}|�|�d�}||��W�n&�tyJ���|�jjd|�dd��Y�S�0�t||�||�S�)zRender a parent block.r����#there is no parent block called %r.�super�rA���)r2����index�LookupErrorr1���� undefinedr@���)r<���rA����currentr2���re���r#���r#���r&���rc�������s���� �z Context.superNc�����������������C���s&���z |�|�W�S��t�y ���|�Y�S�0�dS�)zfReturns an item from the template context, if it doesn't exist `default` is returned. N)�KeyError)r<���r7����defaultr#���r#���r&����get����s���� zContext.getc�����������������C���s6���|�j�rt|�|�}n |��|�}|tu�r2|�jj|d�S�|S�)z�Looks up a variable like `__getitem__` or `get` but returns an :class:`Undefined` object with the name of the name looked up. rd���)rS���rR���r���r1���rg����r<���r7���rW���r#���r#���r&���rP�������s���� zContext.resolvec�����������������C���s,���|�j�r"|��|�}t|t�rt}|S�t|�|�S�)zxResolves a variable like :meth:`resolve` but returns the special `missing` value if it cannot be found. )rS���rP���� isinstancer"���r���rR���rl���r#���r#���r&���rR�������s���� zContext.resolve_or_missingc��������������������s���t���fdd���jD���S�)z+Get a new dict with the exported variables.c�����������������3���s���|�]}|��j�|�fV��qd�S�r:���)r3���)rZ���r[���rE���r#���r&���r]�������r^���z'Context.get_exported.<locals>.<genexpr>)r0���ra���rE���r#���rE���r&����get_exported����s����zContext.get_exportedc�����������������C���s,���|�j�s|�jS�|�js|�j�S�t|�jfi�|�j���S�)z�Return the complete context as dict including the exported variables. For optimizations reasons this might not return an actual copy so be careful with using it. )r3���r6���r0���rE���r#���r#���r&����get_all����s ����zContext.get_allc�����������������O���s����t�|d�r,|j}dD�]}t�||�r|}�q,qt|�r�t|dd�du�rP|�f|�}n:t|dd�du�rn|�jf|�}nt|dd�du�r�|�jf|�}z||i�|��W�S��ty����|�j�d��Y�S�0�d S�) z�Call the callable with the arguments and keyword arguments provided but inject the active context or environment as first argument if the callable is a :func:`contextfunction` or :func:`environmentfunction`. �__call__)�contextfunctionr����environmentfunctionrq���FTr���rr���zGvalue was undefined because a callable raised a StopIteration exceptionN)r*���rp����callablerK���r_���r1���� StopIterationrg���)Z_Context__selfZ _Context__obj�args�kwargs�fnZfn_typer#���r#���r&����call��s&���� �zContext.callc�����������������C���sD���t�|�j|�ji�|����dd|�}|�j|_|j�dd��t|�j�D����|S�)z�Internal helper function to create a derived context. This is used in situations where the system needs a new context in the same template that is independent. TNc�����������������s���s���|�]\}}|t�|�fV��qd�S�r:���)�listrY���r#���r#���r&���r]���3��r^���z"Context.derived.<locals>.<genexpr>)r9���r1���rA���ro���r_���r2����updater���)r<���r5���r=���r#���r#���r&����derived*��s�����zContext.derivedc��������������������s$�����fdd�}t�t���j|_��|_|S�)Nc��������������������s���t�|���������S�r:���)rK���ro���rE�����methr#���r&����proxy7��s����zContext._all.<locals>.proxy)rK���r0���rI���rD���)r}���r~���r#���r|���r&����_all6��s����zContext._all�keys�values�items�iterkeys� itervaluesr���c�����������������C���s���||�j�v�p||�jv�S�r:���rX����r<���rA���r#���r#���r&����__contains__I��s����zContext.__contains__c�����������������C���s���|���|�}|tu�rt|��|S�)zTLookup a variable or raise `KeyError` if the variable is undefined. )rR���r���ri���)r<���r7����itemr#���r#���r&���rB���L��s���� zContext.__getitem__c�����������������C���s���d|�j�jt|�����|�jf�S�)Nz <%s %s of %r>)rC���rD����reprro���rA���rE���r#���r#���r&���rF���U��s ���� �zContext.__repr__)N)N)rD���rG���rH���rI���rS���rT���r>���rc���rk���rP���rR���rn���ro���r���rx���r{���r���r����r����r����r ���r����r����r���r����rB���rF���r#���r#���r#���r&���rQ�������s2��� % rQ���c�������������������@���s0���e�Zd�ZdZdd��Zedd���Zedd���ZdS�) r@���z"One block on a template reference.c�����������������C���s���||�_�||�_||�_||�_d�S�r:���)rA����_context�_stack�_depth)r<���rA���r=����stack�depthr#���r#���r&���r>���c��s����zBlockReference.__init__c�����������������C���sF���|�j�d�t|�j�kr,|�jjjd|�j�dd�S�t|�j|�j|�j|�j�d��S�)zSuper the block.r���rb���rc���rd���)r�����lenr����r����r1���rg���rA���r@���rE���r#���r#���r&���rc���i��s ���� �zBlockReference.superc�����������������C���s,���t�|�j|�j�|�j��}|�jjjr(t|�}|S�r:���)r���r����r����r����r_���� autoescaper����r<���rW���r#���r#���r&���rp���r��s���� zBlockReference.__call__N) rD���rG���rH���rI���r>����propertyrc���r���rp���r#���r#���r#���r&���r@���`��s��� r@���c�������������������@���s����e�Zd�ZdZdZdZeZeZeZ eZ d+dd�Zedd���Z ed d ���Zdd��Zed d���Zedd���Zedd���Zedd���Zedd���Zdd��Zedd���Zedd���Zedd���Zdd ��Zd!d"��Zd#d$��Zd%d&��Zed'd(���Zd)d*��Z dS�),r���zeA wrapper iterable for dynamic ``for`` loops, with information about the loop and iteration. ���Nr���c�����������������C���s(���||�_�|��|�|�_||�_||�_||�_dS�)a@�� :param iterable: Iterable to wrap. :param undefined: :class:`Undefined` class to use for next and previous items. :param recurse: The function to render the loop body when the loop is marked recursive. :param depth0: Incremented when looping recursively. N)� _iterable�_to_iterator� _iterator� _undefined�_recurse�depth0)r<����iterablerg���Zrecurser����r#���r#���r&���r>������s ���� zLoopContext.__init__c�����������������C���s���t�|��S�r:���)�iter)r����r#���r#���r&���r�������s����zLoopContext._to_iteratorc�����������������C���sj���|�j�dur|�j�S�zt|�j�|�_�W�nB�tyb���t|�j�}|��|�|�_t|�|�j�|�jt u�|�_�Y�n0�|�j�S�)z�Length of the iterable. If the iterable is a generator or otherwise does not have a size, it is eagerly evaluated to get a size. N) �_lengthr����r����� TypeErrorry���r����r����re����_afterr����r<���r����r#���r#���r&����length���s���� zLoopContext.lengthc�����������������C���s���|�j�S�r:���)r����rE���r#���r#���r&����__len__���s����zLoopContext.__len__c�����������������C���s ���|�j�d�S�)zBHow many levels deep a recursive loop currently is, starting at 1.r���)r����rE���r#���r#���r&���r�������s����zLoopContext.depthc�����������������C���s ���|�j�d�S�)z-Current iteration of the loop, starting at 1.r�����index0rE���r#���r#���r&���re������s����zLoopContext.indexc�����������������C���s���|�j�|�j�S�)zrNumber of iterations from the end of the loop, ending at 0. Requires calculating :attr:`length`. )r����re���rE���r#���r#���r&���� revindex0���s����zLoopContext.revindex0c�����������������C���s���|�j�|�j�S�)zrNumber of iterations from the end of the loop, ending at 1. Requires calculating :attr:`length`. )r����r����rE���r#���r#���r&����revindex���s����zLoopContext.revindexc�����������������C���s ���|�j�dkS�)z0Whether this is the first iteration of the loop.r���r����rE���r#���r#���r&����first���s����zLoopContext.firstc�����������������C���s$���|�j�tur|�j�S�t|�jt�|�_�|�j�S�)a��Return the next element in the iterable, or :data:`missing` if the iterable is exhausted. Only peeks one item ahead, caching the result in :attr:`_last` for use in subsequent checks. The cache is reset when :meth:`__next__` is called. )r����r����nextr����rE���r#���r#���r&���� _peek_next���s���� zLoopContext._peek_nextc�����������������C���s���|�����tu�S�)z�Whether this is the last iteration of the loop. Causes the iterable to advance early. See :func:`itertools.groupby` for issues this can cause. The :func:`groupby` filter avoids that issue. )r����r���rE���r#���r#���r&����last���s����zLoopContext.lastc�����������������C���s���|�j�r|��d�S�|�jS�)zZThe item in the previous iteration. Undefined during the first iteration. zthere is no previous item)r����r�����_beforerE���r#���r#���r&����previtem���s���� zLoopContext.previtemc�����������������C���s���|�����}|tu�r|��d�S�|S�)z�The item in the next iteration. Undefined during the last iteration. Causes the iterable to advance early. See :func:`itertools.groupby` for issues this can cause. The :func:`groupby` filter avoids that issue. zthere is no next item)r����r���r����r����r#���r#���r&����nextitem���s���� zLoopContext.nextitemc�����������������G���s���|st�d��||�jt|���S�)z�Return a value from the given args, cycling through based on the current :attr:`index0`. :param args: One or more values to cycle through. zno items for cycling given)r����r����r����)r<���ru���r#���r#���r&����cycle��s����zLoopContext.cyclec�����������������G���s���|�j�|kr||�_�dS�dS�)z�Return ``True`` if previously called with a different value (including when called for the first time). :param value: One or more values to compare to the last call. TF)�_last_changed_value)r<���r8���r#���r#���r&����changed ��s���� zLoopContext.changedc�����������������C���s���|�S�r:���r#���rE���r#���r#���r&����__iter__��s����zLoopContext.__iter__c�����������������C���sF���|�j�tur|�j�}t|�_�n t|�j�}|��jd7��_|�j|�_||�_||�fS�)Nr���)r����r���r����r����r�����_currentr����r����r#���r#���r&����__next__��s���� zLoopContext.__next__c�����������������C���s&���|�j�du�rtd��|�j�||�j�|�jd�S�)z�When iterating over nested data, render the body of the loop recursively with the given inner iterable data. The loop must have the ``recursive`` marker for this to work. NzCThe loop must have the 'recursive' marker to be called recursively.)r����)r����r����r����r����r#���r#���r&���rp���(��s ���� �zLoopContext.__call__c�����������������C���s���d|�j�j|�j|�jf�S�)Nz <%s %d/%d>)rC���rD���re���r����rE���r#���r#���r&���rF���6��s����zLoopContext.__repr__)Nr���)!rD���rG���rH���rI���r����r����r���r����r����r����r����r>����staticmethodr����r����r����r����r����re���r����r����r����r����r����r����r����r����r����r����r����r���rp���rF���r#���r#���r#���r&���r���z��sJ��� r���c�������������������@���s:���e�Zd�ZdZddd�Zeedd����Zdd��Zd d ��Z dS�)r���zWraps a macro function.Nc ����������� ������C���sV���||�_�||�_t|�|�_||�_||�_||�_||�_||�_d|v�|�_ |d�u�rL|j }||�_d�S�)N�caller)�_environment�_funcr�����_argument_countrA���� arguments�catch_kwargs� catch_varargsr�����explicit_callerr�����_default_autoescape) r<���r1����funcrA���r����r����r����r����Zdefault_autoescaper#���r#���r&���r>���=��s���� zMacro.__init__c����������� ��� ���O���s���|r*t�|d�t�r*|d�j}|dd���}n|�j}t|d�|�j���}t|�}d}||�jkr�|�jt|�d���D�]@}z|�|�}W�n�t y����t }Y�n0�|dkr�d}|�|��qjn|�j}|�j r�|s�|�dd��} | d�u�r�|�jjddd�} |�| ��|�jr�|�|��n8|�r6d|v��rtd|�j���td |�jtt|��f���|�j�rT|�||�jd�����n(t|�|�jk�r|td |�jt|�j�f���|��||�S�)Nr���r���Fr����TzNo caller definedrd���zamacro %r was invoked with two values for the special caller argument. This is most likely a bug.z%macro %r takes no keyword argument %rz+macro %r takes not more than %d argument(s))rm���r���r����r����ry���r����r����r�����popri���r���r)���r����r����r����rg���r����r����rA���r����r����r�����_invoke) r<���ru���rv���r����r����ZoffZfound_callerrA���r8���r����r#���r#���r&���rp���U��sZ���� ������zMacro.__call__c�����������������C���s���|�j�|��}|rt|�}|S�)z=This method is being swapped out by the async implementation.)r����r���)r<���r����r����rW���r#���r#���r&���r�������s���� z Macro._invokec�����������������C���s$���d|�j�j|�jd�u�rdpt|�j�f�S�)Nz<%s %s>Z anonymous)rC���rD���rA���r����rE���r#���r#���r&���rF������s�����zMacro.__repr__)N) rD���rG���rH���rI���r>���r���r���rp���r����rF���r#���r#���r#���r&���r���:��s����� Nr���c�������������������@���s����e�Zd�ZdZdZdedefdd�Zedd���Z e dd ���Ze d d���Ze�Z �Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z �Z!�Z"�Z#�Z$�Z%�Z&Z'dd ��Z(dd��Z)dd��Z*dd��Z+dd��Z,dd��Z-dd��Z.e.Z/dd��Z0dS�)r"���ah��The default undefined type. This undefined type can be printed and iterated over, but every other access will raise an :exc:`UndefinedError`: >>> foo = Undefined(name='foo') >>> str(foo) '' >>> not foo True >>> foo + 42 Traceback (most recent call last): ... jinja2.exceptions.UndefinedError: 'foo' is undefined ��_undefined_hint�_undefined_obj�_undefined_name�_undefined_exceptionNc�����������������C���s���||�_�||�_||�_||�_d�S�r:���r����)r<����hint�objrA����excr#���r#���r&���r>������s����zUndefined.__init__c�����������������C���sT���|�j�r|�j�S�|�jtu�r d|�j�S�t|�jt�s@dt|�j�|�jf�S�dt|�j�|�jf�S�)zXBuild a message about the undefined value based on how it was accessed. z%r is undefinedz%s has no element %rz%r has no attribute %r)r����r����r���r����rm���r���r���rE���r#���r#���r&����_undefined_message���s���� ��zUndefined._undefined_messagec�����������������O���s���|���|�j��dS�)zeRaise an :exc:`UndefinedError` when operations are performed on the undefined value. N)r����r����)r<���ru���rv���r#���r#���r&����_fail_with_undefined_error���s����z$Undefined._fail_with_undefined_errorc�����������������C���s ���|d�d��dkrt�|��|����S�)N�����__)�AttributeErrorr����r����r#���r#���r&����__getattr__���s����zUndefined.__getattr__c�����������������C���s���t�|��t�|�u�S�r:���)rN����r<����otherr#���r#���r&����__eq__!��s����zUndefined.__eq__c�����������������C���s���|���|��S�r:���)r����r����r#���r#���r&����__ne__$��s����zUndefined.__ne__c�����������������C���s���t�t|���S�r:���)�idrN���rE���r#���r#���r&����__hash__'��s����zUndefined.__hash__c�����������������C���s���dS�)Nr(���r#���rE���r#���r#���r&����__str__*��s����zUndefined.__str__c�����������������C���s���dS�r?���r#���rE���r#���r#���r&���r����-��s����zUndefined.__len__c�����������������c���s���d�S�r:���r#���rE���r#���r#���r&���r����0��s����zUndefined.__iter__c�����������������C���s���dS�)NFr#���rE���r#���r#���r&����__nonzero__4��s����zUndefined.__nonzero__c�����������������C���s���dS�)Nr"���r#���rE���r#���r#���r&���rF���9��s����zUndefined.__repr__)1rD���rG���rH���rI���� __slots__r���r���r>���r����r����r���r����r�����__add__�__radd__�__mul__�__rmul__Z__div__Z__rdiv__�__truediv__�__rtruediv__�__floordiv__� __rfloordiv__�__mod__�__rmod__�__pos__�__neg__rp���rB����__lt__�__le__�__gt__�__ge__�__int__� __float__�__complex__�__pow__�__rpow__�__sub__�__rsub__r����r����r����r����r����r����r�����__bool__rF���r#���r#���r#���r&���r"������s���� 1����� �� ����������!�#�%�'�)�+�,�,�,r"���c��������������������s`����du�r,ddl�}|�t����|�tj����du�r8t��fdd���G�����fdd�d��}|S�)ak��Given a logger object this returns a new undefined class that will log certain failures. It will log iterations and printing. If no logger is given a default logger is created. Example:: logger = logging.getLogger(__name__) LoggingUndefined = make_logging_undefined( logger=logger, base=Undefined ) .. versionadded:: 2.8 :param logger: the logger to use. If not provided, a default logger is created. :param base: the base class to add logging functionality to. This defaults to :class:`Undefined`. Nr���c��������������������sn���|�j�d�u�rX|�jtu�r d|�j�}q^t|�jt�sBdt|�j�|�jf�}q^dt|�j�|�jf�}n|�j�}���d|��d�S�)Nz%s is undefinedz%s has no element %sz%s has no attribute %szTemplate variable warning: %s)r����r����r���r����rm���r���r���Zwarning)Zundefr����)�loggerr#���r&����_log_messageY��s���� ��z,make_logging_undefined.<locals>._log_messagec�����������������������sf���e�Zd�Z��fdd�Z���fdd�Z���fdd�ZerT���fdd�Z���fd d �Zn���fdd�Z d S�)z0make_logging_undefined.<locals>.LoggingUndefinedc�������������� ������sZ���z��j�|�g|�R�i�|��W�S��|�jyT�}�z ��dt|���|�W�Y�d�}~n d�}~0�0�d�S�)NzTemplate variable error: %s)r����r�����error�str)r<���ru���rv����e)�baser����r#���r&���r����l��s ����zKmake_logging_undefined.<locals>.LoggingUndefined._fail_with_undefined_errorc��������������������s������|��}��|���|S�r:����r����r�����r����r����r#���r&���r����s��s���� z8make_logging_undefined.<locals>.LoggingUndefined.__str__c��������������������s������|��}��|���|S�r:���)r����r����r����r#���r&���r����x��s���� z9make_logging_undefined.<locals>.LoggingUndefined.__iter__c��������������������s������|��}��|���|S�r:���)r����r����r����r#���r&���r������s���� z<make_logging_undefined.<locals>.LoggingUndefined.__nonzero__c��������������������s������|��}��|���|S�r:���)�__unicode__r����r����r#���r&���r�������s���� z<make_logging_undefined.<locals>.LoggingUndefined.__unicode__c��������������������s������|��}��|���|S�r:���)r����r����r����r#���r&���r�������s���� z9make_logging_undefined.<locals>.LoggingUndefined.__bool__N) rD���rG���rH���r����r����r����r ���r����r����r����r#����r����r����r����r#���r&����LoggingUndefinedk��s���r����)�loggingZ getLoggerrD���Z addHandlerZ StreamHandler�sys�stderrr"���)r����r����r����r����r#���r����r&����make_logging_undefined=��s���� %r����c�������������������@���s(���e�Zd�ZdZdZdd��Zdd��ZeZdS�)�ChainableUndefineda���An undefined that is chainable, where both ``__getattr__`` and ``__getitem__`` return itself rather than raising an :exc:`UndefinedError`. >>> foo = ChainableUndefined(name='foo') >>> str(foo.bar['baz']) '' >>> foo.bar['baz'] + 42 Traceback (most recent call last): ... jinja2.exceptions.UndefinedError: 'foo' is undefined .. versionadded:: 2.11.0 r#���c�����������������C���s���|�����S�r:���r����rE���r#���r#���r&���r'������s����zChainableUndefined.__html__c�����������������C���s���|�S�r:���r#���)r<����_r#���r#���r&���r�������s����zChainableUndefined.__getattr__N)rD���rG���rH���rI���r����r'���r����rB���r#���r#���r#���r&���r�������s ���r����c�������������������@���s���e�Zd�ZdZdZdd��ZdS�)�DebugUndefineda��An undefined that returns the debug info when printed. >>> foo = DebugUndefined(name='foo') >>> str(foo) '{{ foo }}' >>> not foo True >>> foo + 42 Traceback (most recent call last): ... jinja2.exceptions.UndefinedError: 'foo' is undefined r#���c�����������������C���s<���|�j�d�u�r2|�jtu�rd|�j�S�dt|�j�|�jf�S�d|�j��S�)Nz{{ %s }}z{{ no such element: %s[%r] }}z!{{ undefined value printed: %s }})r����r����r���r����r���rE���r#���r#���r&���r�������s���� �zDebugUndefined.__str__N)rD���rG���rH���rI���r����r����r#���r#���r#���r&���r�������s��� r����c�������������������@���s6���e�Zd�ZdZdZej�Z�Z�Z �Z �Z�Z�Z ZdS�)�StrictUndefinedas��An undefined that barks on print and iteration as well as boolean tests and all kinds of comparisons. In other words: you can do nothing with it except checking if it's defined using the `defined` test. >>> foo = StrictUndefined(name='foo') >>> str(foo) Traceback (most recent call last): ... jinja2.exceptions.UndefinedError: 'foo' is undefined >>> not foo Traceback (most recent call last): ... jinja2.exceptions.UndefinedError: 'foo' is undefined >>> foo + 42 Traceback (most recent call last): ... jinja2.exceptions.UndefinedError: 'foo' is undefined r#���N)rD���rG���rH���rI���r����r"���r����r����r����r����r����r����r����r����r����r#���r#���r#���r&���r������s ����������r���)NNNN)NN)9rI���r����� itertoolsr����typesr���Z markupsafer���r���r���Z_compatr���r ���r ���r���r���r ���r���r���r���� exceptionsr���r���r���Znodesr���Zutilsr���r���r���r���r���r���Zexportedr ���r!���r���r���r9����objectr���rL���rN���rM���rR���rQ����Mapping�registerr@���r���r���r"���r����r����r����r���r����r#���r#���r#���r&����<module>���sz��� ����� �@�@y� Y!�