Edit File: filelist.pyo
� ��7ec�����������@���s����d��Z��d�Z�d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�l�m�Z�d�d�l�m�Z�m �Z �d�d�l �m�Z�d�d�d�������YZ�e�j �d ���Z�d ����Z�d�d�d�d ���Z�d�S(���ss���distutils.filelist Provides the FileList class, used for poking about the filesystem and building lists of files. s���$Id$i����N(���t���convert_path(���t���DistutilsTemplateErrort���DistutilsInternalError(���t���logt���FileListc�����������B���s����e��Z�d��Z�d�d�d���Z�d����Z�e�j�d���Z�d����Z �d����Z �d����Z�d����Z�d����Z �d ����Z�d ����Z�d�d�d�d ���Z�d�d�d�d���Z�RS(���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) c���������C���s���d��|��_�g��|��_�d��S(���N(���t���Nonet���allfilest���files(���t���selft���warnt���debug_print(����(����s*���/usr/lib64/python2.7/distutils/filelist.pyt���__init__���s���� c���������C���s ���|�|��_��d��S(���N(���R���(���R���R���(����(����s*���/usr/lib64/python2.7/distutils/filelist.pyt���set_allfiles$���s����c���������C���s���t��|���|��_�d��S(���N(���t���findallR���(���R���t���dir(����(����s*���/usr/lib64/python2.7/distutils/filelist.pyR ���'���s����c���������C���s"���d�d�l��m�}�|�r�|�GHn��d�S(���s~���Print 'msg' to stdout if the global DEBUG (taken from the DISTUTILS_DEBUG environment variable) flag is true. i����(���t���DEBUGN(���t���distutils.debugR���(���R���t���msgR���(����(����s*���/usr/lib64/python2.7/distutils/filelist.pyR ���*���s����c���������C���s���|��j��j�|���d��S(���N(���R���t���append(���R���t���item(����(����s*���/usr/lib64/python2.7/distutils/filelist.pyR���4���s����c���������C���s���|��j��j�|���d��S(���N(���R���t���extend(���R���t���items(����(����s*���/usr/lib64/python2.7/distutils/filelist.pyR���7���s����c���������C���s\���t��t�j�j�|��j���}�|�j����g��|��_�x*�|�D]"�}�|��j�j�t�j�j�|������q2�Wd��S(���N(���t���mapt���ost���patht���splitR���t���sortR���t���join(���R���t���sortable_filest ���sort_tuple(����(����s*���/usr/lib64/python2.7/distutils/filelist.pyR���:���s ���� c���������C���sY���xR�t��t�|��j���d�d�d���D]1�}�|��j�|�|��j�|�d�k�r �|��j�|�=q �q �Wd��S(���Ni���i����i����(���t���ranget���lenR���(���R���t���i(����(����s*���/usr/lib64/python2.7/distutils/filelist.pyt���remove_duplicatesE���s����&c���������C���s��|�j�����}�|�d�}�d��}�}�}�|�d�k�rh�t�|���d�k��rR�t�d�|���n��t�t�|�d���}�n��|�d�k�r��t�|���d�k��r��t�d�|���n��t�|�d���}�t�t�|�d���}�nN�|�d�k�r��t�|���d�k�r��t�d�|���n��t�|�d���}�n �t�d�|���|�|�|�|�f�S(���Ni����t���includet���excludes���global-includes���global-excludei���s&���'%s' expects <pattern1> <pattern2> ...i���s���recursive-includes���recursive-excludei���s,���'%s' expects <dir> <pattern1> <pattern2> ...t���graftt���prunes#���'%s' expects a single <dir_pattern>s���unknown action '%s'(���R"���R#���s���global-includes���global-exclude(���s���recursive-includes���recursive-exclude(���R$���R%���(���R���R���R���R���R���R����(���R���t���linet���wordst���actiont���patternsR���t���dir_pattern(����(����s*���/usr/lib64/python2.7/distutils/filelist.pyt���_parse_template_lineN���s,���� c���������C���s&��|��j��|���\�}�}�}�}�|�d�k�r}�|��j�d�d�j�|�����x�|�D].�}�|��j�|�d�d��sH�t�j�d�|���qH�qH�Wn�|�d�k�r��|��j�d�d�j�|�����x||�D].�}�|��j�|�d�d��s��t�j�d �|���q��q��WnC|�d �k�rE|��j�d�d�j�|�����x|�D]2�}�|��j�|�d�d��st�j�d �d�|���qqWn�|�d�k�r�|��j�d�d�j�|�����x�|�D].�}�|��j�|�d�d��srt�j�d�|���qrqrWn{|�d�k�r|��j�d�|�d�j�|���f���xL|�D]5�}�|��j�|�d�|��s�t�j�d �d�|�|���q�q�Wn|�d�k�r�|��j�d�|�d�j�|���f���x��|�D]1�}�|��j�|�d�|��sIt�j�d�|�|���qIqIWn��|�d�k�r�|��j�d�|���|��j�d��d�|��s"t�j�d�|���q"nY�|�d�k�r|��j�d�|���|��j�d��d�|��s"t�j�d�d�|���q"n �t�d �|���d��S(!���NR"���s���include t��� t���anchori���s%���warning: no files found matching '%s'R#���s���exclude s9���warning: no previously-included files found matching '%s's���global-includes���global-include i����s&���warning: no files found matching '%s' s���anywhere in distributions���global-excludes���global-exclude sR���warning: no previously-included files matching '%s' found anywhere in distributions���recursive-includes���recursive-include %s %st���prefixs���under directory '%s's���recursive-excludes���recursive-exclude %s %ssN���warning: no previously-included files matching '%s' found under directory '%s'R$���s���graft s+���warning: no directories found matching '%s'R%���s���prune s)���no previously-included directories found s ���matching '%s's'���this cannot happen: invalid action '%s'( ���R+���R ���R���t���include_patternR���R ���t���exclude_patternR���R���(���R���R&���R(���R)���R���R*���t���pattern(����(����s*���/usr/lib64/python2.7/distutils/filelist.pyt���process_template_linep���sh���� i���i����c���������C���s����d�}�t��|�|�|�|���}�|��j�d�|�j���|��j�d�k�rK�|��j����n��xJ�|��j�D]?�}�|�j�|���rU�|��j�d�|���|��j�j�|���d�}�qU�qU�W|�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. i����s%���include_pattern: applying regex r'%s's��� adding i���N( ���t���translate_patternR ���R1���R���R���R ���t���searchR���R���(���R���R1���R-���R.���t���is_regext���files_foundt ���pattern_ret���name(����(����s*���/usr/lib64/python2.7/distutils/filelist.pyR/�������s���� c���������C���s����d�}�t��|�|�|�|���}�|��j�d�|�j���xh�t�t�|��j���d�d�d���D]G�}�|�j�|��j�|���rO�|��j�d�|��j�|���|��j�|�=d�}�qO�qO�W|�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. i����s%���exclude_pattern: applying regex r'%s'i���i����s ��� removing (���R3���R ���R1���R���R���R���R4���(���R���R1���R-���R.���R5���R6���R7���R ���(����(����s*���/usr/lib64/python2.7/distutils/filelist.pyR0�������s���� & N(���t���__name__t ���__module__t���__doc__R���R���R���R���t���curdirR ���R ���R���R���R���R!���R+���R2���R/���R0���(����(����(����s*���/usr/lib64/python2.7/distutils/filelist.pyR������s��� " K-c���������C���s��d�d�l��m�}�m�}�m�}�m�}�g��}�|��g�}�|�j�}�|�j�}�x��|�r�|����}��t�j�|����} �x��| �D]��} �|��t�j �k�r��t�j �j�|��| ���}�n�| �}�t�j��|���}�|�|�} �|�| ���r��|�j�|���qk�|�| ���rk�|�| ���rk�|�|���qk�qk�WqF�W|�S(���s^���Find all files under 'dir' and return the list of full filenames (relative to 'dir'). i����(���t���ST_MODEt���S_ISREGt���S_ISDIRt���S_ISLNK(���t���statR=���R>���R?���R@���t���popR���R���t���listdirR<���R���R���(���R���R=���R>���R?���R@���t���listt���stackRB���t���pusht���namesR8���t���fullnameRA���t���mode(����(����s*���/usr/lib64/python2.7/distutils/filelist.pyR ������s&����" c���������C���sS���t��j�|����}�t�j�}�t�j�d�k�r0�d�}�n��d�|�}�t�j�d�|�|���}�|�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���((?<!\\)(\\\\)*)\.(���t���fnmatcht ���translateR���t���sept���ret���sub(���R1���R7���RL���t���escaped(����(����s*���/usr/lib64/python2.7/distutils/filelist.pyt ���glob_to_re ��s���� i���i����c���������C���s����|�r)�t��|��t���r"�t�j�|����S|��Sn��|��r>�t�|����}�n�d�}�|�d�k �r��t�d���}�t�|���t�|��� }�t�j�}�t�j�d�k�r��d�}�n��d�|�j �|�d�|�f���}�n�|�r��d�|�}�n��t�j�|���S(���s��Translate 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). t����s���\s���\\t���^s���.*N( ���t ���isinstancet���strRM���t���compileRP���R���R���R���RL���R���(���R1���R-���R.���R5���R7���t ���empty_patternt ���prefix_reRL���(����(����s*���/usr/lib64/python2.7/distutils/filelist.pyR3���8��s"���� (����(���R;���t���__revision__R���RM���RJ���t���distutils.utilR����t���distutils.errorsR���R���t ���distutilsR���R���R<���R ���RP���R���R3���(����(����(����s*���/usr/lib64/python2.7/distutils/filelist.pyt���<module>���s����