ó
    Þ jX7  ã                   ó@  • S r SSK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	  SSK
Jr  S/r\R                  " \5      r\R                   " S\R"                  5      r\R                   " S	\R"                  \R&                  -  5      r\R*                  SS
 r " S S\5      rg)zu
Class representing the list of files in a distribution.

Equivalent to distutils.filelist, but fixes some problems.
é    Né   )ÚDistlibException)Úfsdecode)Úconvert_pathÚManifestz\\w*
z#.*?(?=
)|
(?=$)é   c                   ó€   • \ rS rSrSrSS jrS rS rS rSS jr	S	 r
S
 rS r  SS jr  SS jr  SS jrS rSrg)r   é&   zt
A list of files built by exploring the filesystem and filtered by applying various
patterns to what we find there.
Nc                 ó.  • [         R                  R                  [         R                  R                  U=(       d    [         R                  " 5       5      5      U l        U R
                  [         R                  -   U l        SU l        [        5       U l
        g)zL
Initialise an instance.

:param base: The base directory to explore under.
N)ÚosÚpathÚabspathÚnormpathÚgetcwdÚbaseÚsepÚprefixÚallfilesÚsetÚfiles)Úselfr   s     ÚV/var/www/html/gaurav/venv/lib/python3.13/site-packages/pip/_vendor/distlib/manifest.pyÚ__init__ÚManifest.__init__,   sV   € ô —G‘G—O‘O¤B§G¡G×$4Ñ$4°T×5H¼R¿YºY»[Ó$IÓJˆŒ	Ø—i‘i¤"§&¡&Ñ(ˆŒØˆŒÜ“Uˆ�
ó    c                 ó  • SSK JnJnJn  / =U l        nU R
                  nU/nUR                  nUR                  nU(       aÀ  U" 5       n[        R                  " U5      n	U	 H“  n
[        R                  R                  XZ5      n[        R                   " U5      nUR                  nU" U5      (       a  UR                  [        U5      5        Mm  U" U5      (       d  M|  U" U5      (       a  M‹  U" U5        M•     U(       a  M¿  gg)z]Find all files under the base and set ``allfiles`` to the absolute
pathnames of files found.
r   )ÚS_ISREGÚS_ISDIRÚS_ISLNKN)Ústatr   r   r   r   r   ÚpopÚappendr   Úlistdirr   ÚjoinÚst_moder   )r   r   r   r   r   ÚrootÚstackr!   ÚpushÚnamesÚnameÚfullnamer    Úmodes                 r   ÚfindallÚManifest.findall;   s¾   € ÷ 	3Ñ2à#%Ð%ˆŒ˜Ø�y‰yˆØ�ˆØ�i‰iˆØ�|‰|ˆæÙ“5ˆDÜ—J’J˜tÓ$ˆEã�ÜŸ7™7Ÿ<™<¨Ó3�ô —w’w˜xÓ(�Ø—|‘|�Ù˜4—=‘=Ø—O‘O¤H¨XÓ$6Ö7Ù˜T—]“]©7°4¯=«=Ù˜–Nñ ÷	 Šer   c                 ó  • UR                  U R                  5      (       d*  [        R                  R	                  U R
                  U5      nU R                  R                  [        R                  R                  U5      5        g)zb
Add a file to the manifest.

:param item: The pathname to add. This can be relative to the base.
N)	Ú
startswithr   r   r   r$   r   r   Úaddr   )r   Úitems     r   r1   ÚManifest.addV   sN   € ð �‰˜tŸ{™{×+Ñ+Ü—7‘7—<‘< §	¡	¨4Ó0ˆDØ�
‰
�‰”r—w‘w×'Ñ'¨Ó-Õ.r   c                 ó8   • U H  nU R                  U5        M     g)zn
Add a list of files to the manifest.

:param items: The pathnames to add. These can be relative to the base.
N)r1   )r   Úitemsr2   s      r   Úadd_manyÚManifest.add_many`   s   € ó ˆDØ�H‰H�TŽNò r   c                 óJ  ^ ^• UU 4S jm[        T R                  5      nU(       a=  [        5       nU H)  nT" U[        R                  R	                  U5      5        M+     X#-  n[        S U 5       5       Vs/ sH   n[        R                  R                  " U6 PM"     sn$ s  snf )z(
Return sorted files in directory order
c                 óØ   >• U R                  U5        [        R                  SU5        UTR                  :w  a2  [        R
                  R                  U5      u  p#US;  d   eT" X5        g g )Nzadd_dir added %s)Ú Ú/)r1   ÚloggerÚdebugr   r   r   Úsplit)ÚdirsÚdÚparentÚ_Úadd_dirr   s       €€r   rC   Ú Manifest.sorted.<locals>.add_dirn   sW   ø€ Ø�H‰H�QŒKÜ�L‰LÐ+¨QÔ/Ø�D—I‘I‹~ÜŸG™GŸM™M¨!Ó,‘	�Ø YÓ.Ð.Ð.Ù˜Õ%ð r   c              3   ó^   #   • U H$  n[         R                  R                  U5      v •  M&     g 7f©N)r   r   r>   )Ú.0r   s     r   Ú	<genexpr>Ú"Manifest.sorted.<locals>.<genexpr>}   s    é € Ð>±v¨t”r—w‘w—}‘} T×*Ð*²vùs   ‚+-)r   r   r   r   ÚdirnameÚsortedr$   )r   ÚwantdirsÚresultr?   ÚfÚ
path_tuplerC   s   `     @r   rK   ÚManifest.sortedi   sŠ   ù€ ö
	&ô �T—Z‘Z“ˆÞÜ“5ˆDÛ�Ù˜œbŸg™gŸo™o¨aÓ0Ö1ñ à‰NˆFäÑ>±vÓ>Ô>ó@Ù>ð /9”—‘—’˜jÓ)Ù>ñ@ð 	@ùò @s   Á7&B c                 ó0   • [        5       U l        / U l        g)zClear all collected files.N)r   r   r   )r   s    r   ÚclearÚManifest.clear   s   € ä“UˆŒ
Øˆ�r   c                 ó<  • U R                  U5      u  p#pEUS:X  a7  U H0  nU R                  USS9(       a  M  [        R                  SU5        M2     gUS:X  a  U H  nU R	                  USS9  M     gUS:X  a7  U H0  nU R                  USS9(       a  M  [        R                  SU5        M2     gUS	:X  a  U H  nU R	                  USS9  M     gUS
:X  a6  U H/  nU R                  XdS9(       a  M  [        R                  SXd5        M1     gUS:X  a  U H  nU R	                  XdS9  M     gUS:X  a-  U R                  SUS9(       d  [        R                  SU5        ggUS:X  a-  U R	                  SUS9(       d  [        R                  SU5        gg[        SU-  5      e)aF  
Process a directive which either adds some files from ``allfiles`` to
``files``, or removes some files from ``files``.

:param directive: The directive to process. This should be in a format
             compatible with distutils ``MANIFEST.in`` files:

             http://docs.python.org/distutils/sourcedist.html#commands
ÚincludeT)Úanchorzno files found matching %rÚexcludeúglobal-includeFz3no files found matching %r anywhere in distributionúglobal-excludeúrecursive-include)r   z-no files found matching %r under directory %rúrecursive-excludeÚgraftNz no directories found matching %rÚprunez4no previously-included directories found matching %rzinvalid action %r)Ú_parse_directiveÚ_include_patternr<   ÚwarningÚ_exclude_patternr   )r   Ú	directiveÚactionÚpatternsÚthedirÚ
dirpatternÚpatterns          r   Úprocess_directiveÚManifest.process_directive„   sÈ  € ð 04×/DÑ/DÀYÓ/OÑ,ˆ˜&ð
 �YÓÛ#�Ø×,Ñ,¨W¸TÐ,×BÐBÜ—N‘NÐ#?ÀÖIò $ð �yÓ Û#�Ø×%Ñ% g°dÐ%Ó;ò $ð Ð'Ó'Û#�Ø×,Ñ,¨W¸UÐ,×CÐCÜ—N‘Nð $>Ø?FöHò $ð
 Ð'Ó'Û#�Ø×%Ñ% g°eÐ%Ó<ò $ð Ð*Ó*Û#�Ø×,Ñ,¨WÐ,×DÐDÜ—N‘Nð $8Ø9@öJò $ð
 Ð*Ó*Û#�Ø×%Ñ% gÐ%Ó=ò $ð �wÓØ×(Ñ(¨°jÐ(ÖAÜ—‘ÐAØ)õ+ð Bð �wÓØ×(Ñ(¨°jÐ(ÖAÜ—‘ð  -Ø.8õ:ð Bô #Ø# fÑ,ó.ð .r   c                 óF  • UR                  5       n[        U5      S:X  a  US   S;  a  UR                  SS5        US   nS=n=pVUS;   a;  [        U5      S:  a  [        SU-  5      eUSS  Vs/ sH  n[	        U5      PM     nnO�US	;   aI  [        U5      S
:  a  [        SU-  5      e[	        US   5      nUSS  Vs/ sH  n[	        U5      PM     nnO@US;   a,  [        U5      S:w  a  [        SU-  5      e[	        US   5      nO[        SU-  5      eX4XV4$ s  snf s  snf )z
Validate a directive.
:param directive: The directive to validate.
:return: A tuple of action, patterns, thedir, dir_patterns
r   r   )rU   rW   rX   rY   rZ   r[   r\   r]   rU   N)rU   rW   rX   rY   r   z$%r expects <pattern1> <pattern2> ...)rZ   r[   é   z*%r expects <dir> <pattern1> <pattern2> ...)r\   r]   z!%r expects a single <dir_pattern>zunknown action %r)r>   ÚlenÚinsertr   r   )r   rb   Úwordsrc   rd   re   Údir_patternÚwords           r   r^   ÚManifest._parse_directiveÈ   sf  € ð —‘Ó!ˆÜˆu‹:˜‹?˜u Q™xð 0Bó  Bð �L‰L˜˜IÔ&à�q‘ˆØ*.Ð.ˆÐ.�6àð :ó :ä�5‹z˜A‹~Ü&Ø:¸VÑCóEð Eð 8=¸Q¸R±yÓA±y¨tœ TÖ*±yˆHÐAˆHàÐAÓAÜ�5‹z˜A‹~Ü&Ø@À6ÑIóKð Kô " %¨¡(Ó+ˆFØ7<¸Q¸R±yÓA±y¨tœ TÖ*±yˆHÐAˆHàÐ)Ó)Ü�5‹z˜Q‹Ü&Ø7¸&Ñ@óBð Bô ' u¨Q¡xÓ0‰Kô #Ð#6¸Ñ#?Ó@Ð@à Ð4Ð4ùò) Bùò Bs   Á/DÂ>Dc                 óø   • SnU R                  XX45      nU R                  c  U R                  5         U R                   H8  nUR                  U5      (       d  M  U R                  R                  U5        SnM:     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.
FT)Ú_translate_patternr   r-   Úsearchr   r1   )r   rg   rV   r   Úis_regexÚfoundÚ
pattern_rer*   s           r   r_   ÚManifest._include_pattern÷   sk   € ð8 ˆØ×,Ñ,¨W¸fÓOˆ
ð �=‰=Ñ Ø�L‰LŒNà—M”MˆDØ× Ñ  ×&Ó&Ø—
‘
—‘˜tÔ$Ø’ñ "ð ˆr   c                 óÐ   • SnU R                  XX45      n[        U R                  5       H8  nUR                  U5      (       d  M  U R                  R	                  U5        SnM:     U$ )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.

This API is public to allow e.g. exclusion of SCM subdirs, e.g. when
packaging source distributions
FT)rs   Úlistr   rt   Úremove)r   rg   rV   r   ru   rv   rw   rN   s           r   ra   ÚManifest._exclude_pattern   s]   € ð ˆØ×,Ñ,¨W¸fÓOˆ
Ü�d—j‘jÖ!ˆAØ× Ñ  ×#Ó#Ø—
‘
×!Ñ! !Ô$Ø’ñ "ð ˆr   c                 óÀ  • U(       a-  [        U[        5      (       a  [        R                  " U5      $ U$ [        S:”  a#  U R                  S5      R                  S5      u  pVnU(       aJ  U R                  U5      n[        S:”  a.  UR                  W5      (       a  UR                  W5      (       d   eOSn[        R                  " [        R                  R                  U R                  S5      5      n	UGb"  [        S::  a0  U R                  S5      n
U R                  U5      S[        U
5      *  nObU R                  U5      nUR                  W5      (       a  UR                  W5      (       d   eU[        U5      [        U5      [        U5      -
   n[        R                  n[        R                  S:X  a  Sn[        S::  a  SU	-   UR                  USU-   45      -   nOjU[        W5      [        U5      [        W5      -
   nU< U	< U< U< SU< U< 3nO1U(       a*  [        S::  a	  SU	-   U-   nOW< U	< 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).
)rk   r   rB   r:   NÚ\z\\Ú^z.*)Ú
isinstanceÚstrÚreÚcompileÚ_PYTHON_VERSIONÚ_glob_to_reÚ	partitionr0   ÚendswithÚescaper   r   r$   r   rl   r   )r   rg   rV   r   ru   ÚstartrB   Úendrw   r   Úempty_patternÚ	prefix_rer   s                r   rs   ÚManifest._translate_pattern4  s  € ö Ü˜'¤3×'Ñ'Ü—z’z 'Ó*Ð*à�ä˜VÓ#à ×,Ñ,¨SÓ1×;Ñ;¸CÓ@‰MˆE�cæØ×)Ñ)¨'Ó2ˆJÜ Ó'Ø!×,Ñ,¨U×3Ñ3¸
×8KÑ8KÈC×8PÑ8PÐPÐPøàˆJä�yŠyœŸ™Ÿ™ d§i¡i°Ó4Ó5ˆØÒä &Ó(Ø $× 0Ñ 0°Ó 4�Ø ×,Ñ,¨VÓ4Ð5I´s¸=Ó7IÐ6IÐJ‘	à ×,Ñ,¨VÓ4�	Ø ×+Ñ+¨E×2Ñ2°y×7IÑ7IÈ#×7NÑ7NÐNÐNØ%¤c¨%£j´#°i³.Ä3ÀsÃ8Ñ2KÐL�	Ü—&‘&ˆCÜ�v‰v˜‹~Ø�Ü &Ó(Ø  4™Z¨#¯(©(°IØ48¸:Ñ4Eð4Gó +Hñ H‘
ð (¬¨E«
´C¸
³OÄcÈ#ÃhÑ4NÐO�
Ú27ººyË#Ú2<ºcðC‘
ö Ü" fÓ,Ø!$ t¡¨jÑ!8‘Jâ.3²T¸:ÄcÈ%ÃjÀkÒ;RÐ!S�Jä�zŠz˜*Ó%Ð%r   c                 ó¶   • [         R                  " U5      n[        R                  n[        R                  S:X  a  SnSU-  n[        R
                  " SXB5      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).
r~   z\\\\z\1[^%s]z((?<!\\)(\\\\)*)\.)ÚfnmatchÚ	translater   r   r‚   Úsub)r   rg   rw   r   Úescapeds        r   r…   ÚManifest._glob_to_rek  sR   € ô ×&Ò& wÓ/ˆ
ô �f‰fˆÜ�6‰6�T‹>ð ˆCØ˜sÑ"ˆÜ—V’VÐ1°7ÓGˆ
ØÐr   )r   r   r   r   rF   )F)TNF)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r-   r1   r6   rK   rR   rh   r^   r_   ra   rs   r…   Ú__static_attributes__© r   r   r   r   &   sc   † ñô
	ò#ò6/òô@ò,ò
>.òH-5ð^ =AØ"'ô'ðR =AØ"'ôð( ?CØ$)ô5&õnr   )r˜   r�   Úloggingr   r‚   Úsysr:   r   Úcompatr   Úutilr   Ú__all__Ú	getLoggerr”   r<   rƒ   ÚMÚ_COLLAPSE_PATTERNÚSÚ_COMMENTED_LINEÚversion_infor„   Úobjectr   rš   r   r   Ú<module>r§      s“   ðñó
 Û Û 	Û 	Û 
å Ý Ý ð ˆ,€à	×	Ò	˜8Ó	$€ð —J’J˜z¨2¯4©4Ó0Ð Ø—*’*Ð1°2·4±4¸"¿$¹$±;Ó?€ð ×"Ñ" 2 AÐ&€ôZˆvõ Zr   