Your IP : 3.144.5.221


Current Path : /opt/alt/python37/lib64/python3.7/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/distutils/__pycache__/filelist.cpython-37.opt-2.pyc

B

YI~d 2�@s�ddlZddlZddlZddlZddlmZddlmZmZddl	m
Z
Gdd�d�Zdd�Zej
fd	d
�Zdd�Zddd�ZdS)�N)�convert_path)�DistutilsTemplateError�DistutilsInternalError)�logc@sxeZdZddd�Zdd�Zejfdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zddd�Zddd�ZdS)�FileListNcCsd|_g|_dS)N)�allfiles�files)�self�warn�debug_print�r�7/opt/alt/python37/lib64/python3.7/distutils/filelist.py�__init__szFileList.__init__cCs
||_dS)N)r)r	rrrr
�set_allfiles#szFileList.set_allfilescCst|�|_dS)N)�findallr)r	�dirrrr
r&szFileList.findallcCsddlm}|rt|�dS)Nr)�DEBUG)Zdistutils.debugr�print)r	�msgrrrr
r)szFileList.debug_printcCs|j�|�dS)N)r�append)r	�itemrrr
r3szFileList.appendcCs|j�|�dS)N)r�extend)r	�itemsrrr
r6szFileList.extendcCs@tttjj|j��}g|_x |D]}|j�tjj|��q WdS)N)�sorted�map�os�path�splitrr�join)r	Zsortable_filesZ
sort_tuplerrr
�sort9s
z
FileList.sortcCsDx>tt|j�ddd�D]$}|j||j|dkr|j|=qWdS)N�r���)�range�lenr)r	�irrr
�remove_duplicatesCszFileList.remove_duplicatescCs�|��}|d}d}}}|dkrTt|�dkr<td|��dd�|dd�D�}n~|dkr�t|�d	krttd
|��t|d�}dd�|dd�D�}n:|dkr�t|�dkr�td
|��t|d�}ntd|��||||fS)Nr)�include�excludezglobal-includezglobal-exclude�z&'%s' expects <pattern1> <pattern2> ...cSsg|]}t|��qSr)r)�.0�wrrr
�
<listcomp>Wsz1FileList._parse_template_line.<locals>.<listcomp>r )zrecursive-includezrecursive-exclude�z,'%s' expects <dir> <pattern1> <pattern2> ...cSsg|]}t|��qSr)r)r)r*rrr
r+]s)�graft�prunez#'%s' expects a single <dir_pattern>zunknown action '%s')rr#rr)r	�lineZwords�action�patternsr�dir_patternrrr
�_parse_template_lineLs*


zFileList._parse_template_linecCsX|�|�\}}}}|dkrZ|�dd�|��x&|D]}|j|dd�s4t�d|�q4W�n�|dkr�|�dd�|��x&|D]}|j|dd�s|t�d	|�q|W�n�|d
kr�|�dd�|��x&|D]}|j|dd�s�t�d
|�q�W�nj|dk�r8|�dd�|��x*|D]"}|j|dd��st�d|��qW�n|dk�r�|�d|d�|�f�x�|D]$}|j||d��s`t�d||��q`Wn�|dk�r�|�d|d�|�f�x�|D]$}|j||d��s�t�d||��q�Wnx|dk�r|�d|�|jd|d��sTt�d|�nB|dk�rH|�d|�|jd|d��sTt�d|�ntd|��dS)Nr&zinclude � r )�anchorz%warning: no files found matching '%s'r'zexclude z9warning: no previously-included files found matching '%s'zglobal-includezglobal-include rz>warning: no files found matching '%s' anywhere in distributionzglobal-excludezglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionzrecursive-includezrecursive-include %s %s)�prefixz:warning: no files found matching '%s' under directory '%s'zrecursive-excludezrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'r-zgraft z+warning: no directories found matching '%s'r.zprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')r3rr�include_patternrr
�exclude_patternr)r	r/r0r1rr2�patternrrr
�process_template_linehsf










zFileList.process_template_liner rcCspd}t||||�}|�d|j�|jdkr4|��x6|jD],}|�|�r<|�d|�|j�|�d}q<W|S)NFz%include_pattern: applying regex r'%s'z adding T)�translate_patternrr9rr�searchrr)r	r9r5r6�is_regex�files_found�
pattern_re�namerrr
r7�s


zFileList.include_patterncCsvd}t||||�}|�d|j�xNtt|j�ddd�D]4}|�|j|�r:|�d|j|�|j|=d}q:W|S)NFz%exclude_pattern: applying regex r'%s'r r!z
 removing T)r;rr9r"r#rr<)r	r9r5r6r=r>r?r$rrr
r8�s
zFileList.exclude_pattern)NN)r Nr)r Nr)�__name__�
__module__�__qualname__rrr�curdirrrrrrr%r3r:r7r8rrrr
rs


	L
,rcCs&dd�tj|dd�D�}ttjj|�S)Ncss,|]$\}}}|D]}tj�||�VqqdS)N)rrr)r)�base�dirsr�filerrr
�	<genexpr>�sz#_find_all_simple.<locals>.<genexpr>T)�followlinks)r�walk�filterr�isfile)r�resultsrrr
�_find_all_simple�srNcCs6t|�}|tjkr.tjtjj|d�}t||�}t|�S)N)�start)	rNrrD�	functools�partialr�relpathr�list)rrZmake_relrrr
rs


rcCs8t�|�}tj}tjdkrd}d|}t�d||�}|S)N�\z\\\\z\1[^%s]z((?<!\\)(\\\\)*)\.)�fnmatch�	translater�sep�re�sub)r9r?rWZescapedrrr
�
glob_to_res

rZr c
Cs�|rt|t�rt�|�S|Std��d�\}}}|r>t|�}nd}|dk	r�t|�}|t|�t|�t|��}tj}	tjdkr�d}	|t|�t|�t|��}d|||	||f}n|r�d||t|�d�f}t�|�S)N�_�rTz\\z%s\A%s%s.*%s%sz%s\A%s)	�
isinstance�strrX�compilerZ�	partitionr#rrW)
r9r5r6r=rOr[�endr?Z	prefix_rerWrrr
r;%s(


r;)r Nr)rrXrUrPZdistutils.utilrZdistutils.errorsrrZ	distutilsrrrNrDrrZr;rrrr
�<module>si

?>