Your IP : 13.58.203.104


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/tabnanny.cpython-310.opt-2.pyc

o

6��f0,�@s�	dZddlZddlZddlZgd�Zdadadd�Zdd�ZGdd	�d	e	�Z
d
d�ZGdd
�d
�Zdd�Z
dd�ZedkrCe�dSdS)�6�N)�check�NannyNag�process_tokenscGs6d}|D]}tj�|t|��d}qtj�d�dS)N�� �
)�sys�stderr�write�str)�args�sep�arg�r�//opt/alt/python310/lib64/python3.10/tabnanny.py�errprint s
rc
Cs�ddl}z|�tjdd�d�\}}Wn|jy+}zt|�WYd}~dSd}~ww|D]\}}|dkr:tda|dkrBtdaq.|sPtdtjdd�dS|D]}t|�qRdS)Nr�Zqvz-qz-vzUsage:z[-v] file_or_directory ...)�getoptr	�argv�errorr�
filename_only�verboser)rZoptsr
�msg�o�arrrr�main's(���
�rc@s.eZdZ	dd�Zdd�Zdd�Zdd�Zd	S)
rcCs||||_|_|_dS�N)�linenor�line)�selfrrrrrr�__init__@szNannyNag.__init__cC�|jSr)r�r rrr�
get_linenoB�zNannyNag.get_linenocCr"r)rr#rrr�get_msgDr%zNannyNag.get_msgcCr"r)rr#rrr�get_lineFr%zNannyNag.get_lineN)�__name__�
__module__�__qualname__r!r$r&r'rrrrr;src	
CsP	tj�|�rEtj�|�sEtrtd|f�t�|�}|D]%}tj�||�}tj�|�r2tj�|�r>tj�|dd��dkrBt	|�qdSzt
�|�}Wntyg}zt
d||f�WYd}~dSd}~wwtdkrrtd|�z�z
tt
�|j��Wn�t
jy�}zt
d||f�WYd}~W|��dSd}~wty�}zt
d||f�WYd}~W|��dSd}~wt�y}zE|��}|��}tr�td	||f�td
|f�t|���nd|vr�d|d}tr�t|�nt||t|��WYd}~W|��dSd}~wwW|��n|��wt�r&td
|f�dSdS)Nz%r: listing directory���z.pyz%r: I/O Error: %srzchecking %r ...z%r: Token Error: %sz%r: Indentation Error: %sz)%r: *** Line %d: trouble in tab city! ***zoffending line: %rr�"z%r: Clean bill of health.)�os�path�isdir�islinkr�print�listdir�join�normcaser�tokenize�open�OSErrorrr�generate_tokens�readline�
TokenError�close�IndentationErrorrr$r'r&r�repr)	�file�names�name�fullname�frZnagZbadlinerrrrrIsl	

������������rc@sLeZdZd\ZZdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZdS)�
Whitespacez 	c	Cs�||_tjtj}}g}d}}}|jD]9}||kr$|d}|d}q||krN|d}|d}|t|�krC|dg|t|�d}||d||<d}q||_||_t|�|f|_t|�dk|_	dS)Nrr)
�rawrC�S�T�len�n�nt�tuple�norm�	is_simple)	r ZwsrErF�count�brHrIZchrrrr!�s(

zWhitespace.__init__cCs|j\}}tt|�d|�S�Nr)rK�maxrG)r rM�trailingrrr�longest_run_of_spaces�s
z Whitespace.longest_run_of_spacescCsH|j\}}d}t|t|��D]}|||||}q||||jS)Nr)rK�rangerGrI)r �tabsizerMrQZil�irrr�indent_level�s

zWhitespace.indent_levelcCs|j|jkSr)rK)r �otherrrr�equal�szWhitespace.equalcCsbt|��|���d}g}td|d�D]}|�|�|�|�kr.|�||�|�|�|�f�q|SrO�rPrRrSrV�append�r rWrHr�tsrrr�not_equal_witness������zWhitespace.not_equal_witnesscCsp|j|jkrdS|jr|jr|j|jkSt|��|���d}td|d�D]}|�|�|�|�kr5dSq&dS)NFr�T)rHrLrIrPrRrSrV)r rWrHr\rrr�less�s���zWhitespace.lesscCsbt|��|���d}g}td|d�D]}|�|�|�|�kr.|�||�|�|�|�f�q|SrOrYr[rrr�not_less_witnessr^zWhitespace.not_less_witnessN)r(r)r*rErFr!rRrVrXr]r`rarrrrrC�srCcCs8dd�|D�}d}t|�dkr|d}|dd�|�S)Ncss�|]	}t|d�VqdS)rN)r)�.0�tuprrr�	<genexpr>
s�z#format_witnesses.<locals>.<genexpr>zat tab sizer�srz, )rGr3)�wZfirsts�prefixrrr�format_witnessess
rhcCstj}tj}tj}tjtjf}td�g}d}|D]l\}}}	}
}||kr&d}q||krRd}t|�}|d�|�sL|d�|�}
dt	|
�}t
|	d||��|�|�q||kr\d}|d=q|r�||vr�d}t|�}|d�|�s�|d�
|�}
dt	|
�}t
|	d||��qdS)Nrrr���zindent not greater e.g. zindent not equal e.g. )r5�INDENT�DEDENT�NEWLINE�COMMENT�NLrCr`rarhrrZrXr])�tokensrjrkrlZJUNK�indentsZcheck_equal�type�token�start�endrZthisguyZwitnessrrrrrs:

��r�__main__)�__version__r-r	r5�__all__rrrr�	ExceptionrrrCrhrr(rrrr�<module>s&=7
�

?>