Your IP : 216.73.216.213


Current Path : /opt/alt/python33/lib64/python3.3/Tools/scripts/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/Tools/scripts/__pycache__/pysource.cpython-33.pyc

�
��f$c@sdZdZddddgZddlZddlZejd�ZdZd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
eddd�Zedkrx!edg�D]Zee�q�Wed�x*edgde
�D]Zee�q�WndS(uCList python source files.

There are three functions to check whether a file is a Python source, listed
here with increasing complexity:

- has_python_ext() checks whether a file name ends in '.py[w]'.
- look_like_python() checks whether the file is not binary and either has
  the '.py[w]' extension or the first line contains the word 'python'.
- can_be_compiled() checks whether the file can be compiled by compile().

The file also must be of appropriate size - not bigger than a megabyte.

walk_python_files() recursively lists all Python files under the given directories.
uOleg Broytmann, Georg Brandluhas_python_extulooks_like_pythonucan_be_compileduwalk_python_filesiNs[\x00-\x08\x0E-\x1F\x7F]cCstrt|�ndS(N(udebuguprint(umsg((u;/opt/alt/python33/lib64/python3.3/Tools/scripts/pysource.pyuprint_debugsuprint_debugcCs�ytj|�j}Wn=tk
rU}ztd||f�dSWYdd}~XnX|dkrztd||f�dSyt|d�SWn=tk
r�}ztd||f�dSWYdd}~XnXdS(Nu%s: permission denied: %siu!%s: the file is too big: %d bytesurbu%s: access denied: %si(uosustatust_sizeuOSErroruprint_debuguNoneuopenuIOError(ufullpathusizeuerr((u;/opt/alt/python33/lib64/python3.3/Tools/scripts/pysource.pyu_open!su_opencCs|jd�p|jd�S(Nu.pyu.pyw(uendswith(ufullpath((u;/opt/alt/python33/lib64/python3.3/Tools/scripts/pysource.pyuhas_python_ext2sc	Cs�t|�}|dkrdS|�|j�}WdQXtj|�rVtd|�dS|jd�st|jd�rxdSd|kr�dSdS(Nu%s: appears to be binaryu.pyu.pywspythonFT(	u_openuNoneuFalseureadlineu	binary_reusearchuprint_debuguendswithuTrue(ufullpathuinfileuline((u;/opt/alt/python33/lib64/python3.3/Tools/scripts/pysource.pyulooks_like_python5scCs�t|�}|dkrdS|�|j�}WdQXyt||d�Wn=tk
r�}ztd||f�dSWYdd}~XnXdS(Nuexecu%s: cannot compile: %sFT(u_openuNoneuFalseureaducompileu	Exceptionuprint_debuguTrue(ufullpathuinfileucodeuerr((u;/opt/alt/python33/lib64/python3.3/Tools/scripts/pysource.pyucan_be_compiledJsc
cs"|dkrg}nx|D]�}td|�tjj|�rY||�r|Vqqtjj|�rtd�x�tj|�D]�\}}}x*|D]"}||kr�|j|�q�q�WxE|D]=}tjj||�}	td|	�||	�r�|	Vq�q�Wq�Wqtd�qWdS(u^    Recursively yield all Python source files below the given paths.

    paths: a list of files and/or directories to be checked.
    is_python: a function that takes a file name and checks whether it is a
               Python source file
    exclude_dirs: a list of directory base names that should be excluded in
                  the search
    utesting: %su    it is a directoryu    unknown typeN(	uNoneuprint_debuguosupathuisfileuisdiruwalkuremoveujoin(
upathsu	is_pythonuexclude_dirsupathudirpathudirnamesu	filenamesuexcludeufilenameufullpath((u;/opt/alt/python33/lib64/python3.3/Tools/scripts/pysource.pyuwalk_python_files[s&
	



u__main__u.u
----------u	is_pythonF(u__doc__u
__author__u__all__uosureucompileu	binary_reuFalseudebuguprint_debugu_openuhas_python_extulooks_like_pythonucan_be_compileduNoneuwalk_python_filesu__name__ufullpathuprint(((u;/opt/alt/python33/lib64/python3.3/Tools/scripts/pysource.pyu<module>s"!