Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/Tools/scripts/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/Tools/scripts/__pycache__/findnocoding.cpython-35.opt-1.pyc



��Yf��@s=dZdZddlZddlZddlZddlZyddlZWnAek
r�Gdd�d�Ze�Zeddej	�YnXej
d�Zej
d	�Zd
d�Z
dd
�Zdd�ZdejdZedkr9y)ejejdd�d�\ZZWn[ejk
ruZz8eedej	�eedej	�ejd�WYddZ[XnXejZdZx>eD]6\ZZedkr�ejZq�edkr�dZq�Wes�eedej	�ejd�xJejee�D]6Zerede�ee�Z e r�ee�q�WdS)zcList all those Python files that require a coding directive

Usage: findnocoding.py dir1 [dir2...]
zOleg Broytmann, Georg Brandl�Nc@s*eZdZdZZZdd�ZdS)�pysourceNc	os�x�|D]�}tjj|�r0|jd�Vqtjj|�rxTtj|�D]C\}}}x1|D])}|jd�rhtjj||�VqhWqRWqWdS)Nz.py)�os�path�isfile�endswith�isdir�walk�join)	�self�paths�args�kwargsr�root�dirs�files�filename�r�?/opt/alt/python35/lib64/python3.5/Tools/scripts/findnocoding.py�walk_python_filess

zpysource.walk_python_files)�__name__�
__module__�__qualname__Zhas_python_ext�looks_like_python�can_be_compiledrrrrrrsrz^The pysource module is not available; no sophisticated Python source file search will be done.�files&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s^[ \t\f]*(?:[#\r\n]|$)cCs&tj|�}|r"|jd�SdS)N��)�decl_re�match�group)�linerrrr�get_declaration&s
r!cCs2yt||�Wntk
r)dSYnXdSdS)NFT)�str�UnicodeDecodeError)�text�codecrrr�has_correct_encoding,s

	r&cCs�yt|d�}Wntk
r+dSYnX|�T|j�}|j�}t|�srtj|�rvt|�rvdS|j�}WdQRXt|||d�r�dSdS)N�rbFzutf-8T)�open�IOError�readliner!�blank_rer�readr&)�fullpathZinfileZline1Zline2�restrrr�needs_declaration4s
	r/zjUsage: %s [-cd] paths...
    -c: recognize Python source files trying to compile them
    -d: debug output�__main__rZcdFz-cz-dTzTesting for coding: %s)!�__doc__�
__author__�sysr�reZgetoptr�ImportError�print�stderr�compilerr+r!r&r/�argvZusagerZoptsr�error�msg�exitrZ	is_python�debug�o�arrr-�resultrrrr�<module>sL0
		)