Current Dir: /snap/core22/2437/usr/lib/python3/dist-packages/setuptools/_distutils/__pycache__/

[FILE] archive_util.cpython-310.pyc [ edit | delete | rename ]
[FILE] bcppcompiler.cpython-310.pyc [ edit | delete | rename ]
[FILE] ccompiler.cpython-310.pyc [ edit | delete | rename ]
[FILE] cmd.cpython-310.pyc [ edit | delete | rename ]
[FILE] config.cpython-310.pyc [ edit | delete | rename ]
[FILE] core.cpython-310.pyc [ edit | delete | rename ]
[FILE] cygwinccompiler.cpython-310.pyc [ edit | delete | rename ]
[FILE] debug.cpython-310.pyc [ edit | delete | rename ]
[FILE] dep_util.cpython-310.pyc [ edit | delete | rename ]
[FILE] dir_util.cpython-310.pyc [ edit | delete | rename ]
[FILE] dist.cpython-310.pyc [ edit | delete | rename ]
[FILE] errors.cpython-310.pyc [ edit | delete | rename ]
[FILE] extension.cpython-310.pyc [ edit | delete | rename ]
[FILE] fancy_getopt.cpython-310.pyc [ edit | delete | rename ]
[FILE] filelist.cpython-310.pyc [ edit | delete | rename ]
[FILE] file_util.cpython-310.pyc [ edit | delete | rename ]
[FILE] log.cpython-310.pyc [ edit | delete | rename ]
[FILE] msvc9compiler.cpython-310.pyc [ edit | delete | rename ]
[FILE] msvccompiler.cpython-310.pyc [ edit | delete | rename ]
[FILE] py35compat.cpython-310.pyc [ edit | delete | rename ]
[FILE] py38compat.cpython-310.pyc [ edit | delete | rename ]
[FILE] spawn.cpython-310.pyc [ edit | delete | rename ]
[FILE] sysconfig.cpython-310.pyc [ edit | delete | rename ]
[FILE] text_file.cpython-310.pyc [ edit | delete | rename ]
[FILE] unixccompiler.cpython-310.pyc [ edit | delete | rename ]
[FILE] util.cpython-310.pyc [ edit | delete | rename ]
[FILE] version.cpython-310.pyc [ edit | delete | rename ]
[FILE] versionpredicate.cpython-310.pyc [ edit | delete | rename ]
[FILE] _msvccompiler.cpython-310.pyc [ edit | delete | rename ]
[FILE] __init__.cpython-310.pyc [ edit | delete | rename ]

Viewing: /snap/core22/2437/usr/lib/python3/dist-packages/setuptools/_distutils/__pycache__/filelist.cpython-310.pyc

o

�_�a_4�@s�dZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZGdd�d�Zdd	�Z
Gd
d�de�Zejfdd
�Zdd�Zddd�ZdS)zsdistutils.filelist

Provides the FileList class, used for poking about the filesystem
and building lists of files.
�N��convert_path)�DistutilsTemplateError�DistutilsInternalError)�logc@s~eZdZdZddd�Zdd�Zejfdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zddd�Z	ddd�ZdS)�FileLista�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)
    NcCsd|_g|_dS�N)�allfiles�files)�self�warn�debug_print�r�@/usr/lib/python3/dist-packages/setuptools/_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)z~Print 'msg' to stdout if the global DEBUG (taken from the
        DISTUTILS_DEBUG environment variable) flag is true.
        r)�DEBUGN)�distutils.debugr�print)r�msgrrrrr
,s�zFileList.debug_printcC�|j�|�dSr)r
�append)r�itemrrrr6�zFileList.appendcCrr)r
�extend)r�itemsrrrr9rzFileList.extendcCs<tttjj|j��}g|_|D]}|j�tjj|��qdSr)�sorted�map�os�path�splitr
r�join)r�sortable_files�
sort_tuplerrr�sort<s
�z
FileList.sortcCs@tt|j�ddd�D]}|j||j|dkr|j|=qdS)N�r���)�range�lenr
)r�irrr�remove_duplicatesEs
��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>X�z1FileList._parse_template_line.<locals>.<listcomp>r')�recursive-include�recursive-exclude�z,'%s' expects <dir> <pattern1> <pattern2> ...cSr2rrr3rrrr6^r7)�graft�prunez#'%s' expects a single <dir_pattern>zunknown action '%s')r"r*rr)r�line�words�action�patternsr�dir_patternrrr�_parse_template_lineMs0���zFileList._parse_template_linecCs:|�|�\}}}}|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�d}t�|||�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 distributionr0zglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionr8zrecursive-include %s %s)�prefixz:warning: no files found matching '%s' under directory '%s'r9zrecursive-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')rBr
r#�include_patternrr�exclude_patternr)rr=r?r@rrA�patternrrrr�process_template_lineis�����������������������
���zFileList.process_template_liner'rcCsld}t||||�}|�d|j�|jdur|��|jD]}|�|�r3|�d|�|j�|�d}q|S)a�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.
        Fz%include_pattern: applying regex r'%s'Nz adding T)�translate_patternr
rHr	r�searchr
r)rrHrDrE�is_regex�files_found�
pattern_re�namerrrrF�s�


�zFileList.include_patterncCsrd}t||||�}|�d|j�tt|j�ddd�D]}|�|j|�r6|�d|j|�|j|=d}q|S)aRemove 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.
        Fz%exclude_pattern: applying regex r'%s'r'r(z
 removing T)rJr
rHr)r*r
rK)rrHrDrErLrMrNr+rrrrG�s��zFileList.exclude_pattern)NN�r'Nr)�__name__�
__module__�__qualname__�__doc__rrr �curdirrr
rrr&r,rBrIrFrGrrrrrs

	
M+�rcCs0t�tj|dd��}dd�|D�}ttjj|�S)z%
    Find all files under 'path'
    T)�followlinkscss.�|]\}}}|D]
}tj�||�Vq	qdSr)r r!r#)r4�base�dirsr
�filerrr�	<genexpr>�s����z#_find_all_simple.<locals>.<genexpr>)�_UniqueDirs�filterr �walkr!�isfile)r!�
all_unique�resultsrrr�_find_all_simple�s
�rac@s$eZdZdZdd�Zedd��ZdS)r[z�
    Exclude previously-seen dirs from walk results,
    avoiding infinite recursion.
    Ref https://bugs.python.org/issue44497.
    cCsF|\}}}t�|�}|j|jf}||v}|r|dd�=|�|�|S)z�
        Given an item from an os.walk result, determine
        if the item represents a unique dir for this instance
        and if not, prevent further traversal.
        N)r �stat�st_dev�st_ino�add)r�	walk_itemrWrXr
rb�	candidate�foundrrr�__call__	s



z_UniqueDirs.__call__cCst|�|�Sr)r\)�clsrrrrr\sz_UniqueDirs.filterN)rQrRrSrTri�classmethodr\rrrrr[s
r[cCs6t|�}|tjkrtjtjj|d�}t||�}t|�S)z�
    Find all files under 'dir' and return the list of full filenames.
    Unless dir is '.', return full filenames with dir prepended.
    )�start)	rar rU�	functools�partialr!�relpathr�list)rr
�make_relrrrrs


rcCs8t�|�}tj}tjdkrd}d|}t�d||�}|S)z�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).
    �\z\\\\z\1[^%s]z((?<!\\)(\\\\)*)\.)�fnmatch�	translater �sep�re�sub)rHrNru�escapedrrr�
glob_to_re)s

ryr'c
Cs|rt|t�rt�|�S|Std��d�\}}}|r+t|�}|�|�r(|�|�s*J�nd}|durqt|�}|�|�r?|�|�sAJ�|t|�t|�t|��}t	j
}	t	j
dkrYd}	|t|�t|�t|��}d|||	||f}n|rd||t|�d�f}t�|�S)aTranslate 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).
    �_�Nrrz\\z%s\A%s%s.*%s%sz%s\A%s)�
isinstance�strrv�compilery�	partition�
startswith�endswithr*r ru)
rHrDrErLrlrz�endrN�	prefix_rerurrrrJ@s.



�
rJrP)rTr rvrsrm�distutils.utilr�distutils.errorsrr�	distutilsrrra�setr[rUrryrJrrrr�<module>sf

Upload File: