3 \�,�@s�dZdZddlZddlZddlZddlZeed�s:ed��dddgZda da d d �Z d d �Z Gd d�de �Zdd�ZGdd�d�Zdd�Zdd�Zedkr�e �dS)a�The Tab Nanny despises ambiguous indentation. She knows no mercy. tabnanny -- Detection of ambiguous indentation For the time being this module is intended to be called as a script. However it is possible to import it into an IDE and use the function check() described below. Warning: The API provided by this module is likely to change in future releases; such changes may not be backward compatible. �6�N�NLz4tokenize.NL doesn't exist -- tokenize module too old�check�NannyNag�process_tokenscGs:d}x$|D]}tjj|t|��d}q Wtjjd�dS)N�� � )�sys�stderr�write�str)�args�sep�arg�r� /usr/lib64/python3.6/tabnanny.py�errprint#s  rcCs�ytjtjdd�d�\}}Wn*tjk rH}z t|�dSd}~XnXx0|D](\}}|dkrhtda|dkrPtdaqPW|s�tdtjdd�dSx|D] }t|�q�WdS)N�Zqvz-qz-vzUsage:rz[-v] file_or_directory ...)�getoptr �argv�errorr� filename_only�verboser)Zoptsr�msg�o�arrrr�main*s  rc@s0eZdZdZdd�Zdd�Zdd�Zdd �Zd S) rzk Raised by process_tokens() if detecting an ambiguous indent. Captured and handled in check(). cCs||||_|_|_dS)N)�linenor�line)�selfrrrrrr�__init__AszNannyNag.__init__cCs|jS)N)r)r rrr� get_linenoCszNannyNag.get_linenocCs|jS)N)r)r rrr�get_msgEszNannyNag.get_msgcCs|jS)N)r)r rrr�get_lineGszNannyNag.get_lineN)�__name__� __module__� __qualname__�__doc__r!r"r#r$rrrrr<s c %Cs"tjj|�r�tjj|� r�tr,td|f�tj|�}xT|D]L}tjj||�}tjj|�rhtjj|� s�tjj|dd��dkrsz#format_witnesses..z at tab sizer�srz, )rGr2)�wZfirsts�prefixrrr�format_witnesses s  rdcCstj}tj}tj}tjtjf}td�g}d}x�|D]�\}}} } } ||krNd}q2||kr�d}t|�} |dj| �s�|dj| �} dt | �}t | d|| ��|j | �q2||kr�d}|d=q2|o�||kr2d}t| �} |d j | �s2|d j | �} dt | �}t | d|| ��q2WdS) Nrrrzindent not greater e.g. zindent not equal e.g. �����rererere)r4�INDENT�DEDENT�NEWLINE�COMMENTrrCr\r]rdrrXrWrZ)�tokensrfrgrhZJUNK�indentsZ check_equal�type�token�start�endrZthisguyZwitnessrrrrrs6       �__main__)r(� __version__r,r rr4�hasattr� ValueError�__all__rrrr� ExceptionrrrCrdrr%rrrr� s(  =7