Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
runtime.cpython-313.pyc359 linesDownload Raw Back to __pycache__
1�

2��jɅ���SrSSKrSSKrSSKrSSKJr SSKJr SSK	J3r4 SSK	Jr SSK	Jr SS	K
Jr SS5K
Jr SSKJr SSKJr SS
KJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr \R<"S5r\R<"S\R@S\RB4S9r"\RF(a#SSK$r$SSK%r&SSK'J(r( "SS\&RR5r*/SQr+/SQr,S\S \4S!jr-S"\R\\RBS \/4S#jr0S"\R\\RBS \/4S$jr1SHS%S&S'\Rd\/S(\Rf\/\R@S)/\Rh\/44S*\Rd\Rf\/\RB4S+\5S,\Rd\Rl\/\RB4S-\Rd\Rn\/\RB4S S)4S.jjr8"S/S05r9S1\"S \"4S2jr:\RnRv"S3S)55r<"S4S55r="S6S75r>"S8S9\>5r?"S:S;5r@"S<S=5rAS\A4S>\RdS?S@\R�\AS \R�\A4SAjjrC"SBSC\A5rD"SDSE\A5rE"SFSG\A5rFg)Iz;The runtime functions and state used by compiled templates.�N)�abc)�chain)�escape)�Markup)�soft_str���6auto_aiter)�7auto_await)�TemplateNotFound)�TemplateRuntimeError)�UndefinedError)�EvalContext)�_PassArg)�concat)�internalcode)�missing)�	Namespace)�object_type_repr)�pass_eval_context�V�F.)�bound)�Environmentc	�N�\rSrSrS	S\R8\SSS\S\4Sjjr	Sr9g)10�LoopRenderFunc�%�reciter�loop_render_func�depth�returnc��g�N�)�selfrrr s    �TD:\code\apps\devtools\python\user_packages\Python313\site-packages\jinja2/runtime.py�__call__�LoopRenderFunc.__call__&s��11�r$N)r)�__name__�12__module__�__qualname__�__firstlineno__�t�Iterabler�int�strr'�__static_attributes__r$r)r&rr%s?��13�		��Z�Z��]�	�/�	��		�14�	�	r)r)�LoopContext�TemplateReference�Macrorr
rr�markup_join�str_join�identityrr�	Undefinedr)�AsyncLoopContextr15r�xr!c��U$)zDReturns its argument. Useful for certain things in the16environment.17r$)r;s r&r8r8Fs	��
�Hr)�seqc���/n[[U5nUHJnURU5 [US5(dM'[	S5R[
X55s $ [U5$)z?Concatenation that escapes if necessary and converts to string.�__html__�)�mapr�append�hasattrr�joinrr)r=�buf�iterator�args    r&r6r6MsY��18�C��8�S�!�H����19�20�3���3�21�#�#��"�:�?�?�5��#7�8�8���#�;�r)c�4�[[[U55$)z3Simple args to string conversion and concatenation.)rrAr1)r=s r&r7r7Xs���#�c�3�-� � r)�environmentr�
template_name�blocks�Context�vars�shared�globals�localsc���Uc0nU(aUnO[U=(d S40UD6nU(a:U(a[U5nUR5Hup�U	[LdMX�U'M URXXUS9$)z%Internal helper for context creation.r$)rO)�dict�itemsr�
context_class)22rIrJrKrMrNrOrP�parent�key�values23          r&�new_contextrX]s|���|���
����g�m��,�t�,��
���&�\�F� �,�,�.�J�C��G�#�#�s��)��$�$��]�G�%��r)c�V�\rSrSrSrS24SjrS\S\R4Sjr	S\4Sjr25S	rg)r4�zzThe `self` in templates.r!Nc��Xlgr#)�_TemplateReference__context)r%�contexts  r&�__init__�TemplateReference.__init__}s�� �r)�namec�b�URRUn[XRUS5$�Nr)r\rK�BlockReference)r%r`rKs   r&�__getitem__�TemplateReference.__getitem__�s)�����&�&�t�,���d�N�N�F�A�>�>r)c�d�S[U5RSURR<S3$)N�<� �>)�typer*r\r`�r%s r&�__repr__�TemplateReference.__repr__�s-���4��:�&�&�'�q����)<�)<�(?�q�A�Ar))�	__context)r]rLr!N)r*r+r,r-�__doc__r^r1r.�Anyrdrlr2r$r)r&r4r4zs/��"�!�?��?����?�B�#�Br)r4�dict_methodc�^�[R"T5SSS[R4U4Sjj5n[R"[26U5$)Nr%rLr!c�0>�T"UR55$r#)�get_all)r%rqs �r&�f_all�_dict_method_all.<locals>.f_all�s����4�<�<�>�*�*r))�	functools�wrapsr.rp�castr)rqrus` r&�_dict_method_allrz�sC����_�_�[�!�+�I�+�!�%�%�+�"�+�
�6�6�!�U��r)c��\rSrSrSrS"SSS\R\\R4S\R\S\R\\RS/\R\44S	\R\R\\R4427S28jjr
S\S\RS/\R\4S\RS
4SjrS"S\S\RS\R4SjjrS\S\R\RS44SjrS\S\R4SjrS\R\\R44SjrS\R\\R44Sjr\S\RS\R4S\RS\RS\R\RS44Sj5rS"S\R\R\\R4SS4Sjjr\"\R45r\"\R65r\"\R85rS\S\4SjrS\S\R4SjrS\4S jr S!r!g)#rL�a�The template context holds the variables of a template.  It stores the29values passed to the template and also the names the template exports.30Creating instances is neither supported nor useful as it's created31automatically at various stages of the template evaluation and should not32be created by hand.33 34The context is immutable.  Modifications on :attr:`parent` **must not**35happen and modifications on :attr:`vars` are allowed from generated36template code only.  Template filters and global functions marked as37:func:`pass_context` get the active context passed as first argument38and are allowed to access the context read-only.39 40The template context supports read only dict operations (`get`,41`keys`, `values`, `items`, `iterkeys`, `itervalues`, `iteritems`,42`__getitem__`, `__contains__`).  Additionally there is a :meth:`resolve`43method that doesn't fail with a `KeyError` but returns an44:class:`Undefined` object for missing variables.45NrIrrUr`rKrOc�&�X l0UlXl[URU5Ul[5UlX0lUc46[5O47[U5UlUR5VVs0sHupgXg/_M48 snnUl49gs snnfr#)rUrMrIr�eval_ctx�set�
exported_varsr`�globals_keysrSrK)r%rIrUr`rKrO�k�vs        r&r^�Context.__init__�st����(*��	�(3��#�D�$4�$4�d�;��
�),�����	�%,�_�C�E�#�g�,���50+1�,�,�.�9�.�$�!�q�#�v�.�9����9s�4B
�currentr!�rcr9c���URUnURU5S-nX4 [XX45$![a" URR	SU<S3SS9s$f=f)zRender a parent block.r� there is no parent block called �.�super�r`)rK�index�LookupErrorrI�	undefinedrc)r%r`r�rKr�s     r&r��
Context.super�sy��	��[�[��&�F��L�L��)�A�-�E��M�51�d�&�8�8��	�	��#�#�-�-�2�4�(�!�<�7�.��
�	�s�'5�)A!� A!rV�defaultc�0�X$![a Us$f=f)z�Look up a variable by name, or return a default if the key is52not found.53 54:param key: The variable name to look up.55:param default: The value to return if the key is not found.56)�KeyError)r%rVr�s   r&�get�Context.get�s#��	��9����	��N�	�s���r9c�l�URU5nU[LaURRUS9$U$)aLook up a variable by name, or return an :class:`Undefined`57object if the key is not found.58 59If you need to add custom behavior, override60:meth:`resolve_or_missing`, not this method. The various lookup61functions use that method, not this one.62 63:param key: The variable name to look up.64r�)�resolve_or_missingrrIr�)r%rV�rvs   r&�resolve�Context.resolve�s:���
$�
$�S�
)��
��=��#�#�-�-�3�-�7�7��	r)c��XR;aURU$XR;aURU$[$)aLook up a variable by name, or return a ``missing`` sentinel65if the key is not found.66 67Override this method to add custom lookup behavior.68:meth:`resolve`, :meth:`get`, and :meth:`__getitem__` use this69method. Don't call this method directly.70 71:param key: The variable name to look up.72)rMrUr)r%rVs  r&r��Context.resolve_or_missing�s:���)�)���9�9�S�>�!��+�+���;�;�s�#�#��r)c�`�URVs0sHoURU_M sn$s snf)z+Get a new dict with the exported variables.)r�rM)r%r�s  r&�get_exported�Context.get_exported�s,��)-�);�);�<�);�A�4�9�9�Q�<��);�<�<��<s�+c��UR(dUR$UR(dUR$[UR40URD6$)z�Return the complete context as dict including the exported73variables.  For optimizations reasons this might not return an74actual copy so be careful with using it.75)rMrUrRrks r&rt�Context.get_all�s>��76�y�y��;�;���{�{��9�9���D�K�K�-�4�9�9�-�-r)�
_Context__obj.�args�kwargsc���Sn[US5(a-[R"UR5bURn[R"U5nU[RLa[URS5(aUR
US5nURS5(aUR
US5nU4U-nOGU[RLaUR4U-nO#U[RLaUR4U-nURSS5 URSS5 U"U0UD6$![a URRS5s$f=f)z�Call the callable with the arguments and keyword arguments77provided but inject the active context or environment as first78argument if the callable has :func:`pass_context` or79:func:`pass_environment`.80Tr'N�81_loop_vars�_block_varszGvalue was undefined because a callable raised a StopIteration exception)
rCr�from_objr'r]r��derived�eval_contextr~rI�pop�
StopIterationr�)�_Context__selfr�r�r��__traceback_hide__�pass_args      r&�call�Context.callsH���!%��
�E�:�&�&��!�!�%�.�.�1�=��N�N�E��$�$�U�+���x�'�'�'��z�z�,�'�'�����|�(<�=���z�z�-�(�(�����}�(=�>���9�t�#�D�
��.�.�
.��O�O�%��,�D�
��-�-�
-��&�&�(�4�/�D��82�83�=�$�'��84�85�<��&�	��$�)�&�)�)���	��%�%�/�/�+��
�	�s�2D:�:%E"�!E"rPc	��[URUR0UR5SSU5nURUlUR86R
SUR87R555 U$)z�Internal helper function to create a derived context.  This is88used in situations where the system needs a new context in the same89template that is independent.90TNc3�@# �UHupU[U54v� M g7fr#)�list)�.0r�r�s   r&�	<genexpr>�"Context.derived.<locals>.<genexpr>?s���K�7J�t�q�q�$�q�'�l�7J�s�)rXrIr`rtr~rK�updaterS)r%rPr]s   r&r��Context.derived6se��91����d�i�i��T�\�\�^�T�4��92�� �=�=��������K�t�{�{�7H�7H�7J�K�K��r)c�H�XR;=(d XR;$r#)rMrU�r%r`s  r&�__contains__�Context.__contains__Fs���y�y� �7�D�K�K�$7�7r)c�P�URU5nU[La[U5eU$)z`Look up a variable by name with ``[]`` syntax, or raise a93``KeyError`` if the key is not found.94)r�rr�)r%rV�items   r&rd�Context.__getitem__Is*���&�&�s�+���7�?��3�-���r)c�t�S[U5RSUR5<SUR<S3$)Nrgrhz of ri)rjr*rtr`rks r&rl�Context.__repr__Ts3���4��:�&�&�'�q�����(:�$�t�y�y�m�1�M�Mr))rKrIr~r�r�r`rUrMr#)"r*r+r,r-ror.�Dictr1rp�Optional�Callable�Iterator�MutableMappingr^�Unionr�r�r�r�r�rtrr�r�rzrR�keys�valuesrS�boolr�rdrlr2r$r)r&rLrL�sk���2=A�
:�"�:����s�A�E�E�z�"�:��j�j��o�	:�95���s�A�J�J�	�{�A�J�J�s�O�'C�D�D�E�:����A�,�,�S�!�%�%�Z�8�9�
:�*9��9�"#�*�*�i�[�!�*�*�S�/�-I�"J�9�	96���.�	/�9�97�s�98�Q�U�U�99�a�e�e�100��3��1�7�7�1�5�5�+�+=�#>��"�c��a�e�e��$=�a�f�f�S�!�%�%�Z�0�=�	.�����Q�U�U�101�+�	.��-��z�z�#�q�u�u�*�%�-��u�u�-��%�%�	-�102103�������#�	$�-��-�^104�a�j�j�����Q�U�U�105�);�<�106�	�107��D�I�I�&�D�
�d�k�k�
*�F��T�Z�Z�(�E�8��8��8�	�s�	�q�u�u�	�N�#�Nr)c108���\rSrSrSrS\SSS\R\RS/\R\4S\109SS	4110S111jr\S\RS4Sj5r\S\4S
j5r\S\4Sj5rSrg	)rciXz"One block on a template reference.r`r]rL�stackr r!Nc�4�XlX lX0lX@lgr#)r`�_context�_stack�_depth)r%r`r]r�r s     r&r^�BlockReference.__init__[s���	��
����r)r�c�&�URS-[UR5:�a3URRRSUR<S3SS9$[URURURURS-5$)zSuper the block.rr�r�r�r�)r��lenr�r�rIr�r`rcrks r&r��BlockReference.supergsy���;�;��?�c�$�+�+�.�.��=�=�,�,�6�6�2�4�9�9�-�q�A��7��
��d�i�i�������T�[�[�ST�_�U�Ur)c��># �URRRURUR"UR5Vs/sShv�NoPMN112Os snfsn5nURR113R(a[U5$U$7fr#)r�rIrr�r�r~�114autoescaper)r%r;r�s   r&�_async_call�BlockReference._async_callpsm���
�]�]�
&�
&�
-�
-�"�k�k�$�+�+�6�t�}�}�E�F�F��Q�F��F�115���=�=�!�!�,�,��"�:���	�s6�AB�
A�A116�A�A117�A�A118�A�?Bc�h�URRR(aUR5$URRR	UR119UR"UR55nURRR(a[U5$U$r#)120r�rI�is_asyncr�rr�r�r~r�r�r%r�s  r&r'�BlockReference.__call__{s{���=�=�$�$�-�-��#�#�%�%�
�]�]�
&�
&�
-�
-��K�K����$�T�]�]�3�121���=�=�!�!�,�,��"�:���	r))r�r�r�r`)r*r+r,r-ror1r.�Listr�r�r0r^�propertyr�r�rr�r'r2r$r)r&rcrcXs���,�122��123��124��v�v�a�j�j�)��a�j�j��o�!=�>�?�	125�126�127�128�
129��V�q�w�w�<�=�V��V���3������#���r)rcc���\rSrSr%SrSrSr\R\	\130S'\r\R\131S'\r\R\132S'\r\R\133S'\r\R\134S	'S'S135\R"\S\R&SS
\RSS\	SS4136Sjjr\S137\R"\S\R,\4Sj5r\S\	4Sj5rS\	4Sjr\S\	4Sj5r\S\	4Sj5r\S\	4Sj5r\S\	4Sj5r\S\4Sj5r S\R4Sjr!\S\4Sj5r"\S\RF\RS44Sj5r$\S\RF\RS44Sj5r%S\S\4Sjr&S \RS\4S!jr'S(S"jr(S\RR\RS44S#jr*\+S138\R"\S\,4S$j5r-S\,4S%jr.S&r/g))r3i�z]A wrapper iterable for dynamic ``for`` loops, with information139about the loop and iteration.140�����N�_length�_after�_current�_before�_last_changed_value�iterabler�r9�recurser�depth0r!c�`�XlURU5UlX lX0lX@lg)a141:param iterable: Iterable to wrap.142:param undefined: :class:`Undefined` class to use for next and143    previous items.144:param recurse: The function to render the loop body when the145    loop is marked recursive.146:param depth0: Incremented when looping recursively.147N)�	_iterable�_to_iterator�	_iterator�148_undefined�_recurser�)r%r�r�r�r�s     r&r^�LoopContext.__init__�s*��"���*�*�8�4���#���
��r)c��[U5$r#)�iter�r�s r&r��LoopContext._to_iterator�s���H�~�r)c�n�URbUR$[UR5UlUR$![ai [	UR1495nUR
U5Ul[U5UR-UR[L-UlUR$f=f)z�Length of the iterable.150 151If the iterable is a generator or otherwise does not have a152size, it is eagerly evaluated to get a size.153)154r�r�r��	TypeErrorr�r�r�r�r�r�r%r�s  r&�length�LoopContext.length�s����<�<�#��<�<��	U��t�~�~�.�D�L��|�|����	U��D�N�N�+�H�!�.�.�x�8�D�N��x�=�4�:�:�5����G�9S�T�D�L��|�|��	U�s�A�A%B4�3B4c��UR$r#)r�rks r&�__len__�LoopContext.__len__�s���{�{�r)c� �URS-$)zBHow many levels deep a recursive loop currently is, starting at 1.r)r�rks r&r �LoopContext.depth�����{�{�Q��r)c� �URS-$)z-Current iteration of the loop, starting at 1.r��index0rks r&r��LoopContext.index�r�r)c�4�URUR-155$)zbNumber of iterations from the end of the loop, ending at 0.156 157Requires calculating :attr:`length`.158�r�r�rks r&�	revindex0�LoopContext.revindex0�s���{�{�T�Z�Z�'�'r)c�4�URUR-159$)zbNumber of iterations from the end of the loop, ending at 1.160 161Requires calculating :attr:`length`.162�r�rrks r&�revindex�LoopContext.revindex�s���{�{�T�[�[�(�(r)c� �URS:H$)z0Whether this is the first iteration of the loop.rrrks r&�first�LoopContext.first�s���{�{�a��r)c��UR[LaUR$[UR[5UlUR$)z�Return the next element in the iterable, or :data:`missing`163if the iterable is exhausted. Only peeks one item ahead, caching164the result in :attr:`_last` for use in subsequent checks. The165cache is reset when :meth:`__next__` is called.166)r�r�nextr�rks r&�167_peek_next�LoopContext._peek_next�s6���;�;�g�%��;�;���4�>�>�7�3����{�{�r)c�.�UR5[L$)z�Whether this is the last iteration of the loop.168 169Causes the iterable to advance early. See170:func:`itertools.groupby` for issues this can cause.171The :func:`groupby` filter avoids that issue.172�rrrks r&�last�LoopContext.last�s����� �G�+�+r)c�^�UR(aURS5$UR$)zJThe item in the previous iteration. Undefined during the173first iteration.174zthere is no previous item)rr�r�rks r&�previtem�LoopContext.previtem�s%��175�:�:��?�?�#>�?�?��|�|�r)c�Z�UR5nU[LaURS5$U$)z�The item in the next iteration. Undefined during the last176iteration.177 178Causes the iterable to advance early. See179:func:`itertools.groupby` for issues this can cause.180The :func:`jinja-filters.groupby` filter avoids that issue.181�there is no next item�rrr�r�s  r&�nextitem�LoopContext.nextitems,���_�_�
��
��=��?�?�#:�;�;��	r)r�c�Z�U(d[S5eXR[U5-$)z�Return a value from the given args, cycling through based on182the current :attr:`index0`.183 184:param args: One or more values to cycle through.185zno items for cycling given)r�rr�)r%r�s  r&�cycle�LoopContext.cycles)����8�9�9��K�K�#�d�)�+�,�,r)rWc�2�URU:waXlgg)z�Return ``True`` if previously called with a different value186(including when called for the first time).187 188:param value: One or more values to compare to the last call.189TF)r�)r%rWs  r&�changed�LoopContext.changed"s���#�#�u�,�',�$��r)c��U$r#r$rks r&�__iter__�LoopContext.__iter__.����r)c���UR[LaURn[UlO[UR5nU=RS-
slUR190UlXlX4$�Nr)r�rrr�rr�r�r�s  r&�__next__�LoopContext.__next__1sQ���;�;�g�%����B�!�D�K��d�n�n�%�B����q����}�}����
��x�r)c�z�URc[S5eURXRURS9$)z�When iterating over nested data, render the body of the loop191recursively with the given inner iterable data.192 193The loop must have the ``recursive`` marker for this to work.194zCThe loop must have the 'recursive' marker to be called recursively.)r )r�r�r r�s  r&r'�LoopContext.__call__=s;���=�=� ��U��
��}�}�X�}�}�D�J�J�}�G�Gr)c�h�S[U5RSURSURS3$)Nrgrh�/ri)rjr*r�r�rks r&rl�LoopContext.__repr__Ks0���4��:�&�&�'�q�����A�d�k�k�]�!�D�Dr))195r�r�r�r�r�r�r�r�r�r�rb)r!r3)0r*r+r,r-rorr�r.r�r0�__annotations__rr�rpr�r�r�r/r�Typer^�staticmethodr�r�r�r�r�r r�rr	r�rrrr�rrrr"r%�Tupler*rr1r'rlr2r$r)r&r3r3�s����196�F�#�G�Q�Z�Z��_�#��F�A�E�E���H�a�e�e���G�Q�U�U��!(�����(�15����*�*�Q�-���6�6�+�&�����,�-�	�197��198�
�,��q�z�z�!�}�����A�����������$�����s������s�����(�3�(��(��)�#�)��)�� �t� �� �199�A�E�E�200��,�d�,��,���!�'�'�!�%�%��"4�5�����
�!�'�'�!�%�%��"4�5�
��
�	-�1�	-��	-�201�a�e�e�202��203��204�!�'�'�!�%�%��"6�7�205��H����A��H�3�H��H�E�#�Er)r3c���\rSrSr%\R206\R\S'\S\R\R\\R\4S\R207\4Sj5r
\S\4Sj5r\S\4Sj5r\S\4Sj5rS\R4S	jr\S\4S208j5r\S\R\RS44Sj5rSS
jrS\R0\RS44SjrSrg)r:iOr�r�r!c��[U5$r#r	r�s r&r��AsyncLoopContext._to_iteratorRs���(�#�#r)c��# �URbUR$[UR5UlUR$![az URVs/sShv�NoPM
209Os snfnnURU5Ul[U5UR-UR[L-UlUR$f=f7fr#)	r�r�r�r�r�r�r�r�r)r%r;r�s   r&r��AsyncLoopContext.lengthXs�����<�<�#��<�<��	U��t�~�~�.�D�L��|�|����	U�)-���8�8�A��8��8�H�8�!�.�.�x�8�D�N��x�=�4�:�:�5����G�9S�T�D�L��|�|��	U�sL�C210�A�C211�C�A,�A*�!A$�"A*�&A,�+AC�9
C212�C�C213c��P# �URIShv�NUR-214$N7fr#rrks r&r�AsyncLoopContext.revindex0fs����[�[� �4�:�:�-�-� ���&�$�&c��P# �URIShv�NUR-215$N7fr#rrks r&r	�AsyncLoopContext.revindexjs����[�[� �4�;�;�.�.� �r<c��# �UR[LaUR$URR5IShv�NUlUR$N![a [UlUR$f=f7fr#)r�rr��	__anext__�StopAsyncIterationrks r&r�AsyncLoopContext._peek_nextnsg����;�;�g�%��;�;��	"� $��� 8� 8� :�:�D�K��{�{��	;��!�	"�!�D�K��{�{��	"�s:� A>�A�A�	A�216A>�A�A;�-
A>�:A;�;A>c��J# �UR5IShv�N[L$N2177fr#rrks r&r�AsyncLoopContext.lastys����_�_�&�&�'�1�1�&�s�#�!�#r9c��v# �UR5IShv�NnU[LaURS5$U$N 7f)Nrrr�s  r&r�AsyncLoopContext.nextitem}s5����?�?�$�
$��
��=��?�?�#:�;�;��	�%�s�9�7�!9c��U$r#r$rks r&�	__aiter__�AsyncLoopContext.__aiter__�r'r)c��# �UR[LaURn[UlO"URR5IShv�NnU=RS-
slUR218UlXlX4$N37fr))r�rr�r@rr�r�r�s  r&r@�AsyncLoopContext.__anext__�s`����;�;�g�%����B�!�D�K��~�~�/�/�1�1�B����q����}�}����
��x��2�s�A	B�A?�4B)r�r�r�r�r�N)r!r:)r*r+r,r-r.�
AsyncIteratorrpr1r3r�r/r�
AsyncIterabler�r�r0r�rr	rr�rrrHr4r@r2r$r)r&r:r:Os,�����q�u�u�%�%��$��'�'�!�*�*�Q�-�����);�;�<�$�	219����	�$��$�220��c�����.��.��.��/��/��/�	�!�%�%�	��2�D�2��2���������{�(:� ;�����221�������0B�)B�!C�222r)r:c��\rSrSrSrSSSS\RS\4S\S	\R\S223\	S\	S\	S
\R\	4Sjjr\\
S\RS\RS\4Sj55rS	\R\RS\	S\4SjrS	\R\RS\	S\4SjrS\4SjrSrg)r5i�zWraps a macro function.NrIr�func.r`�	arguments�catch_kwargs�
catch_varargs�caller�default_autoescapec	��XlX l[U5UlX0lX@lXPlX`lXplSU;Ul	Uc8[UR5(aURS5nOURnX�lg)NrS)
�_environment�_funcr��_argument_countr`rPrQrRrS�explicit_caller�callabler��_default_autoescape)	r%rIrOr`rPrQrRrSrTs	         r&r^�Macro.__init__�s}��(���224�"�9�~����	�"��(��*����'�9�4����%���.�.�/�/�%0�%;�%;�D�%A�"�%0�%;�%;�"�#5� r)r�r�r!c225�z�U(a-[US[5(aUSRnUSSnOURn[	USUR2265n[
U5nSnXPR227:waKUR[
U5SH.nURU5nUS:XaSnURU5 M0 OURnUR(aGU(d@URSS5n	U	cURRSSS9n	URU	5 UR (aURU5 OVU(aOSU;a[#SUR$<S	35e[#SUR$<S228['[)U55<35eUR*(aURXR229S5 OI[
U5UR230:�a0[#SUR$<S[
UR5S35eUR-XC5$![a231 [nGN�f=f)
NrrFrSTzNo caller definedr�zmacro zX was invoked with two values for the special caller argument. This is most likely a bug.z takes no keyword argument z takes not more than z argument(s))�232isinstancerr�r[r�rXr�rPr�r�rrBrYrSrVr�rQr�r`rr�rR�_invoke)233r%r�r�r�rP�off�found_callerr`rWrSs234          r&r'�Macro.__call__�s��&�J�t�A�w��4�4��a��+�+�J����8�D��1�1�J���4�� 4� 4�5�6�	��)�n����235�&�&�&����s�9�~�'7�8��$�"�J�J�t�,�E��8�#�#'�L�� � ��'�9� �/�/�L�236�;�;�|��Z�Z��$�/�F��~��*�*�4�4�5H�x�4�X�����V�$�������V�$�
��6�!���T�Y�Y�M�*C�C��������
�%@��d�6�l�AS�@V�W��
�������T�"6�"6�"8�9�:�
��Y��-�-�
-������
�&�����'�(��6��
�237�|�|�I�2�2��I �$�#�E�$�s�H&�&H:�9H:r�c��d# �UR"U6IShv�NnU(a[U5$U$N7fr#)rWr�r%rPr�r�s    r&�
_async_invoke�Macro._async_invokes-����:�:�y�)�
)����"�:���	�*�s�0�.�0c��URR(aURX5$UR"U6nU(a[	U5nU$r#)rVr�rerWrrds    r&r_�
Macro._invokesA�����%�%��%�%�i�<�<�
�Z�Z��
#������B��	r)c��URcSO[UR5nS[U5RSUS3$)N�	anonymousrgrhri)r`�reprrjr*r�s  r&rl�Macro.__repr__s:��"�i�i�/�{�T�$�)�)�_���4��:�&�&�'�q���a�0�0r))238rXr[rVrWrPrSrQrRrYr`r#)r*r+r,r-ror.r�r1r�r�r�r^rrrpr'rer_rlr2r$r)r&r5r5�s��!�04�6�"�6��j�j��c��"�6��	6�239�6�6�#�;�6��
6��6��6��J�J�t�,�6�:��J3�a�e�e�J3�q�u�u�J3��J3���J3�X�Q�V�V�A�E�E�]����QT��	��������	�D�	�S�	�1�#�1r)r5c��\rSrSrSrSrS\S\4S\R\240S\RS\R\241S\R\
S	S4242S243jjr\S	\2444Sj5r\S\RS
\RS	S4Sj5r\S\245S	\R4Sj5r\=r=r=rr\=r=r=rr\=rr\=rr\=r r!\=r"r#\=r$r%\=r&=r'=r(r)\=r*=r+r,\=r-r.S\RS	\/4Sjr0S\RS	\/4Sjr1S	\24Sjr3S	\2464Sjr4S	\24Sjr5S	\Rl\R4Sjr7S	\Rp\R4Sjr9S	\/4Sjr:S	\2474Sjr;Sr<g)r9ia;The default undefined type. This can be printed, iterated, and treated as248a boolean. Any other operation will raise an :exc:`UndefinedError`.249 250>>> foo = Undefined(name='foo')251>>> str(foo)252''253>>> not foo254True255>>> foo + 42256Traceback (most recent call last):257  ...258jinja2.exceptions.UndefinedError: 'foo' is undefined259��_undefined_hint�_undefined_obj�_undefined_name�_undefined_exceptionN�hint�objr`�excr!c�4�XlX lX0lX@lgr#rn)r%rsrtr`rus     r&r^�Undefined.__init__2s�� $��!��#��$'�!r)c�V�UR(aUR$UR[LaUR<S3$[	UR[2605(d%[
UR5SUR<3$[
UR5<SUR<3$)zHBuild a message about the undefined value based on how it was261accessed.262z
 is undefinedz has no element z has no attribute )rorprrqr^r1rrks r&�_undefined_message�Undefined._undefined_message>s���263����'�'�'����'�)��*�*�-�]�;�;��$�.�.��4�4�#�D�$7�$7�8�9�:� �0�0�3�5�
� �� 3� 3�4�7�8��.�.�1�
3�	264r)r�r��te.NoReturnc�8�URUR5e)zURaise an :exc:`UndefinedError` when operations are performed265on the undefined value.266)rrry)r%r�r�s   r&�_fail_with_undefined_error�$Undefined._fail_with_undefined_errorTs���'�'��(?�(?�@�@r)c�\�USSS:XaUSSS:Xa[U5eUR5$�N��__�����)�AttributeErrorr}r�s  r&�__getattr__�Undefined.__getattr__]s9�����8�t���R�S�	�T� 1� ��&�&��.�.�0�0r)�otherc�.�[U5[U5L$r#)rj�r%r�s  r&�__eq__�Undefined.__eq__ss���D�z�T�%�[�(�(r)c�.�URU5(+$r#)r�r�s  r&�__ne__�Undefined.__ne__vs���;�;�u�%�%�%r)c�*�[[U55$r#)�idrjrks r&�__hash__�Undefined.__hash__ys���$�t�*�~�r)c��g)Nr@r$rks r&�__str__�Undefined.__str__|s��r)c��grbr$rks r&r��Undefined.__len__s��r)c#�$# �SShv�N gN7f�Nr$r$rks r&r%�Undefined.__iter__�s����
�
�s���c�(# �SHnS7v� M267 g7fr�r$)r%�_s  r&rH�Undefined.__aiter__�s����A���s�c��g)NFr$rks r&�__bool__�Undefined.__bool__�s��r)c��g)Nr9r$rks r&rl�Undefined.__repr__�s��r))rrrorqrp)=r*r+r,r-ro�	__slots__rrr.r�r1rpr2r
r^r�ryrr}r��__add__�__radd__�__sub__�__rsub__�__mul__�__rmul__�__div__�__rdiv__�__truediv__�__rtruediv__�__floordiv__�
__rfloordiv__�__mod__�__rmod__�__pos__�__neg__r'rd�__lt__�__le__�__gt__�__ge__�__int__�	__float__�__complex__�__pow__�__rpow__r�r�r�r0r�r�r�r�r%rLrHr�rlr2r$r)r&r9r9s����I�!%�� $�,:�268(��j�j��o�269(��U�U�270(��j�j��o�	271(�272�V�V�(�
)�273(�274�
275(��276�C�277��278�*�A��U�U�A�&'�e�e�A�	�A��A��1��1����1��1�/I�H�G�H�h�H��8�.H�H�G�H�h�H��8�!;�;�K�,�#=�=�L�=�3�3�G�h�2�2�G�g�7�7�H�{�(B�B�F�B�V�B�f�v�(B�B�G�B�i�+�3�3�G�h�)�A�E�E�)�d�)�&�A�E�E�&�d�&��#���������!�*�*�Q�U�U�+���������!7���$���#�r)r9�loggerzlogging.Logger�basec��^^�TcISSKnUR"[5mTRUR"[279R55 S[SS4U4Sjjm"UU4SjSU5nU$)a3Given a logger object this returns a new undefined class that will280log certain failures.  It will log iterations and printing.  If no281logger is given a default logger is created.282 283Example::284 285    logger = logging.getLogger(__name__)286    LoggingUndefined = make_logging_undefined(287        logger=logger,288        base=Undefined289    )290 291.. versionadded:: 2.8292 293:param logger: the logger to use.  If not provided, a default logger294               is created.295:param base: the base class to add logging functionality to.  This296             defaults to :class:`Undefined`.297Nr�undefr!c�>>�TRSUR5 g)NzTemplate variable warning: %s)�warningry)r�r�s �r&�_log_message�,make_logging_undefined.<locals>._log_message�s������6��8P�8P�Qr)c��>^�\rSrSrSrS\RS\RSS4UU4SjjrS\4UU4Sjjr	S\R\R4UU4S	jjrS\4UU4S298jjr
SrU=r$)�0make_logging_undefined.<locals>.LoggingUndefinedi�r$r�r�r!r{c�>�[TU]"U0UD6 g!URanTRSU5 UeSnAff=f)NzTemplate variable error: %s)r�r}rr�error)r%r�r��e�	__class__r�s    ��r&r}�Kmake_logging_undefined.<locals>.LoggingUndefined._fail_with_undefined_error�sD���
���2�D�C�F�C���,�,�
����:�A�>����
�s��=�8�=c�0>�T"U5 [TU]5$r#)r�r��r%r�r�s ��r&r��8make_logging_undefined.<locals>.LoggingUndefined.__str__�s�������7�?�$�$r)c�0>�T"U5 [TU]5$r#)r�r%r�s ��r&r%�9make_logging_undefined.<locals>.LoggingUndefined.__iter__���������7�#�%�%r)c�0>�T"U5 [TU]5$r#)r�r�r�s ��r&r��9make_logging_undefined.<locals>.LoggingUndefined.__bool__�r�r))r*r+r,r-r�r.rpr}r1r�r�r%r�r�r2�
__classcell__)r�r�r�s@��r&�LoggingUndefinedr��sr����	�	����	�*+�%�%�	�
�	�	�	%�S�	%�	%�	&�a�j�j����/�	&�	&�	&�d�	&�	&r)r�)�logging�	getLoggerr*�299addHandler�
StreamHandler�sys�stderrr9)r�r�r�r�r�s`   @r&�make_logging_undefinedr��si���,�~���"�"�8�,�����'�/�/��300�301�;�<�R�I�R�$�R�&�&�4�&�0�r)c�N�\rSrSrSrSrS\4SjrS\SS4SjrS\SS4S	jr	Sr302g303)�ChainableUndefinedi�a`An undefined that is chainable, where both ``__getattr__`` and304``__getitem__`` return itself rather than raising an305:exc:`UndefinedError`.306 307>>> foo = ChainableUndefined(name='foo')308>>> str(foo.bar['baz'])309''310>>> foo.bar['baz'] + 42311Traceback (most recent call last):312  ...313jinja2.exceptions.UndefinedError: 'foo' is undefined314 315.. versionadded:: 2.11.0316r$r!c��[U5$r#)r1rks r&r?�ChainableUndefined.__html__�s���4�y�r)r`c�@�USSS:XaUSSS:Xa[U5eU$r�)r�r�s  r&r��ChainableUndefined.__getattr__�s/�����8�t���R�S�	�T� 1� ��&�&��r)�_namec��U$r#r$)r%r�s  r&rd�ChainableUndefined.__getitem__�r'r)N)r*r+r,r-ror�r1r?r�rdr2r$r)r&r�r��sB��
��I��#��317��318�(<�319����)=�r)r�c�*�\rSrSrSrSrS\4SjrSrg)�DebugUndefinedi�z�An undefined that returns the debug info when printed.320 321>>> foo = DebugUndefined(name='foo')322>>> str(foo)323'{{ foo }}'324>>> not foo325True326>>> foo + 42327Traceback (most recent call last):328  ...329jinja2.exceptions.UndefinedError: 'foo' is undefined330r$r!c���UR(aSUR3nOGUR[La
URnO'S[	UR5SUR<S3nSUS3$)Nzundefined value printed: zno such element: �[�]z{{ z }})rorprrqr)r%�messages  r&r��DebugUndefined.__str__�sx�����1�$�2F�2F�1G�H�G�
�
 �
 �G�
+��*�*�G�$�$4�T�5H�5H�$I�#J��D�(�(�+�1�.�
�331�w�i�u�%�%r)N)	r*r+r,r-ror�r1r�r2r$r)r&r�r��s����I�
&��
&r)r�c�x�\rSrSrSrSr\R=r=r	r332\R=r=r=r
r\RrSrg)�StrictUndefinedia3An undefined that barks on print and iteration as well as boolean333tests and all kinds of comparisons.  In other words: you can do nothing334with it except checking if it's defined using the `defined` test.335 336>>> foo = StrictUndefined(name='foo')337>>> str(foo)338Traceback (most recent call last):339  ...340jinja2.exceptions.UndefinedError: 'foo' is undefined341>>> not foo342Traceback (most recent call last):343  ...344jinja2.exceptions.UndefinedError: 'foo' is undefined345>>> foo + 42346Traceback (most recent call last):347  ...348jinja2.exceptions.UndefinedError: 'foo' is undefined349r$N)r*r+r,r-ror�r9r}r%r�r�r�r�r�r�r�r2r$r)r&r�r�sH���&�I�#,�#G�#G�G�H�G�w��,5�,P�,P�P�F�P�V�P�h���7�7�Lr)r�)NFNN)Grorwr��typingr.�collectionsr�	itertoolsr�350markupsaferrr�async_utilsr351r�352exceptionsrr
r�nodesr�utilsrrrrrrr�TypeVarrr�rpr�
TYPE_CHECKINGr��typing_extensions�terIr�Protocolr�exported�async_exportedr8r/r1r6r7r�r�r�r�r��MappingrXr4rz�registerrLrcr3r:r5r9r2r�r�r�r�r$r)r&�<module>rs���A��353�������#�#�(�,�&�������#�$��I�I�c�N���I�I�c����C����J�/�0���?�?��"�(�������� ��
��
�a�
��Q�Z�Z����&��3��!�!�*�*�Q�U�U�#�!��!�,0��8<�04�����:�:�c�?��
�F�F�3��354�355�I�;��356�357�3��#?�@�@�A���*�*�Q�V�V�C����J�'�358(�	�359
���Z�Z��(�(��a�e�e��4�
5�
�
�J�J�q�y�y��a�e�e��,�-����:B�B��!���������DN�DN��DN�N/�/�dBE�BE�JD�{�D�NC1�C1�Lq�q�j,0�9�7�
�J�J�'�(�7�78�v�v�i�7H�7��V�V�I��7�t"��"�J&�Y�&�@8�i�8r)
codekingpro/portable-devtools · Team Ai