Your IP : 216.73.216.213


Current Path : /opt/alt/python34/lib64/python3.4/Tools/scripts/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/Tools/scripts/__pycache__/findnocoding.cpython-34.pyo

�
e f��@sLdZdZddlZddlZddlZddlZyddlZWnAek
r�Gdd�d�Ze�Zeddej	�YnXej
d�Zej
d	�Zd
d�Z
dd
�Zdd�ZdejdZedkrHy)ejejdd�d�\ZZWn[ejk
ruZz8eedej	�eedej	�ejd�WYddZ[XnXejZdZxAeD]9\ZZedkr�ejZq�edkr�dZq�q�Wes�eedej	�ejd�nxSejee�D]<Zer"ede�nee�Z e ree�qqWndS)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|�rxZtj|�D]F\}}}x4|D],}|jd�rhtjj||�VqhqhWqRWqqWdS)Nz.py)�os�path�isfile�endswith�isdir�walk�join)	�self�paths�args�kwargsr�root�dirs�files�filename�r�?/opt/alt/python34/lib64/python3.4/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�}WdQXt|||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
		)