Your IP : 18.117.91.116


Current Path : /opt/alt/python310/lib64/python3.10/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/distutils/__pycache__/filelist.cpython-310.opt-2.pyc

o

6��f 2�@s�	ddlZddlZddlZddlZddlmZddlmZmZddl	m
Z
Gdd�d�Zdd�Zej
fd	d
�Zdd�Zddd�ZdS)�N��convert_path)�DistutilsTemplateError�DistutilsInternalError)�logc@s|eZdZ	ddd�Zdd�Zejfdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zddd�Z	ddd�ZdS)�FileListNcCsd|_g|_dS�N)�allfiles�files)�self�warn�debug_print�r�9/opt/alt/python310/lib64/python3.10/distutils/filelist.py�__init__s
zFileList.__init__cCs
||_dSr)r	)rr	rrr�set_allfiles#s
zFileList.set_allfilescCst|�|_dSr)�findallr	)r�dirrrrr&szFileList.findallcCs"	ddlm}|rt|�dSdS)Nr)�DEBUG)Zdistutils.debugr�print)r�msgrrrrr
)s
�zFileList.debug_printcC�|j�|�dSr)r
�append)r�itemrrrr3�zFileList.appendcCrr)r
�extend)r�itemsrrrr6rzFileList.extendcCs<tttjj|j��}g|_|D]}|j�tjj|��qdSr)�sorted�map�os�path�splitr
r�join)rZsortable_filesZ
sort_tuplerrr�sort9s
�z
FileList.sortcCs@tt|j�ddd�D]}|j||j|dkr|j|=qdS)N�r���)�range�lenr
)r�irrr�remove_duplicatesCs
��zFileList.remove_duplicatescCs�|��}|d}d}}}|dvr*t|�dkrtd|��dd�|dd�D�}n?|dvrLt|�d	kr:td
|��t|d�}dd�|dd�D�}n|dvrct|�dkr\td
|��t|d�}ntd|��||||fS)Nr)�include�exclude�global-include�global-exclude�z&'%s' expects <pattern1> <pattern2> ...cS�g|]}t|��qSrr��.0�wrrr�
<listcomp>W�z1FileList._parse_template_line.<locals>.<listcomp>r$)�recursive-include�recursive-exclude�z,'%s' expects <dir> <pattern1> <pattern2> ...cSr/rrr0rrrr3]r4)�graft�prunez#'%s' expects a single <dir_pattern>zunknown action '%s')r!r'rr)r�lineZwords�action�patternsr�dir_patternrrr�_parse_template_lineLs0���zFileList._parse_template_linecCs6|�|�\}}}}|dkr+|�dd�|��|D]}|j|dd�s(t�d|�qdS|dkrM|�dd�|��|D]}|j|dd�sJt�d	|�q;dS|d
kro|�dd�|��|D]}|j|dd�slt�d
|�q]dS|dkr�|�dd�|��|D]}|j|dd�s�t�d|�qdS|dkr�|�d|d�|�f�|D]}|j||d�s�t�d||�q�dS|dkr�|�d|d�|�f�|D]}|j||d�s�t�d||�q�dS|dkr�|�d|�|jd|d�s�t�d|�dSdS|dk�r|�d|�|jd|d��st�d|�dSdStd|��)Nr*zinclude � r$)�anchorz%warning: no files found matching '%s'r+zexclude z9warning: no previously-included files found matching '%s'r,zglobal-include rz>warning: no files found matching '%s' anywhere in distributionr-zglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionr5zrecursive-include %s %s)�prefixz:warning: no files found matching '%s' under directory '%s'r6zrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'r8zgraft z+warning: no directories found matching '%s'r9zprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')r>r
r"�include_patternrr�exclude_patternr)rr:r;r<rr=�patternrrr�process_template_linehs�����������������������
���zFileList.process_template_liner$rcCsn	d}t||||�}|�d|j�|jdur|��|jD]}|�|�r4|�d|�|j�|�d}q|S)NFz%include_pattern: applying regex r'%s'z adding T)�translate_patternr
rDr	r�searchr
r)rrDr@rA�is_regex�files_found�
pattern_re�namerrrrB�s�


�zFileList.include_patterncCst	d}t||||�}|�d|j�tt|j�ddd�D]}|�|j|�r7|�d|j|�|j|=d}q|S)NFz%exclude_pattern: applying regex r'%s'r$r%z
 removing T)rFr
rDr&r'r
rG)rrDr@rArHrIrJr(rrrrC�s��zFileList.exclude_pattern)NN�r$Nr)�__name__�
__module__�__qualname__rrr�curdirrr
rrr#r)r>rErBrCrrrrrs


	
L,�rcCs(	dd�tj|dd�D�}ttjj|�S)Ncss.�|]\}}}|D]
}tj�||�Vq	qdSr)rr r")r1�base�dirsr
�filerrr�	<genexpr>�s����z#_find_all_simple.<locals>.<genexpr>T)�followlinks)r�walk�filterr �isfile)r Zresultsrrr�_find_all_simple�s
�rYcCs8	t|�}|tjkrtjtjj|d�}t||�}t|�S)N)�start)	rYrrP�	functools�partialr �relpathr�list)rr
Zmake_relrrrrs

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

rer$c
Cs�	|rt|t�r
t�|�S|Std��d�\}}}|r t|�}nd}|durZt|�}|t|�t|�t|��}tj}	tjdkrBd}	|t|�t|�t|��}d|||	||f}n|rhd||t|�d�f}t�|�S)N�_�r_z\\z%s\A%s%s.*%s%sz%s\A%s)	�
isinstance�strrc�compilere�	partitionr'rrb)
rDr@rArHrZrf�endrJZ	prefix_rerbrrrrF%s(




rFrL)rrcr`r[Zdistutils.utilrZdistutils.errorsrrZ	distutilsrrrYrPrrerFrrrr�<module>si

?>