JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbrў f1c@sdZddlZddlZddlZddlmZddlmZmZddl m Z GdddZ ej dd Z d d Zd ddd dZdS(usdistutils.filelist Provides the FileList class, used for poking about the filesystem and building lists of files. iN(u convert_path(uDistutilsTemplateErroruDistutilsInternalError(ulogcBs|EeZdZdZddddZddZejddZ dd Z d d Z d d Z ddZ ddZddZddZdddddZdddddZdS(uFileListuA 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(uselfuwarnu debug_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.pyu debug_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|jdddD]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 dD}n|dkrt|d krtd|nt|d }dd |ddD}nT|dkrt|dkrtd|nt|d }ntd|||||fS(Niuincludeuexcludeuglobal-includeuglobal-excludeiu&'%s' expects ...cSsg|]}t|qS((u convert_path(u.0uw((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyu Vs u1FileList._parse_template_line..iurecursive-includeurecursive-excludeiu,'%s' expects ...cSsg|]}t|qS((u convert_path(u.0uw((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyu \s ugraftupruneu#'%s' expects a single uunknown action '%s'(uincludeuexcludeuglobal-includeuglobal-exclude(urecursive-includeurecursive-exclude(ugraftuprune(usplituNoneulenuDistutilsTemplateErroru convert_path(uselfulineuwordsuactionupatternsudiru dir_pattern((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyu_parse_template_lineKs,       uFileList._parse_template_linecCs|j|\}}}}|dkr}|jddj|x|D].}|j|ddsHtjd|qHqHWn|dkr|jddj|xs|D].}|j|ddstjd |qqWn:|d krA|jd dj|x|D].}|j|dd s tjd |q q Wn|dkr|jddj|x|D].}|j|dd sntjd|qnqnWnv|dkr|jd|dj|fxG|D]1}|j|d|stjd||qqWn |dkry|jd|dj|fx|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_lineu debug_printujoinuinclude_patternuloguwarnuexclude_patternuNoneuDistutilsInternalError(uselfulineuactionupatternsudiru dir_patternupattern((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyuprocess_template_linegsf                          uFileList.process_template_lineiicCsd}t||||}|jd|j|jdkrK|jnxJ|jD]?}|j|rU|jd||jj |d}qUqUW|S(uSelect 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_patternu debug_printupatternuallfilesuNoneufindallusearchufilesuappenduTrue(uselfupatternuanchoruprefixuis_regexu files_foundu pattern_reuname((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyuinclude_patterns    uFileList.include_patterncCsd}t||||}|jd|jxhtt|jdddD]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 FiiT( uFalseutranslate_patternu debug_printupatternurangeulenufilesusearchuTrue(uselfupatternuanchoruprefixuis_regexu files_foundu pattern_reui((u7/opt/alt/python33/lib64/python3.3/distutils/filelist.pyuexclude_patterns  &  uFileList.exclude_patternN(u__name__u __module__u __qualname__u__doc__uNoneu__init__u set_allfilesuosucurdirufindallu debug_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 krtj 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.pyufindalls&"        ufindallcCsStj|}tj}tjdkr0d}nd|}tjd||}|S(uTranslate 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((?t|}nd}|dk rtd}t|dt| }tj}tjdkrd}nd|j |d|f}n|rd|}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.pyus