Your IP : 3.139.234.68


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/cgitb.cpython-312.opt-1.pyc

�

�Q�f�0��
�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Zejed��d�ZgZd�Zd�Zd	�Zd
�Zd�Zdd�Zdd
�ZGd�d�Ze�j4Zdd�Zy)a�More comprehensive traceback formatting for Python scripts.

To enable this module, do:

    import cgitb; cgitb.enable()

at the top of your script.  The optional arguments to enable() are:

    display     - if true, tracebacks are displayed in the web browser
    logdir      - if set, tracebacks are written to files in this directory
    context     - number of lines of source code to show for each stack frame
    format      - 'text' or 'html' controls the output format

By default, tracebacks are displayed but not saved, the context is 5 lines
and the output format is 'html' (for backwards compatibility with the
original use of this module)

Alternatively, if you have caught an exception and want cgitb to display it
for you, call cgitb.handler().  The optional argument to handler() is a
3-item tuple (etype, evalue, etb) just like the value of sys.exc_info().
The default handler displays output as HTML.

�N)�escape)��
)�removec��y)zAReturn a string that resets the CGI and browser to a known state.a'<!--: spam
Content-Type: text/html

<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> -->
<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> -->
</font> </font> </font> </script> </object> </blockquote> </pre>
</table> </table> </table> </table> </table> </font> </font> </font>�r��,/opt/alt/python312/lib64/python3.12/cgitb.py�resetr(s��Hr	c��|rd|zdzSy)Nz<small>z</small>�r��texts r
�smallr3s����4��*�,�,�r	c��|rd|zdzSy)Nz<strong>z	</strong>r
rrs r
�strongr9s����D� �;�.�.�r	c��|rd|zdzSy)Nz<font color="#909090">z</font>r
rrs r
�greyr?s���'�$�.��:�:�r	c��||vrd||fS||jvrd|j|fSd|jvrL|jd}t|t�r||vrd||fSdt
fSt||�rdt	||�fSdt
fS)z9Find the value for a given name in the given environment.�local�global�__builtins__�builtinN)�	f_globals�
isinstance�dict�hasattr�getattr�	__UNDEF__)�name�frame�locals�builtinss    r
�lookupr$Es����v�~���t��$�$��u���������.�.�.�����(��?�?�>�2���h��%��x�� �(�4�.�0�0���?���x��&� �'�(�D�"9�9�9���?�r	c���gdddtf\}}}}}tj|�D]�\}}	}
}}|tjk(r|S|tjk(rm|	t
jvr[|dk(r1|turct||	t�}|j||	z||f�n:t|	||�\}
}|j|	|
|f�n|	dk(r||dzz
}|}nd\}}|	}��|S)zEScan one logical line of Python and look up values of variables used.Nr
�.)Nr
)
r�tokenize�generate_tokens�NEWLINE�NAME�keyword�kwlistr�appendr$)�readerr!r"�vars�	lasttoken�parent�prefix�value�ttype�token�start�end�line�wheres              r
�scanvarsr:Us���-/��t�R��-J�*�D�)�V�V�U�*2�*B�*B�6�*J�&��u�e�S�$��H�$�$�$�e��K��H�M�M�!�e�7�>�>�&A��C����*�#�F�E�9�=�E��K�K��%���� ?�@�%�e�U�F�;���u����U�E�5�1�2�
�c�\��i�#�o�%�F��F�%�N�F�F��	�+K� �Kr	c�Z	�"�#�|\}}}t|t�r|j}dtjj�dzdztjz}tjtj��}dtt|���d|�d|�d�}dtd	�zd
z}g}	tj||�}
|
D�]�\}�"}}
}}�"rFtjj!�"��"d�"�dt"j$j'�"��d
�}ndx�"}tj(|�\}}}}d}|
dk7rNdt+t"j$j'|
��z}|
dk7r|tj,||||d���z
}i�#|gf�"�#fd�	}t/|||�}dd�|�d|�d�g}|��||z
}|D]�}tddt1t|��z
zt|�z�dz}|�#vr:d|�t"j$j3|��d�}|j5d|z�nBd|�t"j$j3|��d�}|j5d t7|�z�|d!z
}��ig}}|D]�\}}} ||vr�d!||<| t8ur{|d"vrd#|zt+|�z}n1|d$k(rt+|�}n |t+|jd%�d&�z}|j5|�d't"j$j;| ������|j5|d(z���|j5d tt7d)j=|���z�|	j5d*d+j=|�z����d,t+t"j$j't|����dt"j$j't|����g}!t?|�D]M}|dd!d-k(r�t"j$j;tA||��} |!j5d.|�|�d/| ����O|dj=|	�zdj=|!�zd0t"j$j'dj=tCjD|||���zzS)1z9Return a nice HTML document describing a given traceback.�Python r�: z�
<body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#6622aa">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br>
<big><big><strong>zo</strong></big></big></font></td>
<td align=right valign=bottom>
<font color="#ffffff" face="helvetica, arial">z<br>z�</font></td>
</tr></table>
<p>A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.</p>z<tt>z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z&nbsp;</tt>z<a href="file://z">z</a>�?r
�in �<module>c�F�dtjj|�zS�N�=)�pydoc�html�repr�r3s r
�<lambda>zhtml.<locals>.<lambda>����c�E�J�J�O�O�E�4J�.Jr	��formatvaluec���d�|d<tj�|d�|dxxdz
cc<S#|dxxdz
cc<wxYw�N�r��	linecache�getline��lnum�file�	highlights ��r
r.zhtml.<locals>.reader��@���!"�I�d�1�g��!�)�)�$��Q��8��!�W��\�W��T�!�W��\�W���0�?z<tr><td bgcolor="#d8bbff">z<big>&nbsp;</big>� z
</td></tr>Nz&nbsp;�z	<tt>=&gt;z</tt>z&<tr><td bgcolor="#ffccee">%s</td></tr>z<tt>&nbsp;&nbsp;z<tr><td>%s</td></tr>rN)rrz<em>%s</em> rr&���z&nbsp;= z <em>undefined</em>z, zF
<table width="100%%" cellspacing=0 cellpadding=0 border=0>
%s</table>�
z<p>�_z
<br>z&nbsp;=
z�


<!-- The above is a description of an error in a Python program, formatted
     for a web browser because the 'cgitb' module was enabled.  In case you
     are not reading this in a web browser, here is the original traceback:

%s
-->
)#r�type�__name__�sys�version�split�
executable�time�ctime�html_escape�strr�inspect�getinnerframes�os�path�abspathrDrEr�getargvaluesr�formatargvaluesr:�len�	preformatr-rrrF�join�dirr�	traceback�format_exception)$�einfo�context�etype�evalue�etb�pyver�date�head�indent�frames�recordsr!rS�func�lines�index�link�args�varargs�varkwr"�callr.r/�rows�ir8�num�done�dumpr r9r3�	exceptionrTrUs$                                  @@r
rErEjsU�����E�6�3��%�����������)�)�+�A�.�.��5����F�E��:�:�d�i�i�k�"�D���s�5�z�*�+�,/�/4�g�T�$��@H�K�D��e�L�)�
)�M�
9�F�
�F��$�$�S�'�2�G�18�-��t�T�4�����7�7�?�?�4�(�D�37����9J�9J�4�9P�Q�D���D�4�'.�';�';�E�'B�$��g�u�f����3�;��6�%�*�*�"3�"3�D�"9�:�:�D��z�!���/�/��g�u�f� J�L�L���	���	"����v�.��%�d�D�2�3�����u��A����H��#�c�!�f�+�
�6��Q��?�@�8�K���	�>�36��
�
�8L�8L�T�8R�S�D��K�K� H�4� O�P�"�;>�u�z�z�?S�?S�TX�?Y�Z�D��K�K� 6��d�� C�D��Q������d��"&��D�%���t�|�X��D��J��I�%��1�1�*�U�2�f�T�l�B�D��g�%�!�$�<�D� �6�$�*�*�S�/�"�*=�#>�>�D����d�E�J�J�O�O�E�4J�K�L����D�#8�8�9�#'�	
���*�U�4��	�	�$��3H�-I�I�J��
�
���	�	�$�� �	!�g29�n!'�u�z�z�'8�'8��U��'D� E� %�
�
� 1� 1�#�f�+� >�@�A�I��F������8�s�?�H��
�
������ 5�6�����F�D�%�H�I��
�"�'�'�&�/�!�B�G�G�I�$6�6�	:��j�j���
�'�'�)�,�,�U�F�C�@�
A�C�
:C�
C�
Cr	c	�:� �!�|\}}}t|t�r|j}dtjj�dzdztjz}tjtj��}t|��d|�d|�d�dz}g}tj||�}	|	D�]�\}
� }}}
}� xrtjj� �xsd� tj|
�\}}}}d}|dk7r(d|z}|d	k7r|tj ||||d
���z
}i�!|gf� �!fd�	}t#||
|�}d
� �d
|��g}|�8||z
}|
D].}d|z}|j%||j'�z�|dz
}�0ig}}|D]�\}}}||vr�d||<|t(ur[|dk(rd|z}n|dk7r||jd�dz}|j%|�dt*j,j/|�����t|j%|dz���|j%dj1|��|j%ddj1|�z����t|��dt|���g}t3|�D]D}t*j,j/t5||��}|j%dd�|�d|����F|dj1|�zdj1|�zddj1t7j8|||��zzS)z:Return a plain text document describing a given traceback.r<rr=r[z�
A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.
r>r
r?r@c�F�dtjj|�zSrB)rDrrFrGs r
rHztext.<locals>.<lambda>�rIr	rJc���d�|d<tj�|d�|dxxdz
cc<S#|dxxdz
cc<wxYwrMrOrRs ��r
r.ztext.<locals>.reader�rVrWrXz%5d rNrzglobal rr&rZz = z
 undefinedz
%s
z    zc

The above is a description of an error in a Python program.  Here is
the original traceback:

%s
)rr]r^r_r`rarbrcrdrfrgrhrirjrkrlrmr:r-�rstriprrDrrFrprqrrrrs)"rtrurvrwrxryrzr{r}r~r!rSrr�r�r�r�r�r"r�r.r/r�r�r8r�r�r�r r9r3r�rTrUs"                                @@r
rr�s������E�6�3��%�����������)�)�+�A�.�.��5����F�E��:�:�d�i�i�k�"�D� ��Z���5�9��D�
�F��$�$�S�'�2�G�18�-��t�T�4����-�������-�4���'.�';�';�E�'B�$��g�u�f����3�;��4�<�D��z�!���/�/��g�u�f� J�L�L���	���	"����v�.�� �$�'�(�����u��A����q�j�����C����
�-�.��Q����
��d��"&��D�%���t�|�X��D��J��I�%��H�$�Y��-=�d��g�%�e�d�j�j��o�b�6I�.I�t�����u�z�z���u�/E�F�G����D�<�/�0�#'�	
���D�I�I�d�O�$��
�
�h����4��0�1�K29�N!��Z��V��5�6�I��F����
�
������ 5�6�����%��u�=�>���"�'�'�&�/�!�B�G�G�I�$6�6�:�	�g�g�i�(�(����<�=�
:>�>�>r	c�*�eZdZdZ		dd�Zd�Zdd�Zy)�Hookz?A hook to replace sys.excepthook that shows tracebacks in HTML.Nc�n�||_||_||_|xstj|_||_y�N)�display�logdirrur_�stdoutrT�format)�selfr�r�rurTr�s      r
�__init__z
Hook.__init__s.������������&�C�J�J��	���r	c�,�|j|||f�yr�)�handle)r�rvrwrxs    r
�__call__z
Hook.__call__s�����U�F�C�(�)r	c�j�|xstj�}|jdk(r#|jj	t��|jdk(xrtxst}d}	|||j�}|jrb|rAtjj|�}|jj	d|zdz�n:|jj	|dz�n|jj	d�|j��d	d
g|jdk(}t!j"||j��\}}	t%j&|d�5}|j	|�ddd�d
|z}	|jdk(r|jj	d|	z�n|jj	|	dz�	|jj)�y#djtj|��}d}Y���xYw#1swY��xYw#d|z}	Y��xYw#YyxYw)NrEFr
Tz<pre>z</pre>
r[z*<p>A problem occurred in a Python script.
z.txtz.html)�suffixrq�wz*%s contains the description of this error.z*Tried to save traceback to %s, but failed.z
<p>%s</p>
)r_�exc_infor�rT�writerrErrurprrrsr�rDrr��tempfile�mkstempri�fdopen�flush)
r��info�	formatter�plain�docr��fdrjrT�msgs
          r
r�zHook.handles����%�s�|�|�~���;�;�&� ��I�I�O�O�E�G�$��[�[�&�(�2�d�:�d�	���	��D�$�,�,�/�C�
�<�<���j�j�'�'��,���	�	����#�
�
� :�;��	�	����d�
�+��I�I�O�O�I�J��;�;�"��g�&�t�{�{�F�':�;�F�!�)�)��T�[�[�I�J�R��
J��Y�Y�r�3�'�4��J�J�s�O�(�B�T�I���{�{�f�$��	�	���
�� 3�4��	�	����d�
�+�	��I�I�O�O���;	��'�'�)�4�4�d�;�<�C��E�� (�'��
J�B�T�I���	��s<�-G+�H"�$H�6
H"�H.�+%H�H�H"�"H+�.H2)rNNrYNrEr�)r^�
__module__�__qualname__�__doc__r�r�r�rr	r
r�r�
s��I�?C���*�'r	r�c�4�t||||��t_y)aInstall an exception handler that formats tracebacks as HTML.

    The optional argument 'display' can be set to 0 to suppress sending the
    traceback to the browser, and 'logdir' can be set to a directory to cause
    tracebacks to be written to files there.�r�r�rur�N)r�r_�
excepthookr�s    r
�enabler�Es���'�&�")�&�:�C�Nr	)rY)rNNrYrE)r�rgr+rPrirDr_r�rcr'rr�warningsrErre�_deprecatedr^rrrrrr$r:rr�r��handlerr�rr	r
�<module>r�s����.���	��
������&�����X�g�.�H�
�	����� �*_C�B@>�D5�5�n�&�-�-��:r	

?>