ACC SHELL

Path : /usr/lib/python/distutils/
File Upload :
Current File : //usr/lib/python/distutils/filelist.pyc

Ñò
tÄMc@s½dZdZddkZddkZddkZddkZddkTddklZddk	l
Z
lZddkl
Z
dfd	„ƒYZeid
„Zd„Zded
d„ZdS(ssdistutils.filelist

Provides the FileList class, used for poking about the filesystem
and building lists of files.
s9$Id: filelist.py 76044 2009-11-01 23:04:26Z tarek.ziade $iÿÿÿÿN(t*(tconvert_path(tDistutilsTemplateErrortDistutilsInternalError(tlogtFileListcBs˜eZdZddd„Zd„Zeid„Zd„Z	d„Z
d„Zd„Zd„Z
d	„Zd
„Zdddd
„Zdddd„ZRS(sÑ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(tNonetallfilestfiles(tselftwarntdebug_print((s(/usr/lib/python2.6/distutils/filelist.pyt__init__"s	cCs
||_dS(N(R(R	R((s(/usr/lib/python2.6/distutils/filelist.pytset_allfiles+scCst|ƒ|_dS(N(tfindallR(R	tdir((s(/usr/lib/python2.6/distutils/filelist.pyR.scCs$ddkl}|o	|GHndS(s~Print 'msg' to stdout if the global DEBUG (taken from the
        DISTUTILS_DEBUG environment variable) flag is true.
        iÿÿÿÿ(tDEBUGN(tdistutils.debugR(R	tmsgR((s(/usr/lib/python2.6/distutils/filelist.pyR1scCs|ii|ƒdS(N(Rtappend(R	titem((s(/usr/lib/python2.6/distutils/filelist.pyR;scCs|ii|ƒdS(N(Rtextend(R	titems((s(/usr/lib/python2.6/distutils/filelist.pyR>scCs_ttii|iƒ}|iƒg|_x-|D]%}|iittii|ƒƒq2WdS(N(	tmaptostpathtsplitRtsortRtapplytjoin(R	tsortable_filest
sort_tuple((s(/usr/lib/python2.6/distutils/filelist.pyRAs
	cCs[xTtt|iƒdddƒD]3}|i||i|djo|i|=q q WdS(Niiiÿÿÿÿ(trangetlenR(R	ti((s(/usr/lib/python2.6/distutils/filelist.pytremove_duplicatesLs cCs)ti|ƒ}|d}d}}}|djo;t|ƒdjotd|‚ntt|dƒ}n«|djoKt|ƒdjotd|‚nt|dƒ}tt|dƒ}nS|djo8t|ƒdjotd|‚nt|dƒ}ntd|‚||||fS(Nitincludetexcludesglobal-includesglobal-excludeis&'%s' expects <pattern1> <pattern2> ...isrecursive-includesrecursive-excludeis,'%s' expects <dir> <pattern1> <pattern2> ...tgrafttprunes#'%s' expects a single <dir_pattern>sunknown action '%s'(R$R%sglobal-includesglobal-exclude(srecursive-includesrecursive-exclude(R&R'(tstringRRR!RRR(R	tlinetwordstactiontpatternsRtdir_pattern((s(/usr/lib/python2.6/distutils/filelist.pyt_parse_template_lineUs,




cCsF|i|ƒ\}}}}|djoY|idti|ƒƒxý|D]0}|i|ddƒptid|ƒqIqIWnÂ|djoY|idti|ƒƒx—|D]0}|i|ddƒptid|ƒq¯q¯Wn\|d	jo]|id
ti|ƒƒx1|D]4}|i|ddƒptidd
|ƒqqWnò|djoY|idti|ƒƒxÇ|D]0}|i|ddƒptid|ƒqqWnŒ|djof|id|ti|ƒfƒx[|D]7}|i|d|ƒptidd||ƒqëqëWn|djob|id|ti|ƒfƒxè|D]3}|i|d|ƒptid||ƒq^q^Wnª|djo?|id|ƒ|idd|ƒptid|ƒqBn^|djoC|id|ƒ|idd|ƒptidd|ƒqBnt	d|‚dS( NR$sinclude tanchoris%warning: no files found matching '%s'R%sexclude s9warning: no previously-included files found matching '%s'sglobal-includesglobal-include is&warning: no files found matching '%s' sanywhere in distributionsglobal-excludesglobal-exclude sRwarning: no previously-included files matching '%s' found anywhere in distributionsrecursive-includesrecursive-include %s %stprefixsunder directory '%s'srecursive-excludesrecursive-exclude %s %ssNwarning: no previously-included files matching '%s' found under directory '%s'R&sgraft s+warning: no directories found matching '%s'R'sprune s)no previously-included directories found s
matching '%s's'this cannot happen: invalid action '%s'(
R.RR(Rtinclude_patternRR
texclude_patternRR(R	R)R+R,RR-tpattern((s(/usr/lib/python2.6/distutils/filelist.pytprocess_template_linezst
	
	
	
	
		
		
	
	iicCs d}t||||ƒ}|id|iƒ|idjo|iƒnxL|iD]A}|i|ƒo+|id|ƒ|ii|ƒd}qWqWW|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 1 if files are found.
        is%include_pattern: applying regex r'%s's adding iN(	ttranslate_patternRR3RRRtsearchRR(R	R3R/R0tis_regextfiles_foundt
pattern_retname((s(/usr/lib/python2.6/distutils/filelist.pyR1És	
cCs d}t||||ƒ}|id|iƒxjtt|iƒdddƒD]I}|i|i|ƒo,|id|i|ƒ|i|=d}qOqOW|S(süRemove 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 1 if files are found.
        is%exclude_pattern: applying regex r'%s'iiÿÿÿÿs
 removing (R5RR3R R!RR6(R	R3R/R0R7R8R9R"((s(/usr/lib/python2.6/distutils/filelist.pyR2÷s	 
N(t__name__t
__module__t__doc__RRR
RtcurdirRRRRRR#R.R4R1R2(((s(/usr/lib/python2.6/distutils/filelist.pyRs		
						%	P.cCsddkl}l}l}l}g}|g}|i}|i}xÄ|o¼|ƒ}ti|ƒ}	x|	D]•}
|ti	joti
i||
ƒ}n|
}ti|ƒ}||}
||
ƒo|i|ƒql||
ƒo||
ƒo||ƒqlqlWqFW|S(s^Find all files under 'dir' and return the list of full filenames
    (relative to 'dir').
    iÿÿÿÿ(tST_MODEtS_ISREGtS_ISDIRtS_ISLNK(tstatR?R@RARBtpopRRtlistdirR>RR(RR?R@RARBtlisttstackRDtpushtnamesR:tfullnameRCtmode((s(/usr/lib/python2.6/distutils/filelist.pyRs*"				

cCs(ti|ƒ}tidd|ƒ}|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\1[^/](tfnmatcht	translatetretsub(R3R9((s(/usr/lib/python2.6/distutils/filelist.pyt
glob_to_re3s	iicCsÀ|o)t|ƒtjoti|ƒS|Sn|ot|ƒ}nd}|dj	oDtdƒ}t|ƒt|ƒ }dtii	|d|ƒ}n|od|}nti|ƒ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).
    tt^s.*N(
ttypet
StringTypeRNtcompileRPRR!RRR(R3R/R0R7R9t
empty_patternt	prefix_re((s(/usr/lib/python2.6/distutils/filelist.pyR5Is
!(R=t__revision__RR(RNRLttypestdistutils.utilRtdistutils.errorsRRt	distutilsRRR>RRPRR5(((s(/usr/lib/python2.6/distutils/filelist.pyt<module>s$
ÿ 	

ACC SHELL 2018