£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyÊ¦•êŽ…È®FÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~èŠ©ÊÇí`ÔÑ©úë™µ'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶ê×Ó¼ãžªéUWŸÈË%DÒÕ¬ï‘]/Åcx  ‰ï2ß]ä6G[]S£ÔÏ¯rs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ                  ¯¹ægƒÛowÐø^d™ý½ßB7áyMä9ÜÖUã
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<html>

]0                 @   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
 Gd d   d  Z d d   Z e  j d	 d
  Z d d   Z d d d  d d  Z d S)    N)convert_path)DistutilsTemplateErrorDistutilsInternalError)logc               @   s   e  Z d  Z d d d d  Z d d   Z e j 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 d d  Z d d d d d  Z d S)FileListNc             C   s   d  |  _  g  |  _ d  S)N)allfilesfiles)selfwarndebug_print r   -/opt/alt/python35/lib64/python3.5/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  j |  d  S)N)r   append)r	   itemr   r   r   r   3   s    zFileList.appendc             C   s   |  j  j |  d  S)N)r   extend)r	   itemsr   r   r   r   6   s    zFileList.extendc             C   sX   t  t t j j |  j   } g  |  _ x* | D]" } |  j j t j j |    q. Wd  S)N)sortedmapospathsplitr   r   join)r	   Zsortable_filesZ
sort_tupler   r   r   sort9   s    	zFileList.sortc             C   sV   xO t  t |  j  d d d  D]. } |  j | |  j | d k r  |  j | =q  Wd  S)N   r   )rangelenr   )r	   ir   r   r   remove_duplicatesC   s    &zFileList.remove_duplicatesc             C   s1  | j    } | d } d  } } } | d k rr t |  d k  rR t d |   d d	   | d
 d   D } n | d k r t |  d k  r t d |   t | d
  } d d	   | d d   D } nQ | d k rt |  d k r t d |   t | d
  } n t d |   | | | | f S)Nr   includeexcludeglobal-includeglobal-exclude   z&'%s' expects <pattern1> <pattern2> ...c             S   s   g  |  ] } t  |   q Sr   )r   ).0wr   r   r   
<listcomp>W   s   	 z1FileList._parse_template_line.<locals>.<listcomp>r    recursive-includerecursive-exclude   z,'%s' expects <dir> <pattern1> <pattern2> ...c             S   s   g  |  ] } t  |   q Sr   )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.   r/   )r1   r2   )r   r#   r   r   )r	   lineZwordsactionpatternsr   dir_patternr   r   r   _parse_template_lineL   s,    
	  zFileList._parse_template_linec             C   s  |  j  |  \ } } } } | d k rz |  j d d j |   x| D]+ } |  j | d d sH t j d |  qH Wn| d k r |  j d d j |   x^| D]+ } |  j | d d s t j d	 |  q Wn(| d
 k r8|  j d d j |   x| D]+ } |  j | d d st j d |  qWn| d k r|  j d d j |   x| D]+ } |  j | d d set j d |  qeWnj| d k r|  j d | d j |  f  x;| D]. } |  j | d | st j d | |  qWn| d k rg|  j d | d j |  f  x | D]. } |  j | d | s2t j d | |  q2Wn | d k r|  j d |  |  j d  d | st j d |  nU | d k r|  j d |  |  j d  d | st j d |  n t d |   d  S)Nr&   zinclude  anchorr    z%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'r1   zgraft z+warning: no directories found matching '%s'r2   zprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')r7   r   r   include_patternr   r
   exclude_patternr   )r	   r3   r4   r5   r   r6   patternr   r   r   process_template_lineh   sf    									
	
zFileList.process_template_liner    r   c             C   s   d } t  | | | |  } |  j d | j  |  j d  k rH |  j   xG |  j D]< } | j |  rR |  j d |  |  j j |  d } qR W| S)NFz%include_pattern: applying regex r'%s'z adding T)translate_patternr   r=   r   r   searchr   r   )r	   r=   r9   r:   is_regexfiles_found
pattern_renamer   r   r   r;      s    	

zFileList.include_patternc             C   s   d } t  | | | |  } |  j d | j  xe t t |  j  d d d  D]D } | j |  j |  rO |  j d |  j |  |  j | =d } qO W| S)NFz%exclude_pattern: applying regex r'%s'r    z
 removing Tr!   r!   )r?   r   r=   r"   r#   r   r@   )r	   r=   r9   r:   rA   rB   rC   r$   r   r   r   r<      s    	&

zFileList.exclude_pattern)__name__
__module____qualname__r   r   r   curdirr   r   r   r   r   r%   r7   r>   r;   r<   r   r   r   r   r      s   

	L,r   c             C   s5   d d   t  j |  d d D } t t  j j |  S)Nc             s   s:   |  ]0 \ } } } | D] } t  j j | |  Vq q d  S)N)r   r   r   )r+   basedirsr   filer   r   r   	<genexpr>   s   z#_find_all_simple.<locals>.<genexpr>followlinksT)r   walkfilterr   isfile)r   resultsr   r   r   _find_all_simple   s    	rR   c             C   sO   t  |   } |  t j k rE t j t j j d |  } t | |  } t |  S)Nstart)	rR   r   rH   	functoolspartialr   relpathr   list)r   r   Zmake_relr   r   r   r     s
    r   c             C   sP   t  j |   } t j } t j d k r- d } d | } t j d | |  } | S)N\z\\\\z\1[^%s]z((?<!\\)(\\\\)*)\.)fnmatch	translater   sepresub)r=   rC   r[   escapedr   r   r   
glob_to_re  s    	
r_   r    c             C   s   | r& t  |  t  r" t j |   S|  S|  r; t |   } n d } | d  k	 r t d  } t |  d  t |   } t j } t j d k r d } d | j | d | f  } n | r d | } t j |  S)N rX   z\\^z.*)	
isinstancestrr\   compiler_   r#   r   r[   r   )r=   r9   r:   rA   rC   Zempty_patternZ	prefix_rer[   r   r   r   r?   %  s"    	 
r?   )r   r\   rY   rT   Zdistutils.utilr   Zdistutils.errorsr   r   Z	distutilsr   r   rR   rH   r   r_   r?   r   r   r   r   <module>   s   