ok

Mini Shell

Direktori : /opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/
Upload File :
Current File : //opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/manifest.pyo

�
�2{Yc@s�dZddlZddlZddlZddlZddlmZddlmZddl	m
Z
dgZeje
�Zejdej�Zejd	ejejB�Zdefd
��YZdS(su
Class representing the list of files in a distribution.

Equivalent to distutils.filelist, but fixes some problems.
i����Ni(tDistlibException(tfsdecode(tconvert_pathtManifests\\w*
s#.*?(?=
)|
(?=$)cBs�eZdZd
d�Zd�Zd�Zd�Zed�Z	d�Z
d�Zd�Ze
d
ed	�Ze
d
ed
�Ze
d
ed�Zd�ZRS(s~A list of files built by on exploring the filesystem and filtered by
    applying various patterns to what we find there.
    cCsYtjjtjj|p!tj���|_|jtj|_d|_	t
�|_dS(sd
        Initialise an instance.

        :param base: The base directory to explore under.
        N(tostpathtabspathtnormpathtgetcwdtbasetseptprefixtNonetallfilestsettfiles(tselfR	((sM/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/manifest.pyt__init__#s-	cCs�ddlm}m}m}g|_}|j}|g}|j}|j}x�|r�|�}tj	|�}	x�|	D]{}
tj
j||
�}tj|�}|j}
||
�r�|jt
|��qu||
�ru||
�ru||�ququWqPWdS(smFind all files under the base and set ``allfiles`` to the absolute
        pathnames of files found.
        i����(tS_ISREGtS_ISDIRtS_ISLNKN(tstatRRRR
R	tpoptappendRtlistdirRtjointst_modeR(RRRRR
troottstackRtpushtnamestnametfullnameRtmode((sM/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/manifest.pytfindall2s"
						
	cCsM|j|j�s-tjj|j|�}n|jjtjj|��dS(sz
        Add a file to the manifest.

        :param item: The pathname to add. This can be relative to the base.
        N(	t
startswithRRRRR	RtaddR(Rtitem((sM/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/manifest.pyR$MscCs"x|D]}|j|�qWdS(s�
        Add a list of files to the manifest.

        :param items: The pathnames to add. These can be relative to the base.
        N(R$(RtitemsR%((sM/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/manifest.pytadd_manyWs
cs���fd��t�j�}|rgt�}x'|D]}�|tjj|��q7W||O}ngtd�|D��D]}tjj|�^q~S(s8
        Return sorted files in directory order
        csX|j|�tjd|�|�jkrTtjj|�\}}�||�ndS(Nsadd_dir added %s(R$tloggertdebugR	RRtsplit(tdirstdtparentt_(tadd_dirR(sM/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/manifest.pyR/es

css!|]}tjj|�VqdS(N(RRR*(t.0R((sM/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/manifest.pys	<genexpr>ts(RRRRtdirnametsortedR(RtwantdirstresultR+tft
path_tuple((R/RsM/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/manifest.pyR2`s	

cCst�|_g|_dS(sClear all collected files.N(RRR
(R((sM/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/manifest.pytclearvscCsS|j|�\}}}}|dkrcx%|D].}|j|dt�s.tjd|�q.q.Wn�|dkr�x�|D].}|j|dt�svtjd|�qvqvWn�|dkr�x�|D].}|j|dt�s�tjd|�q�q�Wn\|dkr;xM|D].}|j|dt�stjd	|�qqWn|d
kr�x|D]1}|j|d|�sNtjd||�qNqNWn�|d
kr�x�|D]1}|j|d|�s�tjd||�q�q�Wn~|dkr|jdd|�sOtjd|�qOnG|dkr?|jdd|�sOtjd|�qOntd|��dS(sv
        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
        tincludetanchorsno files found matching %rtexcludes.no previously-included files found matching %rsglobal-includes3no files found matching %r anywhere in distributionsglobal-excludesGno previously-included files matching %r found anywhere in distributionsrecursive-includeRs-no files found matching %r under directory %rsrecursive-excludesAno previously-included files matching %r found under directory %rtgrafts no directories found matching %rtprunes4no previously-included directories found matching %rsinvalid action %rN(	t_parse_directivet_include_patterntTrueR(twarningt_exclude_patterntFalseRR(Rt	directivetactiontpatternstthedirt
dirpatterntpattern((sM/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/manifest.pytprocess_directive{sP

	
	
	
	
		
	
c
Cs{|j�}t|�dkrA|ddkrA|jdd�n|d}d}}}|dkr�t|�dkr�td|��ng|dD]}t|�^q�}n�|dkrt|�d
kr�td|��nt|d�}g|dD]}t|�^q�}nT|dkr[t|�dkrHtd|��nt|d�}ntd|��||||fS(s�
        Validate a directive.
        :param directive: The directive to validate.
        :return: A tuple of action, patterns, thedir, dir_patterns
        iiR8R:sglobal-includesglobal-excludesrecursive-includesrecursive-excludeR;R<is$%r expects <pattern1> <pattern2> ...is*%r expects <dir> <pattern1> <pattern2> ...s!%r expects a single <dir_pattern>sunknown action %r(sincludesexcludesglobal-includesglobal-excludesrecursive-includesrecursive-excludesgraftspruneN(sincludesexcludesglobal-includesglobal-exclude(srecursive-includesrecursive-exclude(sgraftsprune(R*tlentinsertRRR(RRCtwordsRDRERFtdir_patterntword((sM/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/manifest.pyR=�s:	
	&&cCszt}|j||||�}|jdkr:|j�nx9|jD].}|j|�rD|jj|�t}qDqDW|S(s�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.
        N(	RBt_translate_patternR
RR"tsearchRR$R?(RRHR9Rtis_regextfoundt
pattern_reR((sM/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/manifest.pyR>�s

cCsdt}|j||||�}x?t|j�D].}|j|�r.|jj|�t}q.q.W|S(stRemove 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
        (RBROtlistRRPtremoveR?(RRHR9RRQRRRSR5((sM/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/manifest.pyRAs
c
Cs|r)t|t�r"tj|�S|Sn|rA|j|�}nd}tjtjj|j	d��}|dk	r�|jd�}|j|�t|� }tj}	tjdkr�d}	nd||	j|d|f�}n|r�d||}ntj|�S(sTranslate 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).
        ts\s\\t^s.*N(
t
isinstancetstrtretcompilet_glob_to_retescapeRRRR	RRJR
(
RRHR9RRQRSR	t
empty_patternt	prefix_reR
((sM/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/manifest.pyRO3s&	
!		cCsStj|�}tj}tjdkr0d}nd|}tjd||�}|S(s�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).
        s\s\\\\s\1[^%s]s((?<!\\)(\\\\)*)\.(tfnmatcht	translateRR
RZtsub(RRHRSR
tescaped((sM/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/manifest.pyR\Ws		
N(t__name__t
__module__t__doc__RRR"R$R'RBR2R7RIR=R?R>RAROR\(((sM/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/manifest.pyRs 		
				L	/(#(RfR`tloggingRRZRVRtcompatRtutilRt__all__t	getLoggerRdR(R[tMt_COLLAPSE_PATTERNtSt_COMMENTED_LINEtobjectR(((sM/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/manifest.pyt<module>
s	

Zerion Mini Shell 1.0