Your IP : 3.137.200.139


Current Path : /opt/alt/python34/lib/python3.4/site-packages/setuptools/command/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib/python3.4/site-packages/setuptools/command/__pycache__/sdist.cpython-34.pyc

�
M�Re� �@s�ddlZddlZddlZddlmZddlZddlmZddlm	Z	ddl
mZddlm
Z
dZd
dd�ZGd
d�de�Zd
dd�Zedejdej��e
jgZGdd�de�ZdS)�N)�glob)�sdist)�convert_path)�log)�	svn_utils�README�
README.rst�
README.txt�ccs@x9tjd�D](}x|j�|�D]}|Vq)WqWdS)z%Find all files under revision controlzsetuptools.file_findersN)�
pkg_resources�iter_entry_points�load)�dirname�ep�item�r�3/tmp/pip-l4uy7dan-build/setuptools/command/sdist.py�walk_revctrlsrc@s:eZdZddd�Zdd�Zddd�ZdS)	�	re_finderNcCs%||_||_t|�|_dS)N)�pattern�postprocr�path)�selfrrrrrr�__init__s		zre_finder.__init__ccs�t|d�}z|j�}Wd|j�XxU|jj|�D]A}|jd�}|jrp|j|�}ntj||�Vq@WdS)N�rU�)	�open�read�closer�finditer�grouprr�joinpath)rr�filename�f�data�matchrrrr�_finders	zre_finder._finderr
ccs�tj||j�}tjj|�r�xh|j||�D]Q}tjj|�rZ|Vq:tjj|�r:x||�D]}|VqyWq:q:WndS)N)rr!r�os�isfiler&�isdir)rrrrrrr�__call__+szre_finder.__call__)�__name__�
__module__�__qualname__rr&r*rrrrrs
rccs1x*tD]"}x||�D]}|VqWqWdS)zPrimary svn_cvs entry pointN)�finders)r�finderrrrr�_default_revctrl7s
r0zCVS/Entriesz
^\w?/([^/]+)/c@s�eZdZdZd ddddfd!gZiZdd
�Zdd�Zej	d"kp�d#ej	koud$knp�d%ej	ko�d&knZ
e
r�eZndd�Zdd�Z
dd�Zdd�Zdd�ZdS)'rz=Smart sdist that finds anything supported by revision control�formats=N�6formats for source distribution (comma-separated list)z	keep-temp�kz1keep the distribution tree around after creating zarchive file(s)�	dist-dir=�d�Fdirectory to put the source distribution archive(s) in [default: dist]cCs|jd�|jd�}|j|_|jjtjj|jd��|j�x!|j	�D]}|j|�qaWddl
}d|jjkr�|j
�n|j�t|jdg�}x<|jD]1}dd|f}||kr�|j|�q�q�WdS)N�egg_infozSOURCES.txtr�check�
dist_filesrr
)�run_command�get_finalized_command�filelist�appendr'r�joinr7�check_readme�get_sub_commands�distutils.command�command�__all__Zcheck_metadataZmake_distribution�getattr�distributionZ
archive_files)rZei_cmd�cmd_name�	distutilsr9�filer$rrr�runUs 
"


z	sdist.runc	CsDytj|�Wn,tj�djjjdj��YnXdS)N��template)�_sdist�
read_template�sys�exc_info�tb_next�tb_frame�f_localsr)rrrrZ__read_template_hackns
!zsdist.__read_template_hackrJ��rr�cs`t|jjg}x�|D]�}t|t�r�|}d}x:|D]2}tjj|�rAd}|jj	|�PqAqAW|s�|j
ddj|��q�qtjj|�r�|jj	|�q|j
d|�qWddg}xH|D]@}tt
tjjt|���}|r�|jj|�q�q�W|jj�r�|jd�}|jj|j��|jjs�xC|jD]5\}	�}	}
|jj�fd	d
�|
D��qxWq�n|jj�r�|jd�}|jj|j��n|jj�r%|jd�}|jj|j��n|jj�r\|jd
�}
|jj|
j��ndS)Nrrz,standard file not found: should have one of z, zstandard file '%s' not foundz
test/test*.pyz	setup.cfg�build_pycs%g|]}tjj�|��qSr)r'rr>)�.0r")�src_dirrr�
<listcomp>�s	z&sdist.add_defaults.<locals>.<listcomp>�	build_ext�
build_clib�
build_scripts)�READMESrE�script_name�
isinstance�tupler'r�existsr<r=�warnr>�list�filterr(r�extend�has_pure_modulesr;Zget_source_filesZinclude_package_data�
data_files�has_ext_modules�has_c_libraries�has_scripts)rZ	standards�fnZaltsZgot_it�optionalr�filesrV�_�	filenamesrZr[r\r)rXr�add_defaults�sL

	
!zsdist.add_defaultscCsEx>tD]}tjj|�rdSqW|jddjt��dS)Nz,standard file not found: should have one of z, )r]r'rrarbr>)rr#rrrr?�s

zsdist.check_readmecCs�tj|||�tjj|d�}ttd�ritjj|�ritj|�|jd|�n|j	d�j
|�dS)Nz	setup.cfg�linkr7)rL�make_release_treer'rr>�hasattrra�unlink�	copy_filer;Zsave_version_info)r�base_dirrm�destrrrrr�s!
zsdist.make_release_treec
CsYtjj|j�sdSt|jd�}z|j�}Wd|j�X|dj�kS)NF�rbUz+# file GENERATED by distutils, do NOT edit
)r'rr(�manifestr�readliner�encode)r�fp�
first_linerrr�_manifest_is_not_generated�sz sdist._manifest_is_not_generatedcCs�tjd|j�t|jd�}x�|D]�}tjdkr�y|jd�}Wq�tk
r|tjd|�w,Yq�Xn|j	�}|j
d�s,|r�q,n|jj|�q,W|j
�dS)	z�Read the manifest file (named by 'self.manifest') and use it to
        fill in 'self.filelist', the list of files to include in the source
        distribution.
        zreading manifest file '%s'rxrTzUTF-8z"%r not UTF-8 decodable -- skipping�#N)rT)r�inforyrrN�version_info�decode�UnicodeDecodeErrorrb�strip�
startswithr<r=r)rry�linerrr�
read_manifest�s

zsdist.read_manifest)r1Nr2)r4r5r6)rJrSrJ)rTr)rTrrU)rTrJ)rTrJr)r+r,r-�__doc__�user_options�negative_optrIZ_sdist__read_template_hackrNr�Zhas_leaky_handlerMrpr?rrr~r�rrrrrEs*		5	
r)rrr	)r'�rerNrrZdistutils.command.sdistrrL�distutils.utilrrGr�
setuptoolsrr]r�objectrr0�compile�MZ
svn_finderr.rrrr�<module>s 

?>