<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
B
    YI~d 2                 @   s   d dl Z d dlZd dlZd dlZd dlmZ d dlmZmZ d dl	m
Z
 G dd dZdd Ze jfd	d
Zdd ZdddZdS )    N)convert_path)DistutilsTemplateErrorDistutilsInternalError)logc               @   sx   e Zd ZdddZdd ZejfddZdd	 Zd
d Z	dd Z
dd Zdd Zdd Zdd ZdddZdddZdS )FileListNc             C   s   d | _ g | _d S )N)allfilesfiles)selfwarndebug_print r   7/opt/alt/python37/lib64/python3.7/distutils/filelist.py__init__   s    zFileList.__init__c             C   s
   || _ d S )N)r   )r	   r   r   r   r   set_allfiles#   s    zFileList.set_allfilesc             C   s   t || _d S )N)findallr   )r	   dirr   r   r   r   &   s    zFileList.findallc             C   s   ddl m} |rt| d S )Nr   )DEBUG)Zdistutils.debugr   print)r	   msgr   r   r   r   r   )   s    zFileList.debug_printc             C   s   | j | d S )N)r   append)r	   itemr   r   r   r   3   s    zFileList.appendc             C   s   | j | d S )N)r   extend)r	   itemsr   r   r   r   6   s    zFileList.extendc             C   s@   t ttjj| j}g | _x |D ]}| jtjj|  q W d S )N)sortedmapospathsplitr   r   join)r	   Zsortable_filesZ
sort_tupler   r   r   sort9   s    
zFileList.sortc             C   sD   x>t t| jd ddD ]$}| j| | j|d  kr| j|= qW d S )N   r   )rangelenr   )r	   ir   r   r   remove_duplicatesC   s    zFileList.remove_duplicatesc             C   s   |  }|d }d  } }}|dkrTt|dk r<td| dd |dd  D }n~|dkrt|d	k rttd
| t|d }dd |dd  D }n:|dkrt|dkrtd| t|d }ntd| ||||fS )Nr   )includeexcludezglobal-includezglobal-exclude   z&'%s' expects <pattern1> <pattern2> ...c             S   s   g | ]}t |qS r   )r   ).0wr   r   r   
<listcomp>W   s    z1FileList._parse_template_line.<locals>.<listcomp>r    )zrecursive-includezrecursive-exclude   z,'%s' expects <dir> <pattern1> <pattern2> ...c             S   s   g | ]}t |qS r   )r   )r)   r*   r   r   r   r+   ]   s    )graftprunez#'%s' expects a single <dir_pattern>zunknown action '%s')r   r#   r   r   )r	   lineZwordsactionpatternsr   dir_patternr   r   r   _parse_template_lineL   s*    


zFileList._parse_template_linec             C   sX  |  |\}}}}|dkrZ| dd|  x&|D ]}| j|dds4td| q4W n|dkr| dd|  x&|D ]}| j|dds|td	| q|W n|d
kr| dd|  x&|D ]}| j|ddstd| qW nj|dkr8| dd|  x*|D ]"}| j|ddstd| qW n|dkr| d|d|f  x|D ]$}| j||ds`td|| q`W n|dkr| d|d|f  x|D ]$}| j||dstd|| qW nx|dkr| d|  | jd |dsTtd| nB|dkrH| d|  | jd |dsTtd| ntd| d S )Nr&   zinclude  r    )anchorz%warning: no files found matching '%s'r'   zexclude z9warning: no previously-included files found matching '%s'zglobal-includezglobal-include r   z>warning: no files found matching '%s' anywhere in distributionzglobal-excludezglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionzrecursive-includezrecursive-include %s %s)prefixz:warning: no files found matching '%s' under directory '%s'zrecursive-excludezrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'r-   zgraft z+warning: no directories found matching '%s'r.   zprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')r3   r   r   include_patternr   r
   exclude_patternr   )r	   r/   r0   r1   r   r2   patternr   r   r   process_template_lineh   sf    










zFileList.process_template_liner    r   c             C   sp   d}t ||||}| d|j  | jd kr4|   x6| jD ],}||r<| d|  | j| d}q<W |S )NFz%include_pattern: applying regex r'%s'z adding T)translate_patternr   r9   r   r   searchr   r   )r	   r9   r5   r6   is_regexfiles_found
pattern_renamer   r   r   r7      s    


zFileList.include_patternc             C   sv   d}t ||||}| d|j  xNtt| jd ddD ]4}|| j| r:| d| j|   | j|= d}q:W |S )NFz%exclude_pattern: applying regex r'%s'r    r!   z
 removing T)r;   r   r9   r"   r#   r   r<   )r	   r9   r5   r6   r=   r>   r?   r$   r   r   r   r8      s    
zFileList.exclude_pattern)NN)r    Nr   )r    Nr   )__name__
__module____qualname__r   r   r   curdirr   r   r   r   r   r%   r3   r:   r7   r8   r   r   r   r   r      s   


	L
,r   c             C   s&   dd t j| ddD }tt jj|S )Nc             s   s,   | ]$\}}}|D ]}t j||V  qqd S )N)r   r   r   )r)   basedirsr   filer   r   r   	<genexpr>   s   z#_find_all_simple.<locals>.<genexpr>T)followlinks)r   walkfilterr   isfile)r   resultsr   r   r   _find_all_simple   s    rN   c             C   s6   t | }| tjkr.tjtjj| d}t||}t|S )N)start)	rN   r   rD   	functoolspartialr   relpathr   list)r   r   Zmake_relr   r   r   r     s
    

r   c             C   s8   t | }tj}tjdkrd}d| }td||}|S )N\z\\\\z\1[^%s]z((?<!\\)(\\\\)*)\.)fnmatch	translater   sepresub)r9   r?   rW   Zescapedr   r   r   
glob_to_re  s    

rZ   r    c       
      C   s   |rt | trt| S | S tdd\}}}| r>t| }nd}|d k	rt|}|t|t|t|  }tj}	tjdkrd}	|t|t|t|  }d|||	||f }n|rd||t|d  f }t|S )N_ rT   z\\z%s\A%s%s.*%s%sz%s\A%s)	
isinstancestrrX   compilerZ   	partitionr#   r   rW   )
r9   r5   r6   r=   rO   r[   endr?   Z	prefix_rerW   r   r   r   r;   %  s(    


r;   )r    Nr   )r   rX   rU   rP   Zdistutils.utilr   Zdistutils.errorsr   r   Z	distutilsr   r   rN   rD   r   rZ   r;   r   r   r   r   <module>   s    i