Ë
    ˜šãj_4  ã                   ó¬   — 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y)zsdistutils.filelist

Provides the FileList class, used for poking about the filesystem
and building lists of files.
é    N)Úconvert_path)ÚDistutilsTemplateErrorÚDistutilsInternalError)Úlogc                   óx   — 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y)Ú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 | _        y ©N)ÚallfilesÚfiles)ÚselfÚwarnÚdebug_prints      úi/var/www/html/python-recuperauto-other/env/lib/python3.12/site-packages/setuptools/_distutils/filelist.pyÚ__init__zFileList.__init__    s   € ð ˆŒØˆ�
ó    c                 ó   — || _         y r
   )r   )r   r   s     r   Úset_allfileszFileList.set_allfiles&   s	   € Ø ˆ�r   c                 ó$   — t        |«      | _        y r
   )Úfindallr   )r   Údirs     r   r   zFileList.findall)   s   € Ü ›ˆ�r   c                 ó,   — ddl m} |rt        |«       yy)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,   s   € õ 	*ÙÜ�#�Jð r   c                 ó:   — | j                   j                  |«       y r
   )r   Úappend)r   Úitems     r   r   zFileList.append6   s   € Ø�
‰
×Ñ˜$Õr   c                 ó:   — | j                   j                  |«       y r
   )r   Úextend)r   Úitemss     r   r!   zFileList.extend9   s   € Ø�
‰
×Ñ˜%Õ r   c                 óø   — t        t        t        j                  j                  | j
                  «      «      }g | _        |D ]7  }| j
                  j                  t        j                  j                  |Ž «       Œ9 y r
   )ÚsortedÚmapÚosÚpathÚsplitr   r   Újoin)r   Úsortable_filesÚ
sort_tuples      r   ÚsortzFileList.sort<   sT   € ä¤¤B§G¡G§M¡M°4·:±:Ó >Ó?ˆØˆŒ
Ø(ò 	9ˆJØ�J‰J×ÑœbŸg™gŸl™l¨JÐ7Õ8ñ	9r   c                 ó´   — t        t        | j                  «      dz
  dd«      D ]2  }| j                  |   | j                  |dz
     k(  sŒ&| j                  |= Œ4 y )Né   r   éÿÿÿÿ)ÚrangeÚlenr   )r   Úis     r   Úremove_duplicateszFileList.remove_duplicatesE   sO   € ä”s˜4Ÿ:™:“¨Ñ*¨A¨rÓ2ò 	"ˆAØ�z‰z˜!‰} §
¡
¨1¨q©5Ñ 1Ó1Ø—J‘J˜q‘Mñ	"r   c                 óÞ  — |j                  «       }|d   }d x}x}}|dv r8t        |«      dk  rt        d|z  «      ‚|dd  D �cg c]  }t        |«      ‘Œ }}n‡|dv rFt        |«      dk  rt        d|z  «      ‚t        |d   «      }|dd  D �cg c]  }t        |«      ‘Œ }}n=|d	v r+t        |«      dk7  rt        d
|z  «      ‚t        |d   «      }nt        d|z  «      ‚||||fS c c}w c c}w )Nr   )ÚincludeÚexcludeúglobal-includeúglobal-excludeé   z&'%s' expects <pattern1> <pattern2> ...r.   )úrecursive-includeúrecursive-excludeé   z,'%s' expects <dir> <pattern1> <pattern2> ...)ÚgraftÚprunez#'%s' expects a single <dir_pattern>zunknown action '%s')r(   r1   r   r   )r   ÚlineÚwordsÚactionÚpatternsr   Údir_patternÚws           r   Ú_parse_template_linezFileList._parse_template_lineM   s*  € Ø—
‘
“ˆØ�q‘ˆà'+Ð+ˆÐ+�3˜àð :ñ :ä�5‹z˜AŠ~Ü,Ø>ÀÑGóIð Ià16°q°r°Ö;¨Aœ Q�Ð;ˆHÑ;ØÐAÑAÜ�5‹z˜AŠ~Ü,ØDÀvÑMóOð Oä˜u Q™xÓ(ˆCØ16°q°r°Ö;¨Aœ Q�Ð;ˆHÑ;ØÐ)Ñ)Ü�5‹z˜QŠÜ,Ø;¸fÑDóFð Fä& u¨Q¡xÓ0‰Kä(Ð)>ÀÑ)GÓHÐHà˜ # {Ð3Ð3ùò <ùò <s   ÁC%ÂC*c                 ó¦  — | j                  |«      \  }}}}|dk(  rU| j                  ddj                  |«      z   «       |D ],  }| j                  |d¬«      rŒt	        j
                  d|«       Œ. y |dk(  rU| j                  ddj                  |«      z   «       |D ],  }| j                  |d¬«      rŒt	        j
                  d	|«       Œ. y |d
k(  rU| j                  ddj                  |«      z   «       |D ],  }| j                  |d¬«      rŒt	        j
                  d|«       Œ. y |dk(  rU| j                  ddj                  |«      z   «       |D ],  }| j                  |d¬«      rŒt	        j
                  d|«       Œ. y |dk(  r[| j                  d|›ddj                  |«      ›�«       |D ]/  }| j                  ||¬«      rŒd}t	        j
                  |||«       Œ1 y |dk(  rY| j                  d|›ddj                  |«      ›�«       |D ]-  }| j                  ||¬«      rŒt	        j
                  d||«       Œ/ y |dk(  r?| j                  d|z   «       | j                  d |¬«      st	        j
                  d|«       y y |dk(  r?| j                  d|z   «       | j                  d |¬«      st	        j
                  d|«       y y t        d|z  «      ‚)Nr5   zinclude ú r.   )Úanchorz%warning: no files found matching '%s'r6   zexclude z9warning: no previously-included files found matching '%s'r7   zglobal-include r   z>warning: no files found matching '%s' anywhere in distributionr8   zglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionr:   zrecursive-include )Úprefixz:warning: no files found matching '%s' under directory '%s'r;   zrecursive-exclude zNwarning: no previously-included files matching '%s' found under directory '%s'r=   zgraft z+warning: no directories found matching '%s'r>   zprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')rE   r   r)   Úinclude_patternr   r   Úexclude_patternr   )r   r?   rA   rB   r   rC   Úpatternr   s           r   Úprocess_template_linezFileList.process_template_linei   s  € ð 04×/HÑ/HÈÓ/NÑ,ˆ�˜3 ð
 �YÒØ×Ñ˜Z¨#¯(©(°8Ó*<Ñ<Ô=Ø#ò &�Ø×+Ñ+¨G¸AÐ+Õ>Ü—H‘HÐDØ$õ&ñ&ð
 �yÒ Ø×Ñ˜Z¨#¯(©(°8Ó*<Ñ<Ô=Ø#ò ?�Ø×+Ñ+¨G¸AÐ+Õ>Ü—H‘Hð 4Ø6=õ?ñ?ð
 Ð'Ò'Ø×ÑÐ.°·±¸(Ó1CÑCÔDØ#ò D�Ø×+Ñ+¨G¸AÐ+Õ>Ü—H‘Hð 9Ø;BõDñDð
 Ð'Ò'Ø×ÑÐ.°·±¸(Ó1CÑCÔDØ#ò &�Ø×+Ñ+¨G¸AÐ+Õ>Ü—H‘Hð Dà$õ&ñ&ð Ð*Ò*Ø×ÒÚ! 3§8¡8¨HÔ#5ð7ô 8à#ò 0�Ø×+Ñ+¨G¸CÐ+Õ@ð/ð ô —H‘H˜S '¨3Õ/ñ0ð Ð*Ò*Ø×ÒÚ! 3§8¡8¨HÔ#5ð7ô 8à#ò +�Ø×+Ñ+¨G¸CÐ+Õ@Ü—H‘Hð @à$ cõ+ñ+ð �wÒØ×Ñ˜X¨Ñ3Ô4Ø×'Ñ'¨°[Ð'ÔAÜ—‘ÐFØ$õ&ð Bð �wÒØ×Ñ˜X¨Ñ3Ô4Ø×'Ñ'¨°[Ð'ÔAÜ—‘ð *Ø,7õ9ð Bô )Ø;¸fÑDóFð Fr   c                 óB  — d}t        ||||«      }| j                  d|j                  z  «       | j                  €| j	                  «        | j                  D ]E  }|j                  |«      sŒ| j                  d|z   «       | j                  j                  |«       d}ŒG |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'z adding T)Útranslate_patternr   rL   r   r   Úsearchr   r   )r   rL   rH   rI   Úis_regexÚfiles_foundÚ
pattern_reÚnames           r   rJ   zFileList.include_pattern¶   s    € ð4 ˆÜ& w°¸ÀÓIˆ
Ø×ÑÐ@Ø#×+Ñ+ñ,ô 	-ð �=‰=Ð Ø�L‰LŒNà—M‘Mò 	#ˆDØ× Ñ  Õ&Ø× Ñ  ¨dÑ!2Ô3Ø—
‘
×!Ñ! $Ô'Ø"‘ð		#ð
 Ðr   c                 óP  — d}t        ||||«      }| j                  d|j                  z  «       t        t	        | j
                  «      dz
  dd«      D ]Q  }|j                  | j
                  |   «      sŒ"| j                  d| j
                  |   z   «       | j
                  |= d}ŒS |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.   r/   z
 removing T)rO   r   rL   r0   r1   r   rP   )r   rL   rH   rI   rQ   rR   rS   r2   s           r   rK   zFileList.exclude_patternà   s¦   € ð ˆÜ& w°¸ÀÓIˆ
Ø×ÑÐ@Ø#×+Ñ+ñ,ô 	-ä”s˜4Ÿ:™:“ qÑ(¨"¨bÓ1ò 	#ˆAØ× Ñ  §¡¨A¡Õ/Ø× Ñ  °·
±
¸1±Ñ!=Ô>Ø—J‘J˜q�MØ"‘ð		#ð
 Ðr   )NN©r.   Nr   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r&   Úcurdirr   r   r   r!   r,   r3   rE   rM   rJ   rK   © r   r   r   r      sU   „ ñóò!ð Ÿ)™)ó %òò ò!ò9ò"ò4ò8IFóZ(ðV <=ôr   r   c                 ó°   — t         j                  t        j                  | d¬«      «      }d„ |D «       }t        t        j                  j
                  |«      S )z%
    Find all files under 'path'
    T)Úfollowlinksc              3   ór   K  — | ]/  \  }}}|D ]$  }t         j                  j                  ||«      –— Œ& Œ1 y ­wr
   )r&   r'   r)   )Ú.0ÚbaseÚdirsr   Úfiles        r   ú	<genexpr>z#_find_all_simple.<locals>.<genexpr>û   sB   è ø€ ò áˆD�$˜Øòð ô 	�‰�‰�T˜4× ðØ ñùs   ‚57)Ú_UniqueDirsÚfilterr&   Úwalkr'   Úisfile)r'   Ú
all_uniqueÚresultss      r   Ú_find_all_simplerk   ö   sE   € ô ×#Ñ#¤B§G¡G¨D¸dÔ$CÓD€Jñà!+ô€Gô
 ”"—'‘'—.‘. 'Ó*Ð*r   c                   ó&   — e Zd ZdZd„ Zed„ «       Zy)re   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…= | j	                  |«       | 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_itemra   rb   r   rn   Ú	candidateÚfounds           r   Ú__call__z_UniqueDirs.__call__	  sW   € ð &Ñˆˆd�EÜ�w‰w�t‹}ˆØ—K‘K §¡Ð,ˆ	Ø˜TÐ!ˆÙØ’Q�Ø�‰�ÔØˆyÐr   c                 ó$   — t         | «       |«      S r
   )rf   )Úclsr"   s     r   rf   z_UniqueDirs.filter  s   € ä‘c“e˜UÓ#Ð#r   N)rW   rX   rY   rZ   ru   Úclassmethodrf   r\   r   r   re   re     s    „ ñò
ð ñ$ó ñ$r   re   c                 óÊ   — t        | «      }| t        j                  k(  r;t        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)	rk   r&   r[   Ú	functoolsÚpartialr'   Úrelpathr%   Úlist)r   r   Úmake_rels      r   r   r     sJ   € ô
 ˜SÓ!€EØ
Œb�i‰iÒÜ×$Ñ$¤R§W¡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)rL   rS   r„   Úescapeds       r   Ú
glob_to_rerˆ   )  sT   € ô ×"Ñ" 7Ó+€Jô �&‰&€CÜ	‡v�v�‚~ð ˆØ˜3Ñ€GÜ—‘Ð-¨w¸
ÓC€JØÐr   c                 ó   — |r't        | t        «      rt        j                  | «      S | S t	        d«      j                  d«      \  }}}| r/t	        | «      }|j                  |«      r|j                  |«      sJ ‚d}|�©t	        |«      }|j                  |«      r|j                  |«      sJ ‚|t        |«      t        |«      t        |«      z
   }t        j                  }	t        j                  dk(  rd}	|t        |«      t        |«      t        |«      z
   }|›d|›|	›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\Az.*)Ú
isinstanceÚstrr…   Úcompilerˆ   Ú	partitionÚ
startswithÚendswithr1   r&   r„   )
rL   rH   rI   rQ   rz   rŠ   ÚendrS   Ú	prefix_rer„   s
             r   rO   rO   @  s3  € ñ Ü�gœsÔ#Ü—:‘:˜gÓ&Ð&àˆNô ˜s“O×-Ñ-¨cÓ2�M€Eˆ1ˆcáÜ Ó(ˆ
Ø×$Ñ$ UÔ+°
×0CÑ0CÀCÔ0HÐHÐHàˆ
àÐÜ˜vÓ&ˆ	Ø×#Ñ# EÔ*¨y×/AÑ/AÀ#Ô/FÐFÐFØœc %›j¬#¨i«.¼3¸s»8Ñ*CÐDˆ	Ü�f‰fˆÜ�6‰6�TŠ>ØˆCØ¤ E£
¬C°
«O¼cÀ#»hÑ,FÐGˆ
â‘9šc¡:©sð4‰
ñ Ú&+¨Z¼¸E»
¸Ñ-DÐEˆJä�:‰:�jÓ!Ð!r   rV   )rZ   r&   r…   r‚   r{   Údistutils.utilr   Údistutils.errorsr   r   Ú	distutilsr   r   rk   Úsetre   r[   r   rˆ   rO   r\   r   r   ú<module>r˜      sW   ðñó 
Û 	Û Û å 'ß KÝ ÷`ñ `òJ
+ô$�#ô $ð4 —	‘	ó 	òô.#"r   