File "manifest.cpython-37.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python37/lib/python3.7/site-packages/distlib/__pycache__/manifest.cpython-37.pyc
File size: 10.01 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit

B

:a9@sdZddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZdgZe
eZedejZed	ejejBZejdd
ZGdddeZdS)zu
Class representing the list of files in a distribution.

Equivalent to distutils.filelist, but fixes some problems.
N)DistlibException)fsdecode)convert_pathManifestz\\w*
z#.*?(?=
)|
(?=$)c@szeZdZdZdddZddZddZd	d
Zddd
ZddZ	ddZ
ddZdddZd ddZ
d!ddZddZdS)"rz~A list of files built by on exploring the filesystem and filtered by
    applying various patterns to what we find there.
    NcCs>tjtj|pt|_|jtj|_d|_t	|_
dS)zd
        Initialise an instance.

        :param base: The base directory to explore under.
        N)ospathabspathnormpathgetcwdbasesepprefixallfilessetfiles)selfr
rA/opt/alt/python37/lib/python3.7/site-packages/distlib/manifest.py__init__*szManifest.__init__cCsddlm}m}m}g|_}|j}|g}|j}|j}xt|r|}t	|}	xZ|	D]R}
tj
||
}t|}|j}
||
r|t
|qR||
rR||
sR||qRWq8WdS)zmFind all files under the base and set ``allfiles`` to the absolute
        pathnames of files found.
        r)S_ISREGS_ISDIRS_ISLNKN)statrrrrr
popappendrlistdirr	joinst_moder)rrrrrrootstackrpushnamesnamefullnamermoderrrfindall9s"



zManifest.findallcCs4||jstj|j|}|jtj|dS)zz
        Add a file to the manifest.

        :param item: The pathname to add. This can be relative to the base.
        N)	
startswithrrr	rr
raddr)ritemrrrr)TszManifest.addcCsx|D]}||qWdS)z
        Add a list of files to the manifest.

        :param items: The pathnames to add. These can be relative to the base.
        N)r))ritemsr*rrradd_many^s
zManifest.add_manyFcsffddtj}|rJt}x|D]}|tj|q(W||O}ddtdd|DDS)z8
        Return sorted files in directory order
        csJ||td||jkrFtj|\}}|dks<t||dS)Nzadd_dir added %s)/)r)loggerdebugr
rr	splitAssertionError)dirsdparent_)add_dirrrrr7ls

z Manifest.sorted.<locals>.add_dircSsg|]}tjj|qSr)rr	r).0Z
path_tuplerrr
<listcomp>zsz#Manifest.sorted.<locals>.<listcomp>css|]}tj|VqdS)N)rr	r1)r8r	rrr	<genexpr>{sz"Manifest.sorted.<locals>.<genexpr>)rrrr	dirnamesorted)rZwantdirsresultr3fr)r7rrr<gs

zManifest.sortedcCst|_g|_dS)zClear all collected files.N)rrr)rrrrclear}szManifest.clearcCs||\}}}}|dkrFx&|D]}|j|dds td|q Wn:|dkrnx|D]}|j|dd}qTWn|dkrx&|D]}|j|dds|td|q|Wn|d	krx|D]}|j|dd}qWn|d
krx|D] }|j||dstd||qWn|d
kr$xz|D]}|j||d}q
Wn\|dkrL|jd|dstd|n4|dkrt|jd|dstd|ntd|dS)av
        Process a directive which either adds some files from ``allfiles`` to
        ``files``, or removes some files from ``files``.

        :param directive: The directive to process. This should be in a format
                     compatible with distutils ``MANIFEST.in`` files:

                     http://docs.python.org/distutils/sourcedist.html#commands
        includeT)anchorzno files found matching %rexcludezglobal-includeFz3no files found matching %r anywhere in distributionzglobal-excludezrecursive-include)rz-no files found matching %r under directory %rzrecursive-excludegraftNz no directories found matching %rprunez4no previously-included directories found matching %rzinvalid action %r)_parse_directive_include_patternr/warning_exclude_patternr)r	directiveactionpatternsthedirZ
dirpatternpatternfoundrrrprocess_directivesD








zManifest.process_directivecCs|}t|dkr,|ddkr,|dd|d}d}}}|dkrxt|dkr`td|d	d
|ddD}n~|dkrt|dkrtd
|t|d}dd
|ddD}n:|dkrt|dkrtd|t|d}ntd|||||fS)z
        Validate a directive.
        :param directive: The directive to validate.
        :return: A tuple of action, patterns, thedir, dir_patterns
        rr)r@rBzglobal-includezglobal-excludezrecursive-includezrecursive-excluderCrDr@N)r@rBzglobal-includezglobal-excluderz$%r expects <pattern1> <pattern2> ...cSsg|]}t|qSr)r)r8wordrrrr9sz-Manifest._parse_directive.<locals>.<listcomp>)zrecursive-includezrecursive-excludez*%r expects <dir> <pattern1> <pattern2> ...cSsg|]}t|qSr)r)r8rPrrrr9s)rCrDz!%r expects a single <dir_pattern>zunknown action %r)r1leninsertrr)rrIwordsrJrKrLZdir_patternrrrrEs.


zManifest._parse_directiveTcCsTd}|||||}|jdkr&|x(|jD]}||r.|j|d}q.W|S)aSelect 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.
        FNT)_translate_patternrr'searchrr))rrMrAris_regexrN
pattern_rer$rrrrFs

zManifest._include_patterncCsFd}|||||}x,t|jD]}||r |j|d}q W|S)atRemove 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.

        This API is public to allow e.g. exclusion of SCM subdirs, e.g. when
        packaging source distributions
        FT)rUlistrrVremove)rrMrArrWrNrXr>rrrrH)s
zManifest._exclude_patternc
Cs|rt|trt|S|Stdkr:|dd\}}}|rj||}tdkrn||rd||snt	nd}t
tj
|jd}	|dk	rftdkr|d}
||dt|
}n>||}||r||st	|t|t|t|}tj}tjdkrd}tdkr4d|	|
|d|f}n0|t|t|t|}d	||	||||f}n8|rtdkrd|	|}nd
||	|t|df}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).
        )rQrr6r-N\z\\^z.*z%s%s%s%s.*%s%sz%s%s%s)
isinstancestrrecompile_PYTHON_VERSION_glob_to_re	partitionr(endswithr2escaperr	rr
rRr)
rrMrArrWstartr6endrXr
Z
empty_patternZ	prefix_rerrrrrU=sB	








zManifest._translate_patterncCs8t|}tj}tjdkrd}d|}td||}|S)zTranslate 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).
        r[z\\\\z\1[^%s]z((?<!\\)(\\\\)*)\.)fnmatch	translaterrr_sub)rrMrXrescapedrrrrbts

zManifest._glob_to_re)N)F)TNF)TNF)TNF)__name__
__module____qualname____doc__rr'r)r,r<r?rOrErFrHrUrbrrrrr%s 

	
O/
(

6)rorhloggingrr_sysr-rcompatrutilr__all__	getLoggerrlr/r`MZ_COLLAPSE_PATTERNSZ_COMMENTED_LINEversion_inforaobjectrrrrr<module>
s