ó
    Eñié;  ã                  óÜ   • S r SSKJr  SSKrSSKrSSKrSSKrSSKJr  SSK	J
r
Jr  SSKJr  SSKJrJr  SS	KJr   " S
 S5      rS r " S S\5      r\R.                  4SS jjrS rSS jrg)zsdistutils.filelist

Provides the FileList class, used for poking about the filesystem
and building lists of files.
é    )ÚannotationsN)ÚIterable)ÚLiteralÚoverloadé   )Úlog)ÚDistutilsInternalErrorÚDistutilsTemplateError)Úconvert_pathc                  óî  • \ rS rSrSrSSS jjrSS jr\R                  4SS jjr	SS jr
SS jrSS	 jrSS
 jrSS jrS rSS jr\   S          S!S jj5       r\  S"         S#S jj5       r\          S#S j5       r   S          S$S jjr\   S          S!S jj5       r\  S"         S#S jj5       r\          S#S j5       r   S          S$S jjrSrg)%ÚFileListé   a¥  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                ó    • S U l         / U l        g ©N©ÚallfilesÚfiles)ÚselfÚwarnÚdebug_prints      Ú[/home/mande/repo/quber/.venv/lib/python3.13/site-packages/setuptools/_distutils/filelist.pyÚ__init__ÚFileList.__init__$   s   € ð /3ˆŒØ "ˆ�
ó    c                ó   • Xl         g r   )r   )r   r   s     r   Úset_allfilesÚFileList.set_allfiles*   s   € Ø �r   c                ó$   • [        U5      U l        g r   )Úfindallr   )r   Údirs     r   r   ÚFileList.findall-   s   € Ü ›ˆ�r   c                ó6   • SSK Jn  U(       a  [        U5        gg)znPrint '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   ÚFileList.debug_print0   s   € õ 	*æÜ�#�Jð r   c                ó:   • U R                   R                  U5        g r   )r   Úappend)r   Úitems     r   r)   ÚFileList.append;   s   € Ø�
‰
×Ñ˜$Õr   c                ó:   • U R                   R                  U5        g r   )r   Úextend)r   Úitemss     r   r-   ÚFileList.extend>   s   € Ø�
‰
×Ñ˜%Õ r   c                óþ   • [        [        [        R                  R                  U R
                  5      5      n/ U l        U H9  nU R
                  R                  [        R                  R                  " U6 5        M;     g r   )ÚsortedÚmapÚosÚpathÚsplitr   r)   Újoin)r   Úsortable_filesÚ
sort_tuples      r   ÚsortÚFileList.sortA   sO   € ä¤¤B§G¡G§M¡M°4·:±:Ó >Ó?ˆØˆŒ
Û(ˆJØ�J‰J×ÑœbŸg™gŸlšl¨JÐ7Ö8ò )r   c                ó¼   • [        [        U R                  5      S-
  SS5       H5  nU R                  U   U R                  US-
     :X  d  M(  U R                  U	 M7     g )Nr   r   éÿÿÿÿ)ÚrangeÚlenr   )r   Úis     r   Úremove_duplicatesÚFileList.remove_duplicatesJ   sJ   € ä”s˜4Ÿ:™:“¨Ñ*¨A¨rÖ2ˆAØ�z‰z˜!‰} §
¡
¨1¨q©5Ñ 1Õ1Ø—J‘J˜q’Mò 3r   c                óþ  • UR                  5       nUS   nS =n=pVUS;   a=  [        U5      S:  a  [        SU S35      eUSS   Vs/ s H  n[        U5      PM     nnO“US;   aK  [        U5      S:  a  [        SU S	35      e[        US   5      nUSS   Vs/ s H  n[        U5      PM     nnOBUS
;   a-  [        U5      S:w  a  [        SU S35      e[        US   5      nO[        SU S35      eX4XV4$ s  snf s  snf )Nr   )ÚincludeÚexcludeúglobal-includeúglobal-excludeé   Ú'z#' expects <pattern1> <pattern2> ...r   )úrecursive-includeúrecursive-excludeé   z)' expects <dir> <pattern1> <pattern2> ...)ÚgraftÚprunez ' expects a single <dir_pattern>zunknown action ')r5   r>   r
   r   )r   ÚlineÚwordsÚactionÚpatternsr    Údir_patternÚws           r   Ú_parse_template_lineÚFileList._parse_template_lineR   s9  € Ø—
‘
“ˆØ�q‘ˆà'+Ð+ˆÐ+�3àÐOÓOÜ�5‹z˜A‹~Ü,Ø˜�xÐBÐCóð ð 27°q°r±Ó;²¨Aœ Qž±ˆHÐ;ˆHØÐAÓAÜ�5‹z˜A‹~Ü,Ø˜�xÐHÐIóð ô ˜u Q™xÓ(ˆCØ16°q°r±Ó;²¨Aœ Qž±ˆHÐ;ˆHØÐ)Ó)Ü�5‹z˜Q‹Ü,Ø˜�xÐ?Ð@óð ô ' u¨Q¡xÓ0‰Kä(Ð+;¸F¸8À1Ð)EÓFÐFà #Ð3Ð3ùò# <ùò <s   ÁC5ÂC:c                ó*  • U R                  U5      u  p#pEUS:X  a[  U R                  SSR                  U5      -   5        U H1  nU R                  USS9(       a  M  [        R
                  " SU5        M3     g US:X  a[  U R                  SSR                  U5      -   5        U H1  nU R                  USS9(       a  M  [        R
                  " S	U5        M3     g US
:X  a[  U R                  SSR                  U5      -   5        U H1  nU R                  USS9(       a  M  [        R
                  " SU5        M3     g US:X  a[  U R                  SSR                  U5      -   5        U H1  nU R                  USS9(       a  M  [        R
                  " SU5        M3     g US:X  ai  U R                  SR                  USR                  U5      5      5        U H2  nU R                  XdS9(       a  M  Sn[        R
                  " XvU5        M4     g US:X  ah  U R                  SR                  USR                  U5      5      5        U H1  nU R                  XdS9(       a  M  [        R
                  " SUU5        M3     g US:X  aB  U R                  SU-   5        U R                  S US9(       d  [        R
                  " SU5        g g US:X  aB  U R                  SU-   5        U R                  S US9(       d  [        R
                  " SU5        g g [        SU S35      e) NrC   zinclude Ú T)Úanchorz%warning: no files found matching '%s'rD   zexclude z9warning: no previously-included files found matching '%s'rE   zglobal-include Fz>warning: no files found matching '%s' anywhere in distributionrF   zglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionrI   zrecursive-include {} {})Úprefixz:warning: no files found matching '%s' under directory '%s'rJ   zrecursive-exclude {} {}zNwarning: no previously-included files matching '%s' found under directory '%s'rL   zgraft z+warning: no directories found matching '%s'rM   zprune z6no previously-included directories found matching '%s'z$this cannot happen: invalid action 'rH   )	rT   r   r6   Úinclude_patternr   ÚwarningÚexclude_patternÚformatr	   )r   rN   rP   rQ   r    rR   Úpatternr&   s           r   Úprocess_template_lineÚFileList.process_template_linep   só  € ð 04×/HÑ/HÈÓ/NÑ,ˆ˜3ð
 �YÓØ×Ñ˜Z¨#¯(©(°8Ó*<Ñ<Ô=Û#�Ø×+Ñ+¨G¸DÐ+×AÐAÜ—K’KÐ GÈÖQò $ð �yÓ Ø×Ñ˜Z¨#¯(©(°8Ó*<Ñ<Ô=Û#�Ø×+Ñ+¨G¸DÐ+×AÐAÜ—K’KØSØöò $ð Ð'Ó'Ø×ÑÐ.°·±¸(Ó1CÑCÔDÛ#�Ø×+Ñ+¨G¸EÐ+×BÐBÜ—K’Kð7ð  öò $ð Ð'Ó'Ø×ÑÐ.°·±¸(Ó1CÑCÔDÛ#�Ø×+Ñ+¨G¸EÐ+×BÐBÜ—K’KðBð  öò $ð Ð*Ó*Ø×ÑÐ6×=Ñ=¸cÀ3Ç8Á8ÈHÓCUÓVÔWÛ#�Ø×+Ñ+¨GÐ+×@Ð@ØV�CÜ—K’K ¨cÖ2ò $ð
 Ð*Ó*Ø×ÑÐ6×=Ñ=¸cÀ3Ç8Á8ÈHÓCUÓVÔWÛ#�Ø×+Ñ+¨GÐ+×@Ð@Ü—K’Kð>ð  Øöò $ð �wÓØ×Ñ˜X¨Ñ3Ô4Ø×'Ñ'¨°[Ð'ÖAÜ—’ÐIÈ;ÕWð Bð �wÓØ×Ñ˜X¨Ñ3Ô4Ø×'Ñ'¨°[Ð'ÖAÜ—’ØMØõð Bô )Ø6°v°h¸aÐ@óð r   c                ó   • g r   © ©r   r^   rX   rY   Úis_regexs        r   rZ   ÚFileList.include_patternÈ   ó   € ð r   c               ó   • g r   rb   rc   s        r   rZ   re   Ð   ó   € ð r   c                ó   • g r   rb   rc   s        r   rZ   re   Ù   rf   r   c                óR  • Sn[        XX45      nU R                  SUR                   S35        U R                  c  U R	                  5         U R                   HL  nUR                  U5      (       d  M  U R                  SU-   5        U R                  R                  U5        SnMN     U$ )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'rH   z adding T)Útranslate_patternr   r^   r   r   Úsearchr   r)   )r   r^   rX   rY   rd   Úfiles_foundÚ
pattern_reÚnames           r   rZ   re   á   sœ   € ð@ ˆÜ& w¸ÓIˆ
Ø×ÑÐ=¸j×>PÑ>PÐ=QÐQRÐSÔTð �=‰=Ñ Ø�L‰LŒNà—M”MˆDØ× Ñ  ×&Ó&Ø× Ñ  ¨dÑ!2Ô3Ø—
‘
×!Ñ! $Ô'Ø"’ñ	 "ð
 Ðr   c                ó   • g r   rb   rc   s        r   r\   ÚFileList.exclude_pattern  rf   r   c               ó   • g r   rb   rc   s        r   r\   rq     rh   r   c                ó   • g r   rb   rc   s        r   r\   rq   !  rf   r   c                ó^  • Sn[        XX45      nU R                  SUR                   S35        [        [	        U R
                  5      S-
  SS5       HX  nUR                  U R
                  U   5      (       d  M(  U R                  SU R
                  U   -   5        U R
                  U	 SnMZ     U$ )zè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'rH   r   r<   z
 removing T)rk   r   r^   r=   r>   r   rl   )r   r^   rX   rY   rd   rm   rn   r?   s           r   r\   rq   )  s¡   € ð ˆÜ& w¸ÓIˆ
Ø×ÑÐ=¸j×>PÑ>PÐ=QÐQRÐSÔTÜ”s˜4Ÿ:™:“¨Ñ*¨B°Ö3ˆAØ× Ñ  §¡¨A¡×/Ó/Ø× Ñ  °·
±
¸1±Ñ!=Ô>Ø—J‘J˜q�MØ"’ñ	 4ð
 Ðr   r   )NN)r   Úobjectr   ru   ÚreturnÚNone)r   úIterable[str]rv   rw   )r    ústr | os.PathLike[str]rv   rw   )r&   ru   rv   rw   )r*   Ústrrv   rw   )r.   rx   rv   rw   )rv   rw   )rN   rz   rv   rw   ©TNF)
r^   rz   rX   ÚboolrY   ú
str | Nonerd   zLiteral[False]rv   r|   )TN)
r^   zstr | re.Pattern[str]rX   r|   rY   r}   rd   zLiteral[True]rv   r|   )
r^   zstr | re.PatternrX   r|   rY   r}   rd   r|   rv   r|   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r3   Úcurdirr   r   r)   r-   r9   r@   rT   r_   r   rZ   r\   Ú__static_attributes__rb   r   r   r   r      sˆ  † ñö#ô!ð 57·I±Iö %ôô ô!ô9ô"ò4ô<Uðp ð Ø!Ø#(ðàðð ðð ð	ð
 !ðð 
ôó ðð ð Ø!ð	à&ðð ðð ð	ð  ðð 
ôó ðð ðà&ðð ðð ð	ð
  ðð 
óó ðð Ø!Øð-à!ð-ð ð-ð ð	-ð
 ð-ð 
õ-ð^ ð Ø!Ø#(ðàðð ðð ð	ð
 !ðð 
ôó ðð ð Ø!ð	à&ðð ðð ð	ð  ðð 
ôó ðð ðà&ðð ðð ð	ð
  ðð 
óó ðð Ø!Øðà!ðð ðð ð	ð
 ðð 
÷ð r   r   c                ó¬   • [         R                  [        R                  " U SS95      nS U 5       n[        [        R                  R
                  U5      $ )z
Find all files under 'path'
T)Úfollowlinksc              3  óx   #   • U  H0  u  po3  H$  n[         R                  R                  X5      v •  M&     M2     g 7fr   )r3   r4   r6   )Ú.0ÚbaseÚdirsr   Úfiles        r   Ú	<genexpr>Ú#_find_all_simple.<locals>.<genexpr>I  s3   é € ð Ú:DÑ%6 T°ÓQVÈŒ�‰�‰�T× Ð ÑQVÑ º*ùs   ‚8:)Ú_UniqueDirsÚfilterr3   Úwalkr4   Úisfile)r4   Ú
all_uniqueÚresultss      r   Ú_find_all_simpler”   D  sE   € ô ×#Ñ#¤B§G¢G¨D¸dÑ$CÓD€JñÙ:Dó€Gô ”"—'‘'—.‘. 'Ó*Ð*r   c                  ó.   • \ rS rSrSrS r\S 5       rSrg)rŽ   iO  zv
Exclude previously-seen dirs from walk results,
avoiding infinite recursion.
Ref https://bugs.python.org/issue44497.
c                ó¸   • Uu  p#n[         R                  " U5      nUR                  UR                  4nX`;   nU(       a  USS2	 U R	                  U5        U(       + $ )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)r3   ÚstatÚst_devÚst_inoÚadd)r   Ú	walk_itemr‰   rŠ   r   r—   Ú	candidateÚfounds           r   Ú__call__Ú_UniqueDirs.__call__V  sS   € ð &Ñˆ�EÜ�wŠw�t‹}ˆØ—K‘K §¡Ð,ˆ	ØÑ!ˆÞØ’Q�Ø�‰�ÔØŒyÐr   c                ó$   • [        U " 5       U5      $ r   )r�   )Úclsr.   s     r   r�   Ú_UniqueDirs.filtere  s   € ä‘c“e˜UÓ#Ð#r   rb   N)	r~   r   r€   r�   r‚   rž   Úclassmethodr�   r„   rb   r   r   rŽ   rŽ   O  s    † ñòð ñ$ó ó$r   rŽ   c                óÆ   • [        U 5      nU [        R                  :X  a8  [        R                  " [        R
                  R                  U S9n[        X!5      n[        U5      $ )z€
Find all files under 'dir' and return the list of full filenames.
Unless dir is '.', return full filenames with dir prepended.
)Ústart)	r”   r3   rƒ   Ú	functoolsÚpartialr4   Úrelpathr2   Úlist)r    r   Úmake_rels      r   r   r   j  sH   € ô
 ˜SÓ!€EØ
Œb�i‰iÓÜ×$Ò$¤R§W¡W§_¡_¸CÑ@ˆÜ�HÓ$ˆÜ�‹;Ðr   c                ó¸   • [         R                  " U 5      n[        R                  n[        R                  S:X  a  SnSU S3n[        R
                  " SX15      nU$ )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[^Ú]z((?<!\\)(\\\\)*)\.)ÚfnmatchÚ	translater3   ÚsepÚreÚsub)r^   rn   r°   Úescapeds       r   Ú
glob_to_rer´   v  sU   € ô ×"Ò" 7Ó+€Jô �&‰&€CÜ	‡v�v�ƒ~ð ˆØ�c�U˜!ˆn€GÜ—’Ð-¨wÓC€JØÐr   c                óø  • U(       a-  [        U [        5      (       a  [        R                  " U 5      $ U $ [	        S5      R                  S5      u  pEnU (       a:  [	        U 5      nUR                  U5      (       a  UR                  U5      (       d   eOSnUb´  [	        U5      nUR                  U5      (       a  UR                  U5      (       d   eU[        U5      [        U5      [        U5      -
   n[        R                  n	[        R                  S:X  a  Sn	U[        U5      [        U5      [        U5      -
   nU SU U	 SU U 3nOU(       a  U SU[        U5      S  3n[        R                  " U5      $ )zó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.*)Ú
isinstancerz   r±   Úcompiler´   Ú	partitionÚ
startswithÚendswithr>   r3   r°   )
r^   rX   rY   rd   r¥   r¶   Úendrn   Ú	prefix_rer°   s
             r   rk   rk   �  sT  € ö Ü�gœs×#Ñ#Ü—:’:˜gÓ&Ð&àˆNô ˜s“O×-Ñ-¨cÓ2�M€EˆcæÜ Ó(ˆ
Ø×$Ñ$ U×+Ñ+°
×0CÑ0CÀC×0HÑ0HÐHÐHÐ0Hàˆ
àÑÜ˜vÓ&ˆ	Ø×#Ñ# E×*Ñ*¨y×/AÑ/AÀ#×/FÑ/FÐFÐFØœc %›j¬3¨y«>¼CÀ»HÑ+DÐEˆ	Ü�f‰fˆÜ�6‰6�T‹>ØˆCØ¤ E£
¬S°«_¼sÀ3»xÑ-GÐHˆ
Ø˜˜r ) ¨S¨E°°J°<À¸uÐE‰
æØ"˜G 2 j´°U³°Ð&>Ð%?Ð@ˆJä�:Š:�jÓ!Ð!r   )r    ry   r{   )r‚   Ú
__future__r   r®   r¦   r3   r±   Úcollections.abcr   Útypingr   r   Ú_logr   Úerrorsr	   r
   Úutilr   r   r”   ÚsetrŽ   rƒ   r   r´   rk   rb   r   r   Ú<module>rÆ      s`   ðñõ #ã Û Û 	Û 	Ý $ß $å ß BÝ ÷iñ iò^	+ô$�#ô $ð6 +-¯)©)ö 	òõ.""r   