Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/twisted/python/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/twisted/python/__pycache__/htmlizer.cpython-310.pyc
o

�b*�@s�dZddlZddlZddlmZddlmZddlmZGdd�d�Z	Gd	d
�d
�Z
Gdd�de
�Ze
fd
d�Zdd�Z
edkrEe
�dSdS)z"
HTML rendering of Python source.
�N)�escape)�List�)�reflectc@s4eZdZdZd\ZZdZZdZdd�Z	dd�Z
d	S)
�TokenPrinterzU
    Format a stream of tokens and intermediate whitespace, for pretty-printing.
    )rrr�utf-8cCs
||_dS)zJ
        @param writer: A file-like object, opened in bytes mode.
        N)�writer)�selfr�r
�9/usr/lib/python3/dist-packages/twisted/python/htmlizer.py�__init__s
zTokenPrinter.__init__c
Cs8ttd�r|tjkr||_dSt|t�s|�|j�}|\}}|\}}	|j|kr8|�d||j�|d|_|_	|�d||j	�|j
rKd}d|_n&|tjkrat
�|�rXd}n|jr^d}nd	}ntj�|�}|dusmJ�|��}|�||�|	|_	|j|�d�7_|j|kr�d|_	|d
v|_
|dkr�d|_dSdS)N�ENCODING�
r� �
identifierr�keyword�	parameter�variable)sdefsclass�:)�hasattr�tokenizer
�encoding�
isinstance�bytes�encode�currentLiner�
currentCol�lastIdentifier�
parameters�NAMEr�	iskeyword�tok_name�get�lower�count)
r	�type�token�sCoordinates�eCoordinates�line�srow�scol�erow�ecolr
r
r�
printtoken s@






�zTokenPrinter.printtokenN)�__name__�
__module__�__qualname__�__doc__rrrrrrr.r
r
r
rrsrc@s4eZdZUdZgZeeed<dd�Zddd�Z	dS)	�
HTMLWriterzm
    Write the stream of tokens and whitespace from L{TokenPrinter}, formating
    tokens as HTML spans.
    �noSpancCs$||_g}t�|jd|�||_dS)Nr4)rr�accumulateClassList�	__class__r4)r	rr4r
r
rrOs
zHTMLWriter.__init__NcCsjt|t�r
|�d�}t|�}|�d�}|dus||jvr#|�|�dS|�d|�d�d|d�dS)Nrs<span class="py-src-s">s</span>)rr�decoderrr4r)r	r&r%r
r
r�writeUs"


�����zHTMLWriter.write)N)
r/r0r1r2r4r�str�__annotations__rr8r
r
r
rr3Gs

r3c@seZdZdZgd�ZdS)�SmallerHTMLWriterzi
    HTMLWriter that doesn't generate spans for some junk.

    Results in much smaller HTML output.
    )�	endmarker�indent�dedent�op�newline�nlN)r/r0r1r2r4r
r
r
rr;fsr;c
Cst|�d�t||j�j�j}zt�|j�D]}|\}}}}}	||||||	�qWn
tjy2Ynw|�d�dS)Ns<pre>s</pre>
)r8rr.r�readline�
TokenError)
�inp�outr�printerr&�	tokenType�string�start�endr)r
r
r�filterps
��rKcCsXddl}t|jd|j�}t|jdd��}t||�Wd�dS1s%wYdS)Nr�bufferr�rb)�sys�getattr�stdout�open�argvrK)rNrP�fr
r
r�main|s
"�rT�__main__)r2rr�htmlr�typingr�rrr3r;rKrTr/r
r
r
r�<module>s6

�

Spamworldpro Mini