AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /snap/core20/2599/lib/python3/dist-packages/jinja2/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /snap/core20/2599/lib/python3/dist-packages/jinja2/__pycache__/asyncsupport.cpython-38.pyc
U

sݨ\��@sdZddlZddlZddlZddlmZddlmZmZm	Z	ddl
mZddlm
Z
mZdd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Zedd��Zdd�Zd.dd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZGd(d)�d)e
�ZGd*d+�d+e �Z!d/d,d-�Z"dS)0z�
    jinja2.asyncsupport
    ~~~~~~~~~~~~~~~~~~~

    Has all the code for async support which is implemented as a patch
    for supported Python versions.

    :copyright: (c) 2017 by the Jinja Team.
    :license: BSD, see LICENSE for more details.
�N��update_wrapper)�concat�internalcode�Markup)�TemplateModule)�LoopContextBase�_last_iterationc�s&g���fdd�}|�IdHt��S)Nc�s"�2z3dHW}��|�q6dS�N)�append)�event��	async_gen�rv��5/usr/lib/python3/dist-packages/jinja2/asyncsupport.py�collectszconcat_async.<locals>.collect)r)rrrr
r�concat_asyncsrcOsjt||�}z*|�|�|��2z3dHW}|Vq6Wntk
rPt��}YnXdS|j�|d�VdS)NT)�dict�root_render_func�new_context�	Exception�sys�exc_info�environment�handle_exception)�self�args�kwargs�varsrrrrr�generate_asyncs
r cs dd����fdd�}t|��S)Ncss<|j||�}z|�|���VqWntk
r6YnXdSr
)r �run_until_complete�	__anext__�StopAsyncIteration)r�looprrrrrr�_convert_generator,s
z.wrap_generate_func.<locals>._convert_generatorcs*|jjs�|f|�|�S�|t��||�Sr
)r�is_async�asyncio�get_event_loop)rrr�r%�original_generaterr�generate3sz$wrap_generate_func.<locals>.generater)r*r+rr)r�wrap_generate_func+sr,c�sf|jjstd��t||�}|�|�}zt|�|��IdHWStk
rVt�	�}YnX|j�
|d�S)Nz8The environment was not created with async mode enabled.T)rr&�RuntimeErrorrrrrrrrr)rrrr�ctxrrrr�render_async:s

r/cs�fdd�}t|��S)Ncs2|jjs�|f|�|�St��}|�|j||��Sr
)rr&r'r(r!r/)rrrr$��original_renderrr�renderJsz wrap_render_func.<locals>.renderr)r1r2rr0r�wrap_render_funcIsr3cs(tdd���t��fdd��}t|��S)Nc�s2t|j|j|j��IdH}|jjjr.t|�}|Sr
)rZ_stackZ_depth�_contextZeval_ctx�
autoescaper�rrrrr�
async_callSs
z-wrap_block_reference_call.<locals>.async_callcs|jjjs�|�S�|�Sr
)r4rr&�r�r7�
original_callrr�__call__Zs
z+wrap_block_reference_call.<locals>.__call__�rr)r:r;rr9r�wrap_block_reference_callRs

r=cs(tdd���t��fdd��}t|��S)Nc�s |j|�IdH}|rt|�}|Sr
)Z_funcr)r�	argumentsr5rrrr�async_invokedsz'wrap_macro_invoke.<locals>.async_invokecs |jjs�|||�S�|||�Sr
)Z_environmentr&)rr>r5�r?�original_invokerr�_invokeksz"wrap_macro_invoke.<locals>._invoker<)rArBrr@r�wrap_macro_invokecs

rCc�s(|jdk	r|jS|��IdH|_}|Sr
)�_module�make_module_asyncr6rrr�get_default_module_asyncss
rFcst�fdd��}|S)Ncs|jjrtd���|�S)Nz6Template module attribute is unavailable in async mode)rr&r-r8��original_default_modulerr�_get_default_module|sz0wrap_default_module.<locals>._get_default_module)r)rHrIrrGr�wrap_default_module{srJFc�sB|�|||�}g}|�|�2z3dHW}|�|�q6t|||�Sr
)rrrr)rrZshared�locals�contextZbody_stream�itemrrrrE�s
rEcCsdddlm}t|j�|_tt|j�|_tt|j�|_t|j�|_t	|j
�|_
t|_tt
|j
�|_
dS)Nr��Template)Zjinja2rOr,r+rr r/r3r2rJrIrFZ_get_default_module_asyncrErNrrr�patch_template�s&����rPcCs,ddlm}m}t|j�|_t|j�|_dS)Nr��BlockReference�Macro)�jinja2.runtimerRrSr=r;rCrBrQrrr�
patch_runtime�s
�rUcCs&ddlm}ddlm}|�|�dS)Nr)�FILTERS)�
ASYNC_FILTERS)Zjinja2.filtersrVZjinja2.asyncfiltersrW�update)rVrWrrr�
patch_filters�srYcCst�t�t�dSr
)rPrUrYrrrr�	patch_all�srZc�st�|�r|IdHS|Sr
)�inspectZisawaitable)�valuerrr�
auto_await�s

r]cCs<t|d�r(|2z3dHW}|Vq6dS|D]
}|Vq,dS�N�	__aiter__)�hasattr)�iterablerMrrr�
auto_aiter�s

rbc@s*eZdZd	dd�Zedd��Zdd�ZdS)
�AsyncLoopContextNrcCs&t�||||�||_||_||_dSr
)r�__init__�_async_iterator�_after�_length)r�async_iterator�	undefined�after�length�recurse�depth0rrrrd�szAsyncLoopContext.__init__cCs|jdkrtd��|jS)NzHLoop length for some iterators cannot be lazily calculated in async mode)rg�	TypeErrorr8rrrrk�s
zAsyncLoopContext.lengthcCst|�Sr
)�AsyncLoopContextIteratorr8rrrr_�szAsyncLoopContext.__aiter__)Nr)�__name__�
__module__�__qualname__rd�propertyrkr_rrrrrc�s�

rcc@s(eZdZdZdd�Zdd�Zdd�ZdS)	ro�rLcCs
||_dSr
rt)rrLrrrrd�sz!AsyncLoopContextIterator.__init__cCs|Sr
rr8rrrr_�sz"AsyncLoopContextIterator.__aiter__c�sp|j}|jd7_|jtkr$t��|j|_|j|_z|j��IdH|_Wntk
rdt|_YnX|j|fS)N�)	rLZindex0rfr	r#Z_currentZ_beforerer")rr.rrrr"�s
z"AsyncLoopContextIterator.__anext__N)rprqrr�	__slots__rdr_r"rrrrro�sroc	�s�zt|�}Wn8ttfk
rDt|d�s<t|�}t|�}nd}YnXt|�}z|��IdH}Wntk
rxt}YnXt	||||||�Sr^)
�lenrn�AttributeErrorr`�tuplerbr"r#r	rc)rarirlrmrkrhrjrrr�make_async_loop_context�s	



�rz)NFN)Nr)#�__doc__rr'r[�	functoolsrZjinja2.utilsrrrZjinja2.environmentrrTrr	rr r,r/r3r=rCrFrJrErPrUrYrZr]rbrc�objectrorzrrrr�<module>s6
		


	

Anon7 - 2022
AnonSec Team