§
    Á³g“5  ã                   ó°   — d Z ddl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  G d„ d¦  «        Zd	„ Z G d
„ de¦  «        Zej        fd„Zd„ Zdd„ZdS )zsdistutils.filelist

Provides the FileList class, used for poking about the filesystem
and building lists of files.
é    Né   ©Úconvert_path)ÚDistutilsTemplateErrorÚDistutilsInternalError)Úlogc                   ón   — e Zd ZdZdd„Zd„ Zej        fd„Zd„ Z	d„ Z
d„ Zd	„ Zd
„ Zd„ Zd„ Zdd„Zdd„ZdS )ÚFileListaÑ  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)
    Nc                 ó"   — d | _         g | _        d S ©N)ÚallfilesÚfiles)ÚselfÚwarnÚdebug_prints      ú\/var/www/html/mpstechhub/venv/lib/python3.11/site-packages/setuptools/_distutils/filelist.pyÚ__init__zFileList.__init__    s   € ð ˆŒØˆŒ
ˆ
ˆ
ó    c                 ó   — || _         d S r   )r   )r   r   s     r   Úset_allfileszFileList.set_allfiles&   s   € Ø ˆŒˆˆr   c                 ó.   — t          |¦  «        | _        d S r   )Úfindallr   )r   Údirs     r   r   zFileList.findall)   s   € Ý ™œˆŒˆˆr   c                 ó8   — ddl m} |rt          |¦  «         dS dS )z~Print 'msg' to stdout if the global DEBUG (taken from the
        DISTUTILS_DEBUG environment variable) flag is true.
        r   )ÚDEBUGN)Údistutils.debugr   Úprint)r   Úmsgr   s      r   r   zFileList.debug_print,   s7   € ð 	*Ð)Ð)Ð)Ð)Ð)àð 	Ý�#‰JŒJˆJˆJˆJð	ð 	r   c                 ó:   — | j                              |¦  «         d S r   )r   Úappend)r   Úitems     r   r    zFileList.append7   s   € ØŒ
×Ò˜$ÑÔÐÐÐr   c                 ó:   — | j                              |¦  «         d S r   )r   Úextend)r   Úitemss     r   r#   zFileList.extend:   s   € ØŒ
×Ò˜%Ñ Ô Ð Ð Ð r   c                 óÖ   — t          t          t          j        j        | j        ¦  «        ¦  «        }g | _        |D ]-}| j                             t          j        j        |Ž ¦  «         Œ.d S r   )ÚsortedÚmapÚosÚpathÚsplitr   r    Újoin)r   Úsortable_filesÚ
sort_tuples      r   ÚsortzFileList.sort=   sa   € å¥¥B¤G¤M°4´:Ñ >Ô >Ñ?Ô?ˆØˆŒ
Ø(ð 	9ð 	9ˆJØŒJ×Ò�bœgœl¨JÐ7Ñ8Ô8Ð8Ð8ð	9ð 	9r   c                 ó¦   — t          t          | j        ¦  «        dz
  dd¦  «        D ])}| j        |         | j        |dz
           k    r| j        |= Œ*d S )Nr   r   éÿÿÿÿ)ÚrangeÚlenr   )r   Úis     r   Úremove_duplicateszFileList.remove_duplicatesF   sZ   € å•s˜4œ:‘”¨Ñ*¨A¨rÑ2Ô2ð 	"ð 	"ˆAØŒz˜!Œ} ¤
¨1¨q©5Ô 1Ò1Ð1Ø”J˜q�Møð	"ð 	"r   c                 ó  — |                      ¦   «         }|d         }d x}x}}|dv r:t          |¦  «        dk     rt          d|z  ¦  «        ‚d„ |dd …         D ¦   «         }n¤|dv rOt          |¦  «        dk     rt          d	|z  ¦  «        ‚t          |d         ¦  «        }d
„ |dd …         D ¦   «         }nQ|dv r;t          |¦  «        dk    rt          d|z  ¦  «        ‚t          |d         ¦  «        }nt          d|z  ¦  «        ‚||||fS )Nr   )ÚincludeÚexcludeúglobal-includeúglobal-excludeé   z&'%s' expects <pattern1> <pattern2> ...c                 ó,   — g | ]}t          |¦  «        ‘ŒS © r   ©Ú.0Úws     r   ú
<listcomp>z1FileList._parse_template_line.<locals>.<listcomp>Y   ó   € Ð;Ð;Ð;¨A� Q™œÐ;Ð;Ð;r   r   )úrecursive-includeúrecursive-excludeé   z,'%s' expects <dir> <pattern1> <pattern2> ...c                 ó,   — g | ]}t          |¦  «        ‘ŒS r<   r   r=   s     r   r@   z1FileList._parse_template_line.<locals>.<listcomp>`   rA   r   )ÚgraftÚprunez#'%s' expects a single <dir_pattern>zunknown action '%s')r*   r2   r   r   )r   ÚlineÚwordsÚactionÚpatternsr   Údir_patterns          r   Ú_parse_template_linezFileList._parse_template_lineN   sM  € Ø—
’
‘”ˆØ�q”ˆà'+Ð+ˆÐ+�3˜àÐOÐOÐOÝ�5‰zŒz˜AŠ~ˆ~Ý,Ø<¸vÑEñô ð ð <Ð;°°q°r°r´Ð;Ñ;Ô;ˆHˆHØÐAÐAÐAÝ�5‰zŒz˜AŠ~ˆ~Ý,ØBÀVÑKñô ð õ ˜u QœxÑ(Ô(ˆCØ;Ð;°°q°r°r´Ð;Ñ;Ô;ˆHˆHØÐ)Ð)Ð)Ý�5‰zŒz˜QŠˆÝ,Ø9¸FÑBñô ð õ ' u¨Q¤xÑ0Ô0ˆKˆKå(Ð)>ÀÑ)GÑHÔHÐHà˜ # {Ð3Ð3r   c                 óŽ  — |                       |¦  «        \  }}}}|dk    r^|                      dd                     |¦  «        z   ¦  «         |D ].}|                      |d¬¦  «        st	          j        d|¦  «         Œ/d S |dk    r^|                      dd                     |¦  «        z   ¦  «         |D ].}|                      |d¬¦  «        st	          j        d	|¦  «         Œ/d S |d
k    r^|                      dd                     |¦  «        z   ¦  «         |D ].}|                      |d¬¦  «        st	          j        d|¦  «         Œ/d S |dk    r^|                      dd                     |¦  «        z   ¦  «         |D ].}|                      |d¬¦  «        st	          j        d|¦  «         Œ/d S |dk    rr|                      d                     |d                     |¦  «        ¦  «        ¦  «         |D ]1}|                      ||¬¦  «        sd}t	          j        |||¦  «         Œ2d S |dk    rp|                      d                     |d                     |¦  «        ¦  «        ¦  «         |D ]/}|                      ||¬¦  «        st	          j        d||¦  «         Œ0d S |dk    rH|                      d|z   ¦  «         |                      d |¬¦  «        st	          j        d|¦  «         d S d S |dk    rH|                      d|z   ¦  «         |                      d |¬¦  «        st	          j        d|¦  «         d S d S t          d|z  ¦  «        ‚)Nr6   zinclude ú r   )Úanchorz%warning: no files found matching '%s'r7   zexclude z9warning: no previously-included files found matching '%s'r8   zglobal-include r   z>warning: no files found matching '%s' anywhere in distributionr9   zglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionrB   zrecursive-include {} {})Úprefixz:warning: no files found matching '%s' under directory '%s'rC   zrecursive-exclude {} {}zNwarning: no previously-included files matching '%s' found under directory '%s'rF   zgraft z+warning: no directories found matching '%s'rG   zprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')	rM   r   r+   Úinclude_patternr   ÚwarningÚexclude_patternÚformatr   )r   rH   rJ   rK   r   rL   Úpatternr   s           r   Úprocess_template_linezFileList.process_template_linel   sL  € ð 04×/HÒ/HÈÑ/NÔ/NÑ,ˆ�˜3 ð
 �YÒÐØ×Ò˜Z¨#¯(ª(°8Ñ*<Ô*<Ñ<Ñ=Ô=Ð=Ø#ð Rð R�Ø×+Ò+¨G¸AÐ+Ñ>Ô>ð RÝ”KÐ GÈÑQÔQÐQøðRð Rð �yÒ Ð Ø×Ò˜Z¨#¯(ª(°8Ñ*<Ô*<Ñ<Ñ=Ô=Ð=Ø#ð ð �Ø×+Ò+¨G¸AÐ+Ñ>Ô>ð Ý”Kð2ð  ñô ð øðð ð Ð'Ò'Ð'Ø×ÒÐ.°·²¸(Ñ1CÔ1CÑCÑDÔDÐDØ#ð ð �Ø×+Ò+¨G¸AÐ+Ñ>Ô>ð Ý”Kð7ð  ñô ð øðð ð Ð'Ò'Ð'Ø×ÒÐ.°·²¸(Ñ1CÔ1CÑCÑDÔDÐDØ#ð ð �Ø×+Ò+¨G¸AÐ+Ñ>Ô>ð Ý”KðBð  ñô ð øðð ð Ð*Ò*Ð*Ø×ÒÐ6×=Ò=¸cÀ3Ç8Â8ÈHÑCUÔCUÑVÔVÑWÔWÐWØ#ð 3ð 3�Ø×+Ò+¨G¸CÐ+Ñ@Ô@ð 3àWð õ ”K  W¨cÑ2Ô2Ð2øð3ð 3ð Ð*Ò*Ð*Ø×ÒÐ6×=Ò=¸cÀ3Ç8Â8ÈHÑCUÔCUÑVÔVÑWÔWÐWØ#ð 	ð 	�Ø×+Ò+¨G¸CÐ+Ñ@Ô@ð Ý”Kð>ð  Øñô ð øð	ð 	ð �wÒÐØ×Ò˜X¨Ñ3Ñ4Ô4Ð4Ø×'Ò'¨°[Ð'ÑAÔAð XÝ”ÐIÈ;ÑWÔWÐWÐWÐWðXð Xð �wÒÐØ×Ò˜X¨Ñ3Ñ4Ô4Ð4Ø×'Ò'¨°[Ð'ÑAÔAð Ý”ØPØñô ð ð ð ðð õ )Ø9¸FÑBñô ð r   r   r   c                 óD  — d}t          ||||¦  «        }|                      d|j        z  ¦  «         | j        €|                      ¦   «          | j        D ]K}|                     |¦  «        r4|                      d|z   ¦  «         | j                             |¦  «         d}ŒL|S )a—  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, False otherwise.
        Fz%include_pattern: applying regex r'%s'Nz adding T)Útranslate_patternr   rV   r   r   Úsearchr   r    )r   rV   rP   rQ   Úis_regexÚfiles_foundÚ
pattern_reÚnames           r   rR   zFileList.include_patternÊ   s²   € ð4 ˆÝ& w°¸ÀÑIÔIˆ
Ø×ÒÐ@À:ÔCUÑUÑVÔVÐVð Œ=Ð Ø�LŠL‰NŒNˆNà”Mð 	#ð 	#ˆDØ× Ò  Ñ&Ô&ð #Ø× Ò  ¨dÑ!2Ñ3Ô3Ð3Ø”
×!Ò! $Ñ'Ô'Ð'Ø"�øØÐr   c                 óT  — d}t          ||||¦  «        }|                      d|j        z  ¦  «         t          t	          | j        ¦  «        dz
  dd¦  «        D ]O}|                     | j        |         ¦  «        r-|                      d| j        |         z   ¦  «         | j        |= d}ŒP|S )a  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 True if files are found, False otherwise.
        Fz%exclude_pattern: applying regex r'%s'r   r0   z
 removing T)rY   r   rV   r1   r2   r   rZ   )r   rV   rP   rQ   r[   r\   r]   r3   s           r   rT   zFileList.exclude_patternó   s±   € ð ˆÝ& w°¸ÀÑIÔIˆ
Ø×ÒÐ@À:ÔCUÑUÑVÔVÐVÝ•s˜4œ:‘”¨Ñ*¨B°Ñ3Ô3ð 	#ð 	#ˆAØ× Ò  ¤¨A¤Ñ/Ô/ð #Ø× Ò  °´
¸1´Ñ!=Ñ>Ô>Ð>Ø”J˜q�MØ"�øØÐr   )NN©r   Nr   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r(   Úcurdirr   r   r    r#   r.   r4   rM   rW   rR   rT   r<   r   r   r
   r
      sò   € € € € € ðð ðð ð ð ð!ð !ð !ð œ)ð %ð %ð %ð %ðð ð ð ð  ð  ð!ð !ð !ð9ð 9ð 9ð"ð "ð "ð4ð 4ð 4ð<Zð Zð Zð|'ð 'ð 'ð 'ðRð ð ð ð ð r   r
   c                 ó´   — t                                t          j        | d¬¦  «        ¦  «        }d„ |D ¦   «         }t          t          j        j        |¦  «        S )z%
    Find all files under 'path'
    T)Úfollowlinksc              3   óh   K  — | ]-\  }}}|D ]$}t           j                             ||¦  «        V — Œ%Œ.d S r   )r(   r)   r+   )r>   ÚbaseÚdirsr   Úfiles        r   ú	<genexpr>z#_find_all_simple.<locals>.<genexpr>  s^   è è € ð ð Ù%6 T¨4°ÐQVðð ØIM�Œ�Š�T˜4Ñ Ô ðð ð ð ð ð ð r   )Ú_UniqueDirsÚfilterr(   Úwalkr)   Úisfile)r)   Ú
all_uniqueÚresultss      r   Ú_find_all_simplers     sZ   € õ ×#Ò#¥B¤G¨D¸dÐ$CÑ$CÔ$CÑDÔD€Jðð Ø:Dðñ ô €Gõ •"”'”. 'Ñ*Ô*Ð*r   c                   ó.   — e Zd ZdZd„ Zed„ ¦   «         ZdS )rm   z†
    Exclude previously-seen dirs from walk results,
    avoiding infinite recursion.
    Ref https://bugs.python.org/issue44497.
    c                 ó˜   — |\  }}}t          j        |¦  «        }|j        |j        f}|| v }|r|dd…= |                      |¦  «         | S )z®
        Given an item from an os.walk result, determine
        if the item represents a unique dir for this instance
        and if not, prevent further traversal.
        N)r(   ÚstatÚst_devÚst_inoÚadd)r   Ú	walk_itemri   rj   r   rv   Ú	candidateÚfounds           r   Ú__call__z_UniqueDirs.__call__  sb   € ð &Ñˆˆd�EÝŒw�t‰}Œ}ˆØ”K ¤Ð,ˆ	Ø˜TÐ!ˆØð 	Ø�Q�Q�Q�Ø�Š�ÑÔÐØˆyÐr   c                 ó2   — t           | ¦   «         |¦  «        S r   )rn   )Úclsr$   s     r   rn   z_UniqueDirs.filter)  s   € å�c�c‘e”e˜UÑ#Ô#Ð#r   N)ra   rb   rc   rd   r}   Úclassmethodrn   r<   r   r   rm   rm     sH   € € € € € ðð ðð ð ð ð$ð $ñ „[ð$ð $ð $r   rm   c                 óÈ   — t          | ¦  «        }| t          j        k    r5t          j        t          j        j        | ¬¦  «        }t          ||¦  «        }t          |¦  «        S )zŒ
    Find all files under 'dir' and return the list of full filenames.
    Unless dir is '.', return full filenames with dir prepended.
    )Ústart)	rs   r(   re   Ú	functoolsÚpartialr)   Úrelpathr'   Úlist)r   r   Úmake_rels      r   r   r   .  sR   € õ
 ˜SÑ!Ô!€EØ
�bŒiÒÐÝÔ$¥R¤W¤_¸CÐ@Ñ@Ô@ˆÝ�H˜eÑ$Ô$ˆÝ�‰;Œ;Ðr   c                 ó    — t          j        | ¦  «        }t          j        }t          j        dk    rd}d|z  }t	          j        d||¦  «        }|S )zæ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).
    ú\z\\\\z\1[^%s]z((?<!\\)(\\\\)*)\.)ÚfnmatchÚ	translater(   ÚsepÚreÚsub)rV   r]   rŒ   Úescapeds       r   Ú
glob_to_rer�   :  sS   € õ Ô" 7Ñ+Ô+€Jõ Œ&€CÝ	„v�‚~€~ð ˆØ˜3Ñ€GÝ”Ð-¨w¸
ÑCÔC€JØÐr   c                 ód  — |r+t          | t          ¦  «        rt          j        | ¦  «        S | S t	          d¦  «                             d¦  «        \  }}}| r<t	          | ¦  «        }|                     |¦  «        r|                     |¦  «        sJ ‚nd}|�Ût	          |¦  «        }|                     |¦  «        r|                     |¦  «        sJ ‚|t          |¦  «        t          |¦  «        t          |¦  «        z
  …         }t          j
        }	t          j
        dk    rd}	|t          |¦  «        t          |¦  «        t          |¦  «        z
  …         }d                     |||	||¦  «        }n-|r+d                     ||t          |¦  «        d…         ¦  «        }t          j        |¦  «        S )a  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).
    Ú_Ú Nr‰   z\\z{}\A{}{}.*{}{}z{}\A{})Ú
isinstanceÚstrr�   Úcompiler�   Ú	partitionÚ
startswithÚendswithr2   r(   rŒ   rU   )
rV   rP   rQ   r[   r‚   r’   Úendr]   Ú	prefix_rerŒ   s
             r   rY   rY   Q  sœ  € ð ð Ý�g�sÑ#Ô#ð 	Ý”:˜gÑ&Ô&Ð&àˆNõ ˜s‘O”O×-Ò-¨cÑ2Ô2�M€Eˆ1ˆcàð Ý Ñ(Ô(ˆ
Ø×$Ò$ UÑ+Ô+ÐH°
×0CÒ0CÀCÑ0HÔ0HÐHÐHÐHÐHàˆ
àÐÝ˜vÑ&Ô&ˆ	Ø×#Ò# EÑ*Ô*ÐF¨y×/AÒ/AÀ#Ñ/FÔ/FÐFÐFÐFØ�c %™jœj­3¨y©>¬>½CÀ¹H¼HÑ+DÐDÔEˆ	ÝŒfˆÝŒ6�TŠ>ˆ>ØˆCØ¥ E¡
¤
­S°©_¬_½sÀ3¹x¼xÑ-GÐ GÔHˆ
Ø&×-Ò-¨e°YÀÀZÐQTÑUÔUˆ
ˆ
àð 	KØ"×)Ò)¨%°½CÀ¹J¼J¸L¸LÔ1IÑJÔJˆJåŒ:�jÑ!Ô!Ð!r   r`   )rd   r(   r�   rŠ   rƒ   Úutilr   Úerrorsr   r   Ú_logr   r
   rs   Úsetrm   re   r   r�   rY   r<   r   r   ú<module>r       s&  ððð ð 
€	€	€	Ø 	€	€	€	Ø €€€Ø Ð Ð Ð à Ð Ð Ð Ð Ð Ø BÐ BÐ BÐ BÐ BÐ BÐ BÐ BØ Ð Ð Ð Ð Ð ðqð qð qð qð qñ qô qð qðn+ð +ð +ð$ð $ð $ð $ð $�#ñ $ô $ð $ð6 ”	ð 	ð 	ð 	ð 	ðð ð ð.""ð ""ð ""ð ""ð ""ð ""r   