Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib64/python3.7/Tools/scripts/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/Tools/scripts/__pycache__/findnocoding.cpython-37.opt-1.pyc

B

� f��
@s�dZdZddlZddlZddlZddlZyddlZWn6ek
rjGdd�d�Ze�Zedej	d�YnXe�
d�Ze�
d	�Zd
d�Z
dd
�Zdd�ZdejdZedk�r�ye�ejdd�d�\ZZWnLejk
�rZz*eeej	d�eeej	d�e�d�WddZ[XYnXejZdZx2eD]*\ZZedk�rFejZnedk�r,dZ�q,We�sxeeej	d�e�d�x>e�ee�D].Ze�r�ede�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	oszxt|D]l}tj�|�r$|�d�Vqtj�|�rx@t�|�D]2\}}}x&|D]}|�d�rLtj�||�VqLWq<WqWdS)Nz.py)�os�path�isfile�endswith�isdir�walk�join)	�self�paths�args�kwargsr�root�dirs�files�filename�r�?/opt/alt/python37/lib64/python3.7/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]|$)cCst�|�}|r|�d�SdS)N��)�decl_re�match�group)�linerrrr�get_declaration&s

r!cCs,yt||�Wntk
r"dSXdSdS)NFT)�str�UnicodeDecodeError)�text�codecrrr�has_correct_encoding,s
r&c	Cs�yt|d�}Wntk
r"dSX|�<|��}|��}t|�sTt�|�rXt|�rXdS|��}WdQRXt|||d�r�dSdS)N�rbFzutf-8T)�open�IOError�readliner!�blank_rer�readr&)�fullpathZinfileZline1Zline2�restrrr�needs_declaration4sr/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>sL