AlkantarClanX12

Your IP : 18.223.237.246


Current Path : /opt/alt/python33/lib64/python3.3/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/distutils/__pycache__/filelist.cpython-33.pyc

�
��f�1c@s�dZddlZddlZddlZddlmZddlmZmZddl	m
Z
Gdd�d�Zejdd	�Z
d
d�Zdddd
d�ZdS(usdistutils.filelist

Provides the FileList class, used for poking about the filesystem
and building lists of files.
iN(uconvert_path(uDistutilsTemplateErroruDistutilsInternalError(ulogcBs�|EeZdZdZdddd�Zdd�Zejdd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zdd�Zddddd�Zddddd�ZdS(uFileListu�A list of files built by on exploring the filesystem and filtered by
    applying various patterns to what we find there.

    Instance attributes:
      dir
        directory from which files will be taken -- only used if
        'allfiles' not supplied to constructor
      files
        list of filenames currently being built/filtered/manipulated
      allfiles
        complete list of files under consideration (ie. without any
        filtering applied)
    cCsd|_g|_dS(N(uNoneuallfilesufiles(uselfuwarnudebug_print((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyu__init__s	uFileList.__init__cCs
||_dS(N(uallfiles(uselfuallfiles((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyuset_allfiles"suFileList.set_allfilescCst|�|_dS(N(ufindalluallfiles(uselfudir((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyufindall%suFileList.findallcCs'ddlm}|r#t|�ndS(u~Print 'msg' to stdout if the global DEBUG (taken from the
        DISTUTILS_DEBUG environment variable) flag is true.
        i(uDEBUGN(udistutils.debuguDEBUGuprint(uselfumsguDEBUG((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyudebug_print(suFileList.debug_printcCs|jj|�dS(N(ufilesuappend(uselfuitem((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyuappend2suFileList.appendcCs|jj|�dS(N(ufilesuextend(uselfuitems((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyuextend5suFileList.extendcCsXtttjj|j��}g|_x*|D]"}|jjtjj|��q.WdS(N(usortedumapuosupathusplitufilesuappendujoin(uselfusortable_filesu
sort_tuple((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyusort8s	
u
FileList.sortcCsYxRtt|j�ddd�D]1}|j||j|dkr |j|=q q WdS(Niii����(urangeulenufiles(uselfui((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyuremove_duplicatesBs&uFileList.remove_duplicatescCs:|j�}|d}d}}}|dkrut|�dkrUtd|��ndd	�|d
d�D�}n�|dkr�t|�d
kr�td|��nt|d
�}dd	�|dd�D�}nT|dkrt|�dkrtd|��nt|d
�}ntd|��||||fS(Niuincludeuexcludeuglobal-includeuglobal-excludeiu&'%s' expects <pattern1> <pattern2> ...cSsg|]}t|��qS((uconvert_path(u.0uw((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyu
<listcomp>Vs	u1FileList._parse_template_line.<locals>.<listcomp>iurecursive-includeurecursive-excludeiu,'%s' expects <dir> <pattern1> <pattern2> ...cSsg|]}t|��qS((uconvert_path(u.0uw((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyu
<listcomp>\s	ugraftupruneu#'%s' expects a single <dir_pattern>uunknown action '%s'(uincludeuexcludeuglobal-includeuglobal-exclude(urecursive-includeurecursive-exclude(ugraftuprune(usplituNoneulenuDistutilsTemplateErroruconvert_path(uselfulineuwordsuactionupatternsudirudir_pattern((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyu_parse_template_lineKs,
	  uFileList._parse_template_linecCs|j|�\}}}}|dkr}|jddj|��x�|D].}|j|dd�sHtjd|�qHqHWn�|dkr�|jddj|��xs|D].}|j|dd�s�tjd	|�q�q�Wn:|d
krA|jddj|��x|D].}|j|dd�stjd
|�qqWn�|dkr�|jddj|��x�|D].}|j|dd�sntjd|�qnqnWnv|dkr|jd|dj|�f�xG|D]1}|j|d|�s�tjd||�q�q�Wn|dkry|jd|dj|�f�x�|D]1}|j|d|�sAtjd||�qAqAWn�|dkr�|jd|�|jdd|�stjd|�qnX|dkr	|jd|�|jdd|�stjd|�qntd|��dS(Nuincludeuinclude u uanchoriu%warning: no files found matching '%s'uexcludeuexclude u9warning: no previously-included files found matching '%s'uglobal-includeuglobal-include iu>warning: no files found matching '%s' anywhere in distributionuglobal-excludeuglobal-exclude uRwarning: no previously-included files matching '%s' found anywhere in distributionurecursive-includeurecursive-include %s %suprefixu:warning: no files found matching '%s' under directory '%s'urecursive-excludeurecursive-exclude %s %suNwarning: no previously-included files matching '%s' found under directory '%s'ugraftugraft u+warning: no directories found matching '%s'upruneuprune u6no previously-included directories found matching '%s'u'this cannot happen: invalid action '%s'(	u_parse_template_lineudebug_printujoinuinclude_patternuloguwarnuexclude_patternuNoneuDistutilsInternalError(uselfulineuactionupatternsudirudir_patternupattern((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyuprocess_template_linegsf
	
	
	
		
		
		
	
uFileList.process_template_lineiicCs�d}t||||�}|jd|j�|jdkrK|j�nxJ|jD]?}|j|�rU|jd|�|jj	|�d}qUqUW|S(u�Select strings (presumably filenames) from 'self.files' that
        match 'pattern', a Unix-style wildcard (glob) pattern.  Patterns
        are not quite the same as implemented by the 'fnmatch' module: '*'
        and '?'  match non-special characters, where "special" is platform-
        dependent: slash on Unix; colon, slash, and backslash on
        DOS/Windows; and colon on Mac OS.

        If 'anchor' is true (the default), then the pattern match is more
        stringent: "*.py" will match "foo.py" but not "foo/bar.py".  If
        'anchor' is false, both of these will match.

        If 'prefix' is supplied, then only filenames starting with 'prefix'
        (itself a pattern) and ending with 'pattern', with anything in between
        them, will match.  'anchor' is ignored in this case.

        If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and
        'pattern' is assumed to be either a string containing a regex or a
        regex object -- no translation is done, the regex is just compiled
        and used as-is.

        Selected strings will be added to self.files.

        Return True if files are found, False otherwise.
        u%include_pattern: applying regex r'%s'u adding FNT(uFalseutranslate_patternudebug_printupatternuallfilesuNoneufindallusearchufilesuappenduTrue(uselfupatternuanchoruprefixuis_regexufiles_foundu
pattern_reuname((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyuinclude_pattern�s	

uFileList.include_patterncCs�d}t||||�}|jd|j�xhtt|j�ddd�D]G}|j|j|�rO|jd|j|�|j|=d}qOqOW|S(uRemove strings (presumably filenames) from 'files' that match
        'pattern'.  Other parameters are the same as for
        'include_pattern()', above.
        The list 'self.files' is modified in place.
        Return True if files are found, False otherwise.
        u%exclude_pattern: applying regex r'%s'iu
 removing Fi����i����T(	uFalseutranslate_patternudebug_printupatternurangeulenufilesusearchuTrue(uselfupatternuanchoruprefixuis_regexufiles_foundu
pattern_reui((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyuexclude_pattern�s	&

uFileList.exclude_patternN(u__name__u
__module__u__qualname__u__doc__uNoneu__init__uset_allfilesuosucurdirufindalludebug_printuappenduextendusorturemove_duplicatesu_parse_template_lineuprocess_template_lineuinclude_patternuexclude_pattern(u
__locals__((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyuFileList
s


	L,uFileListcCsddlm}m}m}m}g}|g}|j}|j}x�|r|�}tj|�}	x�|	D]�}
|tj	kr�tj
j||
�}n|
}tj|�}||}
||
�r�|j|�qk||
�rk||
�rk||�qkqkWqFW|S(u^Find all files under 'dir' and return the list of full filenames
    (relative to 'dir').
    i(uST_MODEuS_ISREGuS_ISDIRuS_ISLNK(ustatuST_MODEuS_ISREGuS_ISDIRuS_ISLNKupopuappenduosulistdirucurdirupathujoin(udiruST_MODEuS_ISREGuS_ISDIRuS_ISLNKulistustackupopupushunamesunameufullnameustatumode((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyufindall�s&"					

ufindallcCsStj|�}tj}tjdkr0d}nd|}tjd||�}|S(u�Translate a shell-like glob pattern to a regular expression; return
    a string containing the regex.  Differs from 'fnmatch.translate()' in
    that '*' does not match "special characters" (which are
    platform-specific).
    u\u\\\\u\1[^%s]u((?<!\\)(\\\\)*)\.(ufnmatchu	translateuosusepureusub(upatternu
pattern_reusepuescaped((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyu
glob_to_res		
u
glob_to_reicCs�|r)t|t�r"tj|�S|Sn|r>t|�}nd}|dk	r�td�}t|�dt|��}tj}tjdkr�d}nd|j	|d|f�}n|r�d|}ntj|�S(uTranslate a shell-like wildcard pattern to a compiled regular
    expression.  Return the compiled regex.  If 'is_regex' true,
    then 'pattern' is directly compiled to a regex (if it's a string)
    or just returned as-is (assumes it's a regex object).
    uNu\u\\u^u.*(
u
isinstanceustrureucompileu
glob_to_reuNoneulenuosusepujoin(upatternuanchoruprefixuis_regexu
pattern_reu
empty_patternu	prefix_reusep((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyutranslate_pattern+s"
		 
utranslate_pattern(u__doc__uosureufnmatchudistutils.utiluconvert_pathudistutils.errorsuDistutilsTemplateErroruDistutilsInternalErroru	distutilsuloguFileListucurdirufindallu
glob_to_reuNoneutranslate_pattern(((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyu<module>s�