ok

Mini Shell

Direktori : /opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/__pycache__/cgitb.cpython-311.opt-1.pyc

�

�f�0��
�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Zejed���d�ZgZd�Zd�Zd	�Zd
�Zd�Zdd
�Zdd�ZGd�d��Ze��jZdd�ZdS)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��dS)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/python311/lib64/python3.11/cgitb.py�resetr(s��H�Hr	c��|rd|zdzSdS)Nz<small>z</small>�r��texts r
�smallr3s�����4��*�,�,��rr	c��|rd|zdzSdS)Nz<strong>z	</strong>r
rrs r
�strongr9s�����D� �;�.�.��rr	c��|rd|zdzSdS)Nz<font color="#909090">z</font>r
rrs r
�greyr?s����'�$�.��:�:��rr	c�*�||vr
d||fS||jvrd|j|fSd|jvr\|jd}t|��ti��ur||vr
d||fSn"t||��rdt||��fSdtfS)z9Find the value for a given name in the given environment.�local�global�__builtins__�builtinN)�	f_globals�type�hasattr�getattr�	__UNDEF__)�name�frame�locals�builtinss    r
�lookupr#Es����v�~�~���t��$�$��u��������.�.�.����(�(��?�>�2����>�>�T�"�X�X�%�%��x��� �(�4�.�0�0� ��x��&�&�
:� �'�(�D�"9�"9�9�9���?�r	c���gdddtf\}}}}}tj|��D]�\}}	}
}}|tjkrn�|tjkr||	t
jvrn|dkr;|tur1t||	t��}|�||	z||f��nCt|	||��\}
}|�|	|
|f��n|	dkr||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
�scanvarsr9Us��-/��t�R��-J�*�D�)�V�V�U�*2�*B�6�*J�*J���&��u�e�S�$��H�$�$�$�e�e��H�M�!�!�e�7�>�&A�&A��C�����*�*�#�F�E�9�=�=�E��K�K��%���� ?�@�@�@��%�e�U�F�;�;���u����U�E�5�1�2�2�2�2�
�c�\�\��i�#�o�%�F��F�F�%�N�F�F��	�	��Kr	�c�^
�"�#�|\}}}t|t��r|j}dtj���dzdztjz}tjtj����}dtt|�����d|�d|�d�}dtd	��zd
z}g}	tj
||��}
|
D�]\}�"}}
}}�"rFtj��"���"d�"�dt"j��"���d
�}ndx�"}tj|��\}}}}d}|
dkrRdt+t"j�|
����z}|
dkr|tj||||d����z
}i�#|gf�"�#fd�	}t/|||��}dd�|�d|�d�g}|��||z
}|D]�}tddt1t|����z
zt|��z��dz}|�#vr>d|�t"j�|���d�}|�d|z��nJd|�t"j�|���d�}|�d t7|��z��|d!z
}��ig}}|D]�\}}} ||vr�d!||<| t8ur�|d"vrd#|zt+|��z}nA|d$krt+|��}n+|t+|�d%��d&��z}|�|�d't"j�| ��������|�|d(z����|�d tt7d)�|������z��|	�d*d+�|��z����
d,t+t"j�t|�������dt"j�t|������g}!t?|��D][}|dd!�d-kr�t"j�tA||����} |!�d.|�|�d/| �����\|d�|	��zd�|!��zd0t"j�d�tCj"|||������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�dtj�|��zS�N�=)�pydoc�html�repr�r2s r
�<lambda>zhtml.<locals>.<lambda>����c�E�J�O�O�E�4J�4J�.J�r	��formatvaluec���d�|d<tj�|d��|dxxdz
cc<S#|dxxdz
cc<wxYw�N�r��	linecache�getline��lnum�file�	highlights ��r
r-zhtml.<locals>.reader��Y���!"�I�d�1�g��!�)�$��Q��8�8��!�W�W�W��\�W�W�W�W��T�!�W�W�W��\�W�W�W�W�W�W�W�	�8�A
z<tr><td bgcolor="#d8bbff">z<big>&nbsp;</big>� z
</td></tr>Nz&nbsp;r: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
-->
)#�
isinstancer�__name__�sys�version�split�
executable�time�ctime�html_escape�strr�inspect�getinnerframes�os�path�abspathrDrEr�getargvaluesr�formatargvaluesr9�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�ir7�num�done�dumprr8r2�	exceptionrTrUs$                                  @@r
rErEjs�������E�6�3��%�����������)�)�+�+�A�.�.��5���F�E��:�d�i�k�k�"�"�D�K��s�5�z�z�*�*�
K�K�05�K�K�;?�K�K�K�D��e�L�)�)�
)�M�
9�F�
�F��$�S�'�2�2�G�18�5!�5!�-��t�T�4����	��7�?�?�4�(�(�D�D�37�4�4���9J�9J�4�9P�9P�9P�9P�Q�D�D���D�4�'.�';�E�'B�'B�$��g�u�f����3�;�;��6�%�*�"3�"3�D�"9�"9�:�:�:�D��z�!�!���/��g�u�f� J� J�L�L�L�L���	���	"�	"�	"�	"�	"�	"�	"����v�.�.���%�$�d�d�d�D�D�D�2�3�����u��A��
�
���H��#�c�!�f�f�+�+�
�6��Q���?�@�@�8�K���	�>�>�>�36�3��
�8L�8L�T�8R�8R�8R�8R�S�D��K�K� H�4� O�P�P�P�P�"�;>�#�u�z�?S�?S�TX�?Y�?Y�?Y�?Y�Z�D��K�K� 6��d��� C�D�D�D��Q������d��"&�	:�	:��D�%���t�|�|�X��D��J��I�%�%��1�1�1�*�U�2�f�T�l�l�B�D�D��g�%�%�!�$�<�<�D�D� �6�$�*�*�S�/�/�"�*=�#>�#>�>�D����d�d�d�E�J�O�O�E�4J�4J�4J�K�L�L�L�L����D�#8�8�9�9�9�9����*�U�4��	�	�$���3H�3H�-I�-I�I�J�J�J��
�
���	�	�$��� �	!�	!�	!�	!�g5!�n!'�u�z�'8�'8��U���'D�'D� E� E� E� E� %�
� 1� 1�#�f�+�+� >� >� >�@�A�I��F���J�J������8�s�?�?�H��
������ 5� 5�6�6������F�F�D�D�D�%�%�H�I�I�I�I��"�'�'�&�/�/�!�B�G�G�I�$6�$6�6�	:��j���
�'�'�)�,�U�F�C�@�@�
A�
A�C�C�
:C�
C�
Cr	c	�� �!�|\}}}t|t��r|j}dtj���dzdztjz}tjtj����}t|���d|�d|�d�dz}g}tj||��}	|	D�]�\}
� }}}
}� rtj
�� ��pd� tj|
��\}}}}d}|dkr(d|z}|d	kr|tj||||d
����z
}i�!|gf� �!fd�	}t#||
|��}d
� �d
|��g}|�>||z
}|
D]6}d|z}|�||���z��|dz
}�7ig}}|D]�\}}}||vr�d||<|t(urh|dkrd|z}n$|dkr||�d��dz}|�|�dt*j�|��������|�|dz����|�d�|����|�dd�|��z�����t|���dt|����g}t3|��D]L}t*j�t5||����}|�dd�|�d|�����M|d�|��zd�|��zdd�t7j|||����zzS)z:Return a plain text document describing a given traceback.r<rr=rZz�
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�dtj�|��zSrB)rDrrFrGs r
rHztext.<locals>.<lambda>�rIr	rJc���d�|d<tj�|d��|dxxdz
cc<S#|dxxdz
cc<wxYwrMrOrRs ��r
r-ztext.<locals>.reader�rVrWrXNz%5d rNrzglobal rr%rYz = z
 undefinedz
%s
z    zc

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

%s
)r\rr]r^r_r`rarbrcrerfrgrhrirjrkrlr9r,�rstriprrDrrFrorprrqrr)"rsrtrurvrwrxryrzr|r}r rSr~rr�r�r�r�r!r�r-r.r�r�r7r�r�r�rr8r2r�rTrUs"                                @@r
rr�s�������E�6�3��%�����������)�)�+�+�A�.�.��5���F�E��:�d�i�k�k�"�"�D� ��Z�Z�Z�Z�������5�9��D�
�F��$�S�'�2�2�G�18�%2�%2�-��t�T�4����-������-�-�4���'.�';�E�'B�'B�$��g�u�f����3�;�;��4�<�D��z�!�!���/��g�u�f� J� J�L�L�L�L���	���	"�	"�	"�	"�	"�	"�	"����v�.�.��� �D�D�$�$�'�(�����u��A��
�
���q�j�����C����
�
�-�.�.�.��Q������d��"&�	1�	1��D�%���t�|�|�X��D��J��I�%�%��H�$�$�Y��-=�d�d��g�%�%�e�d�j�j��o�o�b�6I�.I�t�������u�z���u�/E�/E�/E�F�G�G�G�G����D�<�/�0�0�0�0����D�I�I�d�O�O�$�$�$��
�
�h����4���0�1�1�1�1� ��Z�Z�Z�Z��V����5�6�I��F���?�?���
������ 5� 5�6�6������%�%����u�u�=�>�>�>�>��"�'�'�&�/�/�!�B�G�G�I�$6�$6�6�:�	�g�g�i�(����<�<�=�=�
:>�>�>r	c�,�eZdZdZ		d	d�Zd�Zd
d�ZdS)�Hookz?A hook to replace sys.excepthook that shows tracebacks in HTML.rNNr:rEc�d�||_||_||_|ptj|_||_dS�N)�display�logdirrtr^�stdoutrT�format)�selfr�r�rtrTr�s      r
�__init__z
Hook.__init__s0������������&�C�J��	�����r	c�6�|�|||f��dSr�)�handle)r�rurvrws    r
�__call__z
Hook.__call__s!�����U�F�C�(�)�)�)�)�)r	c�.�|ptj��}|jdkr&|j�t����|jdkrtpt}d}	|||j��}n*#d�	tj|���}d}YnxYw|jr`|r@tj�|��}|j�d|zdz��n8|j�|dz��n|j�d��|j��d	d
g|jdk}t!j||j���\}}	t%j|d��5}|�|��ddd��n#1swxYwYd
|z}	n#d|z}	YnxYw|jdkr|j�d|	z��n|j�|	dz��	|j���dS#YdSxYw)NrEFr
Tz<pre>z</pre>
rZz*<p>A problem occurred in a Python script.
z.txtz.html)�suffixrp�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�writerrErrtrorqrrr�rDrr��tempfile�mkstemprh�fdopen�flush)
r��info�	formatter�plain�docr��fdrirT�msgs
          r
r�zHook.handlesP���%�s�|�~�~���;�&� � ��I�O�O�E�G�G�$�$�$��[�&�(�2�d�:�d�	���	��)�D�$�,�/�/�C�C��	��'�'�)�4�d�;�<�<�C��E�E�E�����<�	K��
,��j�'�'��,�,���	����#�
�
� :�;�;�;�;��	����d�
�+�+�+�+��I�O�O�I�J�J�J��;�"��g�&�t�{�F�':�;�F�!�)��T�[�I�I�I�J�R��
J��Y�r�3�'�'�$�4��J�J�s�O�O�O�$�$�$�$�$�$�$�$�$�$�$����$�$�$�$�B�T�I����
J�B�T�I��������{�f�$�$��	���
�� 3�4�4�4�4��	����d�
�+�+�+�	��I�O�O�������������sH�#A5�5%B�F!�.F�F!�F�F!�F�F!�!F*�4H�H)rNNr:NrEr�)r]�
__module__�__qualname__�__doc__r�r�r�rr	r
r�r�
sW������I�I�?C������*�*�*�'�'�'�'�'�'r	r�rNrEc�@�t||||���t_dS)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�rtr�N)r�r^�
excepthookr�s    r
�enabler�Es'���'�&�")�&�:�:�:�C�N�N�Nr	)r:)rNNr:rE)r�rfr*rPrhrDr^r�rbr&rq�warningsrErrd�_deprecatedr]rrrrrr#r9rr�r��handlerr�rr	r
�<module>r�s�����.������������	�	�	�	�����
�
�
�
���������������������&�&�&�&�&�&����X�g�.�.�.�.�H�H�H�
�	������������� ���*_C�_C�_C�_C�B@>�@>�@>�@>�D5�5�5�5�5�5�5�5�n�$�&�&�-��:�:�:�:�:�:r	

Zerion Mini Shell 1.0