§
    
Á³gÛ9  ã                   ó  — d Z ddl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	 ddl
mZ dgZ ej        e¦  «        Z ej        dej        ¦  «        Z ej        d	ej        ej        z  ¦  «        Zej        dd
…         Z G d„ de¦  «        ZdS )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                   óp   — e Zd ZdZdd„Zd„ Zd„ Zd„ Zdd„Zd	„ Z	d
„ Z
d„ Z	 	 dd„Z	 	 dd„Z	 	 dd„Zd„ ZdS )r   z~A list of files built by on exploring the filesystem and filtered by
    applying various patterns to what we find there.
    Nc                 ó  — t           j                             t           j                             |pt          j        ¦   «         ¦  «        ¦  «        | _        | j        t           j        z   | _        d| _        t          ¦   «         | _
        dS )zd
        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     úZ/var/www/html/mpstechhub/venv/lib/python3.11/site-packages/pip/_vendor/distlib/manifest.pyÚ__init__zManifest.__init__*   sZ   € õ ”G—O’O¥B¤G×$4Ò$4°TÐ5H½R¼Y¹[¼[Ñ$IÔ$IÑJÔJˆŒ	Ø”i¥"¤&Ñ(ˆŒØˆŒÝ‘U”UˆŒ
ˆ
ˆ
ó    c                 óÂ  — ddl m}m}m} g x| _        }| j        }|g}|j        }|j        }|r± |¦   «         }t          j	        |¦  «        }	|	D ]Œ}
t          j
                             ||
¦  «        }t          j         |¦  «        }|j        } ||¦  «        r#|                     t          |¦  «        ¦  «         Œk ||¦  «        r ||¦  «        s ||¦  «         Œ�|°¯dS dS )zmFind 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   ÚfindallzManifest.findall9   s   € ð 	3Ð2Ð2Ð2Ð2Ð2Ð2Ð2Ð2Ð2à#%Ð%ˆŒ˜ØŒyˆØ�ˆØŒiˆØŒ|ˆàð 	#Ø�3‘5”5ˆDÝ”J˜tÑ$Ô$ˆEàð 	#ð 	#�Ýœ7Ÿ<š<¨¨dÑ3Ô3�õ ”w˜xÑ(Ô(�Ø”|�Ø�7˜4‘=”=ð #Ø—O’O¥H¨XÑ$6Ô$6Ñ7Ô7Ð7Ð7Ø�W˜T‘]”]ð #¨7¨7°4©=¬=ð #Ø�D˜‘N”N�Nøð ð 	#ð 	#ð 	#ð 	#ð 	#r   c                 óò   — |                      | j        ¦  «        s%t          j                             | j        |¦  «        }| j                             t          j                             |¦  «        ¦  «         dS )zz
        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   r/   zManifest.addT   s[   € ð �Š˜tœ{Ñ+Ô+ð 	1Ý”7—<’< ¤	¨4Ñ0Ô0ˆDØŒ
�Š•r”w×'Ò'¨Ñ-Ô-Ñ.Ô.Ð.Ð.Ð.r   c                 ó:   — |D ]}|                       |¦  «         ŒdS )z†
        Add a list of files to the manifest.

        :param items: The pathnames to add. These can be relative to the base.
        N)r/   )r   Úitemsr0   s      r   Úadd_manyzManifest.add_many^   s.   € ð ð 	ð 	ˆDØ�HŠH�T‰NŒNˆNˆNð	ð 	r   Fc                 ó  ‡ ‡— ˆˆ fd„Št          ‰ j        ¦  «        }|rAt          ¦   «         }|D ]+} ‰|t          j                             |¦  «        ¦  «         Œ,||z  }d„ t          d„ |D ¦   «         ¦  «        D ¦   «         S )z8
        Return sorted files in directory order
        c                 óê   •— |                       |¦  «         t                               d|¦  «         |‰j        k    r6t          j                             |¦  «        \  }}|dvsJ ‚ ‰| |¦  «         d S d S )Nzadd_dir added %s)Ú ú/)r/   ÚloggerÚdebugr   r   r   Úsplit)ÚdirsÚdÚparentÚ_Úadd_dirr   s       €€r   r?   z Manifest.sorted.<locals>.add_dirl   sy   ø€ Ø�HŠH�Q‰KŒKˆKÝ�LŠLÐ+¨QÑ/Ô/Ð/Ø�D”IŠ~ˆ~ÝœGŸMšM¨!Ñ,Ô,‘	�˜Ø YÐ.Ð.Ð.Ð.Ø�˜˜fÑ%Ô%Ð%Ð%Ð%ð ˆ~r   c                 ó4   — g | ]}t          j        j        |Ž ‘ŒS © )r   r   r#   )Ú.0Ú
path_tuples     r   ú
<listcomp>z#Manifest.sorted.<locals>.<listcomp>z   s3   € ð @ð @ð @¨j•””˜jÐ)ð @ð @ð @r   c              3   óT   K  — | ]#}t           j                             |¦  «        V — Œ$d S ©N)r   r   r:   )rB   r   s     r   ú	<genexpr>z"Manifest.sorted.<locals>.<genexpr>{   s0   è è € Ð>Ð>¨t•r”w—}’} TÑ*Ô*Ð>Ð>Ð>Ð>Ð>Ð>r   )r   r   r   r   ÚdirnameÚsorted)r   ÚwantdirsÚresultr;   Úfr?   s   `    @r   rI   zManifest.sortedg   s»   øø€ ð
	&ð 	&ð 	&ð 	&ð 	&ð 	&õ �T”Z‘”ˆØð 	Ý‘5”5ˆDØð 2ð 2�Ø�˜�bœgŸošo¨aÑ0Ô0Ñ1Ô1Ð1Ð1Ø�d‰NˆFð@ð @ÝÐ>Ð>°vÐ>Ñ>Ô>Ñ>Ô>ð@ñ @ô @ð 	@r   c                 ó:   — t          ¦   «         | _        g | _        dS )zClear all collected files.N)r   r   r   )r   s    r   ÚclearzManifest.clear}   s   € å‘U”UˆŒ
ØˆŒˆˆr   c                 óž  — |                       |¦  «        \  }}}}|dk    r9|D ]4}|                      |d¬¦  «        st                               d|¦  «         Œ5dS |dk    r|D ]}|                      |d¬¦  «        }ŒdS |dk    r9|D ]4}|                      |d¬¦  «        st                               d|¦  «         Œ5dS |d	k    r|D ]}|                      |d¬¦  «        }ŒdS |d
k    r:|D ]5}|                      ||¬¦  «        st                               d||¦  «         Œ6dS |dk    r|D ]}|                      ||¬¦  «        }ŒdS |dk    r6|                      d|¬¦  «        st                               d|¦  «         dS dS |dk    r6|                      d|¬¦  «        st                               d|¦  «         dS dS t          d|z  ¦  «        ‚)av  
        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_patternr8   ÚwarningÚ_exclude_patternr   )r   Ú	directiveÚactionÚpatternsÚthedirÚ
dirpatternÚpatternÚfounds           r   Úprocess_directivezManifest.process_directive‚   sì  € ð 04×/DÒ/DÀYÑ/OÔ/OÑ,ˆ�˜& *ð
 �YÒÐØ#ð Jð J�Ø×,Ò,¨W¸TÐ,ÑBÔBð JÝ—N’NÐ#?ÀÑIÔIÐIøðJð Jð �yÒ Ð Ø#ð Dð D�Ø×-Ò-¨g¸dÐ-ÑCÔC��ðDð Dð Ð'Ò'Ð'Ø#ð Hð H�Ø×,Ò,¨W¸UÐ,ÑCÔCð HÝ—N’Nð $>Ø?FñHô Hð HøðHð Hð
 Ð'Ò'Ð'Ø#ð Eð E�Ø×-Ò-¨g¸eÐ-ÑDÔD��ðEð Eð Ð*Ò*Ð*Ø#ð Jð J�Ø×,Ò,¨W¸VÐ,ÑDÔDð JÝ—N’Nð $8Ø9@À&ñJô Jð JøðJð Jð
 Ð*Ò*Ð*Ø#ð Fð F�Ø×-Ò-¨g¸fÐ-ÑEÔE��ðFð Fð �wÒÐØ×(Ò(¨°jÐ(ÑAÔAð +Ý—’ÐAØ)ñ+ô +ð +ð +ð +ð+ð +ð �wÒÐØ×(Ò(¨°jÐ(ÑAÔAð :Ý—’ð  -Ø.8ñ:ô :ð :ð :ð :ð:ð :õ #Ø# fÑ,ñ.ô .ð .r   c                 ó|  — |                      ¦   «         }t          |¦  «        dk    r |d         dvr|                     dd¦  «         |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 )zŸ
        Validate a directive.
        :param directive: The directive to validate.
        :return: A tuple of action, patterns, thedir, dir_patterns
        r   r   )rP   rR   rS   rT   rU   rV   rW   rX   rP   N)rP   rR   rS   rT   r	   z$%r expects <pattern1> <pattern2> ...c                 ó,   — g | ]}t          |¦  «        ‘ŒS rA   r   ©rB   Úwords     r   rD   z-Manifest._parse_directive.<locals>.<listcomp>ê   ó    € ÐAÐAÐA¨t� TÑ*Ô*ÐAÐAÐAr   )rU   rV   é   z*%r expects <dir> <pattern1> <pattern2> ...c                 ó,   — g | ]}t          |¦  «        ‘ŒS rA   r   rg   s     r   rD   z-Manifest._parse_directive.<locals>.<listcomp>ò   ri   r   )rW   rX   z!%r expects a single <dir_pattern>zunknown action %r)r:   ÚlenÚinsertr   r   )r   r]   Úwordsr^   r_   r`   Údir_patterns          r   rY   zManifest._parse_directiveÑ   s   € ð —’Ñ!Ô!ˆÝˆu‰:Œ:˜Š?ˆ?˜u Qœxð 0Bð  Bð  Bð �LŠL˜˜IÑ&Ô&Ð&à�q”ˆØ*.Ð.ˆÐ.�6˜Kàð :ð :ð :å�5‰zŒz˜AŠ~ˆ~Ý&Ø:¸VÑCñEô Eð Eð BÐA°u¸Q¸R¸R´yÐAÑAÔAˆHˆHàÐAÐAÐAÝ�5‰zŒz˜AŠ~ˆ~Ý&Ø@À6ÑIñKô Kð Kõ " %¨¤(Ñ+Ô+ˆFØAÐA°u¸Q¸R¸R´yÐAÑAÔAˆHˆHàÐ)Ð)Ð)Ý�5‰zŒz˜QŠˆÝ&Ø7¸&Ñ@ñBô Bð Bõ ' u¨Q¤xÑ0Ô0ˆKˆKõ #Ð#6¸Ñ#?Ñ@Ô@Ð@à�x ¨Ð4Ð4r   Tc                 óæ   — d}|                       ||||¦  «        }| j        €|                      ¦   «          | j        D ]3}|                     |¦  «        r| j                             |¦  «         d}Œ4|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.
        FNT)Ú_translate_patternr   r,   Úsearchr   r/   )r   rb   rQ   r   Úis_regexrc   Ú
pattern_rer)   s           r   rZ   zManifest._include_pattern   s   € ð8 ˆØ×,Ò,¨W°f¸fÀhÑOÔOˆ
ð Œ=Ð Ø�LŠL‰NŒNˆNà”Mð 	ð 	ˆDØ× Ò  Ñ&Ô&ð Ø”
—’˜tÑ$Ô$Ð$Ø�øØˆr   c                 óÊ   — d}|                       ||||¦  «        }t          | j        ¦  «        D ]3}|                     |¦  «        r| j                             |¦  «         d}Œ4|S )at  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)rq   Úlistr   rr   Úremove)r   rb   rQ   r   rs   rc   rt   rL   s           r   r\   zManifest._exclude_pattern)  sr   € ð ˆØ×,Ò,¨W°f¸fÀhÑOÔOˆ
Ý�d”jÑ!Ô!ð 	ð 	ˆAØ× Ò  Ñ#Ô#ð Ø”
×!Ò! !Ñ$Ô$Ð$Ø�øØˆr   c                 ó  — |r+t          |t          ¦  «        rt          j        |¦  «        S |S t          dk    r,|                      d¦  «                             d¦  «        \  }}}|rM|                      |¦  «        }t          dk    r,|                     |¦  «        r|                     |¦  «        sJ ‚nd}t          j	        t          j                             | j        d¦  «        ¦  «        }	|��Ot          dk    rA|                      d¦  «        }
|                      |¦  «        dt          |
¦  «         …         }nu|                      |¦  «        }|                     |¦  «        r|                     |¦  «        sJ ‚|t          |¦  «        t          |¦  «        t          |¦  «        z
  …         }t          j        }t          j        dk    rd}t          dk    r!d|	z   |                     |d|z   f¦  «        z   }nw|t          |¦  «        t          |¦  «        t          |¦  «        z
  …         }|›|	›|›|›d|›|›�}n3|r1t          dk    r	d|	z   |z   }n|›|	›|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).
        )rj   r	   r>   r6   Nú\z\\ú^z.*)Ú
isinstanceÚstrÚreÚcompileÚ_PYTHON_VERSIONÚ_glob_to_reÚ	partitionr.   ÚendswithÚescaper   r   r#   r   rl   r   )r   rb   rQ   r   rs   Ústartr>   Úendrt   r   Úempty_patternÚ	prefix_rer   s                r   rq   zManifest._translate_pattern=  s�  € ð ð 	Ý˜'¥3Ñ'Ô'ð Ý”z 'Ñ*Ô*Ð*à�å˜VÒ#Ð#à ×,Ò,¨SÑ1Ô1×;Ò;¸CÑ@Ô@‰MˆE�1�càð 	Ø×)Ò)¨'Ñ2Ô2ˆJÝ Ò'Ð'Ø!×,Ò,¨UÑ3Ô3ÐP¸
×8KÒ8KÈCÑ8PÔ8PÐPÐPÐPøàˆJåŒy�œŸš d¤i°Ñ4Ô4Ñ5Ô5ˆØÑå &Ò(Ð(Ø $× 0Ò 0°Ñ 4Ô 4�Ø ×,Ò,¨VÑ4Ô4Ð5Iµs¸=Ñ7IÔ7IÐ6IÐ5IÔJ�	�	à ×,Ò,¨VÑ4Ô4�	Ø ×+Ò+¨EÑ2Ô2ÐN°y×7IÒ7IÈ#Ñ7NÔ7NÐNÐNÐNØ%¥c¨%¡j¤jµ#°i±.´.Å3ÀsÁ8Ä8Ñ2KÐ&KÔL�	Ý”&ˆCÝŒv˜Š~ˆ~Ø�Ý &Ò(Ð(Ø  4™Z¨#¯(ª(°IØ48¸:Ñ4Eð4Gñ +Hô +Hñ H�
�
ð (­¨E©
¬
µC¸
±O´OÅcÈ#ÁhÄhÑ4NÐ(NÔO�
Ø27°%¸¸¸y¸yÈ#È#È#Ø2<°*¸c¸cðC�
�
ð ð TÝ" fÒ,Ð,Ø!$ t¡¨jÑ!8�J�Jà.3¨e°T°T¸:ÅcÈ%ÁjÄjÀkÀkÔ;RÐ;RÐ!S�JåŒz˜*Ñ%Ô%Ð%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).
        ry   z\\\\z\1[^%s]z((?<!\\)(\\\\)*)\.)ÚfnmatchÚ	translater   r   r}   Úsub)r   rb   rt   r   Úescapeds        r   r€   zManifest._glob_to_ret  sS   € õ Ô& wÑ/Ô/ˆ
õ ŒfˆÝŒ6�TŠ>ˆ>ð ˆCØ˜sÑ"ˆÝ”VÐ1°7¸JÑGÔGˆ
ØÐr   rF   )F)TNF)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r,   r/   r3   rI   rN   rd   rY   rZ   r\   rq   r€   rA   r   r   r   r   %   s  € € € € € ðð ð	ð 	ð 	ð 	ð#ð #ð #ð6/ð /ð /ðð ð ð@ð @ð @ð @ð,ð ð ð
I.ð I.ð I.ð^-5ð -5ð -5ð^ =AØ"'ð'ð 'ð 'ð 'ðR =AØ"'ðð ð ð ð( ?CØ$)ð5&ð 5&ð 5&ð 5&ðnð ð ð ð r   )r�   r‰   Úloggingr   r}   Úsysr6   r   Úcompatr   Úutilr   Ú__all__Ú	getLoggerr�   r8   r~   ÚMÚ_COLLAPSE_PATTERNÚSÚ_COMMENTED_LINEÚversion_infor   Úobjectr   rA   r   r   ú<module>r�      s  ððð ð
 €€€Ø €€€Ø 	€	€	€	Ø 	€	€	€	Ø 
€
€
€
à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð ð ˆ,€à	ˆÔ	˜8Ñ	$Ô	$€ð �B”J˜z¨2¬4Ñ0Ô0Ð Ø�"”*Ð1°2´4¸"¼$±;Ñ?Ô?€ð Ô" 2 A 2Ô&€ðdð dð dð dð dˆvñ dô dð dð dð dr   