Sindbad~EG File Manager
�
(ٜg��
�J�ddlZddlZddlmZddlmZddlmZddlm Z ddlm
Z
ejrddlm
Z
dd ejed
efd�Zded
ejededed
ef
d�Zdej(eej*fd
ej,eej*ffd�Zy)�N)�CodeType)�
TracebackType�)�TemplateSyntaxError)�
internal_code)�missing)�Context�source�returnc�@�tj�\}}}tjt|�}tjt
|�}t
|t�rR|jsFd|_||_ |jd�t|d|jxsd|j�}n|j}g}|��|jj t"vr
|j}�+|jj$j'd�}|�E|j)|j*�}t|||j|�}|j-|�n|j-|�|j}|���d}t/|�D]}||_|}�
|j|�S)axRewrite the current exception to replace any tracebacks from
within compiled template code with tracebacks that look like they
came from the template source.
This must be called within an ``except`` block.
:param source: For ``TemplateSyntaxError``, the original source if
known.
:return: The original exception with the rewritten traceback.
TNz <unknown>�__jinja_template__)�sys�exc_info�t�cast�
BaseExceptionr�
isinstancer�
translatedr
�with_traceback�fake_traceback�filename�lineno�tb_next�tb_frame�f_coder� f_globals�get�get_corresponding_lineno� tb_lineno�append�reversed) r
�_� exc_value�tb�stack�templater�fake_tbrs �7/usr/local/lib/python3.12/site-packages/jinja2/debug.py�rewrite_traceback_stackr)so���|�|�~��A�y�"����}�i�0�I�
���
�r� "�B��)�0�1�)�:N�:N�#� ��!� �� � � ��&���t�Y�/�/�>�;� �@P�@P�
��
�Z�Z���E�
�.��;�;����.����B���;�;�(�(�,�,�-A�B�����6�6�r�|�|�D�F�$�Y��H�4E�4E�v�N�G��L�L��!��L�L���
�Z�Z��!
�.�$�G��u�o����
�����#�#�G�,�,�r#r$rrc�D�|�2t|jj�}|jdd�ni}|||d�}t d|dz
zdz|d�}d}|�A|jj
j}|d k(rd
}n|jd�rd|d
d��}tjdk\r|j|��}n�t|j|j|j|j|j |j"|j$|j&|j(|j*||j,|j.|j0|j2�} t5|||�y#t6$r$tj8�dj:cYSwxYw)a,Produce a new traceback object that looks like it came from the
template source instead of the compiled code. The filename, line
number, and location name will point to the template, and the local
variables will be the current template context.
:param exc_value: The original exception to be re-raised to create
the new traceback.
:param tb: The original traceback to get the local variables and
code info from.
:param filename: The template filename.
:param lineno: The line number in the template source.
N�__jinja_exception__)�__name__�__file__r,�
rzraise __jinja_exception__�execr&�rootztop-level template code�block_zblock �)��)�co_name�)�get_template_localsr�f_locals�pop�compilerr6�
startswithr�version_info�replacer�co_argcount�co_kwonlyargcount�
co_nlocals�co_stacksize�co_flags�co_code� co_consts�co_names�co_varnames�co_filename�co_firstlineno� co_lnotab�co_freevars�co_cellvarsr0rrr) r#r$rr�locals�globals�code�location�functions r(rrLs���
�~�%�R�[�[�%9�%9�:���
�
�(�$�/�����(��G�����
��9�9�8�V��D��H� �~��;�;�%�%�-�-���v��0�H�
�
�
��
*������/�0�H�
���6�!��|�|�H�|�-�������"�"��O�O�����M�M��L�L��N�N��M�M������������N�N�������
��()��T�7�F�#���)��|�|�~�a� �(�(�(�)�s�$
E2�2*F�F�real_localsc���|jd�}|�|j�j�}ni}i}|j�D]c\}}|j d�r|t
ur� |j
dd�\}}}t|�}|j|d�d} | |ks�]||f||<�e|j�D](\}\}}|t
ur|j|d��$|||<�*|S#t$rY��wxYw)zlBased on the runtime locals, get the context that would be
available at that point in the template.
�contextN�l_r"r7)���r)
r�get_all�copy�itemsr<r�split�int�
ValueErrorr:)
rR�ctx�data�local_overrides�name�valuer"� depth_str�depth� cur_depths
r(r8r8�s��
+���y�9�C�
��#&�;�;�=�#5�#5�#7����9;�O�"�(�(�*���e����t�$���(8�� �!%���C��!3��A�y�$�� �N�E�$�'�'��e�4�Q�7� ��u��%*�E�N�O�D�!�+�",�1�1�3���j�q�%��G���H�H�T�4� ��D��J� 4��K��� �� �s�(!C*�* C6�5C6)N)r�typingr�typesrr�
exceptionsr�utilsrr�
TYPE_CHECKING�runtimer �Optional�strrr)r[r�Mapping�Any�Dictr8�r*r(�<module>rqs���
����+� ���?�?� �;-�A�J�J�s�O�;-�}�;-�|G)��G)�"#�*�*�]�";�G)�GJ�G)�TW�G)��G)�T)�Q�Y�Y�s�A�E�E�z�%:�)�q�v�v�c�1�5�5�j�?Q�)r*
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists