관리-도구
편집 파일: async_utils.cpython-311.pyc
� �܋f� � � � d dl Z d dlZd dlmZ ddlmZ ddlmZ ej d� � Z d� Z eee eeee ed� � hZdej ej d df d dfd �Z dd�Zddd ej d fd�ZdS )� N)�wraps� )�_PassArg)�pass_eval_context�Vc � � � � fd�}|S )Nc �" �� ��� t j �� � }|d u �|t j u rdt j dt fd��ndt j dt fd��t �� � � ���fd�� � }�rt |� � }d|_ |S )N�args�returnc �L � t j t | d j � � S �Nr )�t�cast�bool�is_async�r s �I/opt/cloudlinux/venv/lib64/python3.11/site-packages/jinja2/async_utils.pyr z2async_variant.<locals>.decorator.<locals>.is_async s � ��v�d�D��G�$4�5�5�5� c �V � t j t | d j j � � S r )r r r �environmentr r s r r z2async_variant.<locals>.decorator.<locals>.is_async s � ��v�d�D��G�$7�$@�A�A�Ar c �V �� �| � � }�r | dd � } |r �| i |��S �| i |��S )Nr � )r �kwargs�b� async_funcr �need_eval_context�normal_funcs ����r �wrapperz1async_variant.<locals>.decorator.<locals>.wrapper sW �� ������A� � ��A�B�B�x��� 3�!�z�4�2�6�2�2�2��;��/��/�/�/r T) r �from_objr r �Anyr r r �jinja_async_variant)r �pass_argr r r r s ` @@�r � decoratorz async_variant.<locals>.decorator s� ����� ��$�[�1�1��$��,���x�+�+�+� 6�q�u� 6�� 6� 6� 6� 6� 6� B�q�u� B�� B� B� B� B� �{� � � 0� 0� 0� 0� 0� 0� 0� � � 0� � 1�'��0�0�G�&*��#��r r )r r# s ` r � async_variantr$ s% �� �� � � � �@ �r �valuer c � �� K � t | � � t v rt j d| � � S t j | � � rt j d| � � � d {V ��S t j d| � � S )Nr zt.Awaitable[V])�type�_common_primitivesr r �inspect�isawaitable�r% s r � auto_awaitr, 2 st � � � ��E�{�{�(�(�(��v�c�5�!�!�!���5�!�!� 5��V�,�e�4�4�4�4�4�4�4�4�4��6�#�u���r �iterable�*t.Union[t.AsyncIterable[V], t.Iterable[V]]�t.AsyncIterator[V]c � K � t | d� � r%t j d| � � 2 3 d {V ��}|W V � � 6 d S t j d| � � D ]}|W V � �d S )N� __aiter__zt.AsyncIterable[V]z t.Iterable[V])�hasattrr r )r- �items r � auto_aiterr4 = s� � � � � �x��%�%� ��&�!5�x�@�@� � � � � � � �$��J�J�J�J�J� A�@�@� �F�?�H�5�5� � �D��J�J�J�J�J� � s �5c � �D K � d� t | � � 2 � � � d {V ��S )Nc � �"