Ë
    ��hX7  ã                   ó@  — 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y)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                   ón   — 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y)r   z€
    A list of files built by exploring the filesystem and filtered by applying various
    patterns to what we find there.
    Nc                 ó"  — t         j                  j                  t         j                  j                  |xs t        j                  «       «      «      | _        | j
                  t         j                  z   | _        d| _        t        «       | _
        y)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/skyplay_api_hub/venv/lib/python3.12/site-packages/pip/_vendor/distlib/manifest.pyÚ__init__zManifest.__init__,   sV   € ô —G‘G—O‘O¤B§G¡G×$4Ñ$4°TÒ5H¼R¿Y¹Y»[Ó$IÓJˆŒ	Ø—i‘i¤"§&¡&Ñ(ˆŒØˆŒÜ“Uˆ�
ó    c                 óÆ  — ddl m}m}m} g x| _        }| j
                  }|g}|j                  }|j                  }|r¥ |«       }t        j                  |«      }	|	D ]€  }
t        j                  j                  ||
«      }t        j                   |«      }|j                  } ||«      r|j                  t        |«      «       Œg ||«      sŒp ||«      rŒy ||«       Œ‚ |rŒ¤yy)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.findall;   s½   € ÷ 	3Ñ2à#%Ð%ˆŒ˜Ø�y‰yˆØ�ˆØ�i‰iˆØ�|‰|ˆáÙ“5ˆDÜ—J‘J˜tÓ$ˆEàò 	#�ÜŸ7™7Ÿ<™<¨¨dÓ3�ô —w‘w˜xÓ(�Ø—|‘|�Ù˜4”=Ø—O‘O¤H¨XÓ$6Õ7Ù˜T•]©7°4­=Ù˜•Nð	#ô	 r   c                 óþ   — |j                  | j                  «      s*t        j                  j	                  | j
                  |«      }| j                  j                  t        j                  j                  |«      «       y)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.addV   sK   € ð �‰˜tŸ{™{Ô+Ü—7‘7—<‘< §	¡	¨4Ó0ˆDØ�
‰
�‰”r—w‘w×'Ñ'¨Ó-Õ.r   c                 ó4   — |D ]  }| j                  |«       Œ y)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   Úitemsr/   s      r   Úadd_manyzManifest.add_many`   s   € ð ò 	ˆDØ�H‰H�T�Nñ	r   c                 ó6  ‡ ‡— ˆˆ fd„Št        ‰ j                  «      }|r<t        «       }|D ](  } ‰|t        j                  j	                  |«      «       Œ* ||z  }t        d„ |D «       «      D �cg c]  }t        j                  j                  |Ž ‘Œ  c}S c c}w )z8
        Return sorted files in directory order
        c                 óÖ   •— | j                  |«       t        j                  d|«       |‰j                  k7  r2t        j
                  j                  |«      \  }}|dvsJ ‚ ‰| |«       y y )Nzadd_dir added %s)Ú ú/)r.   ÚloggerÚdebugr   r   r   Úsplit)ÚdirsÚdÚparentÚ_Úadd_dirr   s       €€r   r>   z Manifest.sorted.<locals>.add_dirn   s[   ø€ Ø�H‰H�QŒKÜ�L‰LÐ+¨QÔ/Ø�D—I‘IŠ~ÜŸG™GŸM™M¨!Ó,‘	�˜Ø YÑ.Ð.Ð.Ù˜˜fÕ%ð r   c              3   óZ   K  — | ]#  }t         j                  j                  |«      –— Œ% y ­w©N)r   r   r9   )Ú.0r   s     r   ú	<genexpr>z"Manifest.sorted.<locals>.<genexpr>}   s   è ø€ Ò>¨t”r—w‘w—}‘} T×*Ñ>ùs   ‚)+)r   r   r   r   ÚdirnameÚsortedr"   )r   ÚwantdirsÚresultr:   ÚfÚ
path_tupler>   s   `     @r   rD   zManifest.sortedi   sˆ   ù€ õ
	&ô �T—Z‘Z“ˆÙÜ“5ˆDØò 2�Ù˜œbŸg™gŸo™o¨aÓ0Õ1ð2à�d‰NˆFäÑ>°vÔ>Ó>ö@¨j”—‘—‘˜jÒ)ò @ð 	@ùò @s   Á0#Bc                 ó0   — t        «       | _        g | _        y)zClear all collected files.N)r   r   r   )r   s    r   ÚclearzManifest.clear   s   € ä“UˆŒ
Øˆ�r   c                 ó  — | j                  |«      \  }}}}|dk(  r2|D ],  }| j                  |d¬«      rŒt        j                  d|«       Œ. y|dk(  r|D ]  }| j	                  |d¬«       Œ y|dk(  r2|D ],  }| j                  |d¬«      rŒt        j                  d|«       Œ. y|d	k(  r|D ]  }| j	                  |d¬«       Œ y|d
k(  r3|D ]-  }| j                  ||¬«      rŒt        j                  d||«       Œ/ y|dk(  r|D ]  }| j	                  ||¬«       Œ y|dk(  r+| j                  d|¬«      st        j                  d|«       yy|dk(  r+| j	                  d|¬«      st        j                  d|«       yy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_patternr7   ÚwarningÚ_exclude_patternr   )r   Ú	directiveÚactionÚpatternsÚthedirÚ
dirpatternÚpatterns          r   Úprocess_directivezManifest.process_directive„   sí  € ð 04×/DÑ/DÀYÓ/OÑ,ˆ�˜& *ð
 �YÒØ#ò J�Ø×,Ñ,¨W¸TÐ,ÕBÜ—N‘NÐ#?ÀÕIñJð �yÒ Ø#ò <�Ø×%Ñ% g°dÐ%Õ;ñ<ð Ð'Ò'Ø#ò H�Ø×,Ñ,¨W¸UÐ,ÕCÜ—N‘Nð $>Ø?FõHñHð
 Ð'Ò'Ø#ò =�Ø×%Ñ% g°eÐ%Õ<ñ=ð Ð*Ò*Ø#ò J�Ø×,Ñ,¨W¸VÐ,ÕDÜ—N‘Nð $8Ø9@À&õJñJð
 Ð*Ò*Ø#ò >�Ø×%Ñ% g°fÐ%Õ=ñ>ð �wÒØ×(Ñ(¨°jÐ(ÔAÜ—‘ÐAØ)õ+ð Bð �wÒØ×(Ñ(¨°jÐ(ÔAÜ—‘ð  -Ø.8õ:ð Bô #Ø# fÑ,ó.ð .r   c                 ó,  — |j                  «       }t        |«      dk(  r|d   dvr|j                  dd«       |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 )zŸ
        Validate a directive.
        :param directive: The directive to validate.
        :return: A tuple of action, patterns, thedir, dir_patterns
        r   r   )rL   rN   rO   rP   rQ   rR   rS   rT   rL   N)rL   rN   rO   rP   r   z$%r expects <pattern1> <pattern2> ...)rQ   rR   é   z*%r expects <dir> <pattern1> <pattern2> ...)rS   rT   z!%r expects a single <dir_pattern>zunknown action %r)r9   ÚlenÚinsertr   r   )r   rY   ÚwordsrZ   r[   r\   Údir_patternÚwords           r   rU   zManifest._parse_directiveÈ   sf  € ð —‘Ó!ˆÜˆu‹:˜Š?˜u Q™xð 0Bñ  Bð �L‰L˜˜IÔ&à�q‘ˆØ*.Ð.ˆÐ.�6˜Kàð :ñ :ä�5‹z˜AŠ~Ü&Ø:¸VÑCóEð Eð 8=¸Q¸R°yÖA¨tœ TÕ*ÐAˆHÑAàÐAÑAÜ�5‹z˜AŠ~Ü&Ø@À6ÑIóKð Kô " %¨¡(Ó+ˆFØ7<¸Q¸R°yÖA¨tœ TÕ*ÐAˆHÑAàÐ)Ñ)Ü�5‹z˜QŠÜ&Ø7¸&Ñ@óBð Bô ' u¨Q¡xÓ0‰Kô #Ð#6¸Ñ#?Ó@Ð@à�x ¨Ð4Ð4ùò) Bùò Bs   Á*DÂ4Dc                 óê   — d}| j                  ||||«      }| j                  €| j                  «        | j                  D ]1  }|j                  |«      sŒ| j                  j                  |«       d}Œ3 |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.
        FT)Ú_translate_patternr   r+   Úsearchr   r.   )r   r^   rM   r   Úis_regexÚfoundÚ
pattern_rer(   s           r   rV   zManifest._include_pattern÷   sq   € ð8 ˆØ×,Ñ,¨W°f¸fÀhÓOˆ
ð �=‰=Ð Ø�L‰LŒNà—M‘Mò 	ˆDØ× Ñ  Õ&Ø—
‘
—‘˜tÔ$Ø‘ð	ð ˆr   c                 óÄ   — d}| j                  ||||«      }t        | j                  «      D ]1  }|j                  |«      sŒ| j                  j	                  |«       d}Œ3 |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)rh   Úlistr   ri   Úremove)r   r^   rM   r   rj   rk   rl   rG   s           r   rX   zManifest._exclude_pattern   sc   € ð ˆØ×,Ñ,¨W°f¸fÀhÓOˆ
Ü�d—j‘jÓ!ò 	ˆAØ× Ñ  Õ#Ø—
‘
×!Ñ! !Ô$Ø‘ð	ð ˆr   c                 óJ  — |r't        |t        «      rt        j                  |«      S |S t        dkD  r$| j                  d«      j                  d«      \  }}}|r>| j                  |«      }t        dkD  r&|j                  «      r|j                  «      sJ ‚d}t        j                  t        j                  j                  | j                  d«      «      }	|��t        dk  r0| j                  d«      }
| j                  |«      dt        |
«        }nX| j                  |«      }|j                  «      r|j                  «      sJ ‚|t        |«      t        |«      t        |«      z
   }t        j                  }t        j                  dk(  rd}t        dk  rd|	z   |j                  |d|z   f«      z   }n[|t        «      t        |«      t        «      z
   }|›|	›|›|›d|›|›�}n(|r&t        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).
        )ra   r   r=   r5   Nú\z\\ú^z.*)Ú
isinstanceÚstrÚreÚcompileÚ_PYTHON_VERSIONÚ_glob_to_reÚ	partitionr-   ÚendswithÚescaper   r   r"   r   rb   r   )r   r^   rM   r   rj   Ústartr=   Úendrl   r   Úempty_patternÚ	prefix_rer   s                r   rh   zManifest._translate_pattern4  sþ  € ñ Ü˜'¤3Ô'Ü—z‘z 'Ó*Ð*à�ä˜VÒ#à ×,Ñ,¨SÓ1×;Ñ;¸CÓ@‰MˆE�1�cáØ×)Ñ)¨'Ó2ˆJÜ Ò'Ø!×,Ñ,¨UÔ3¸
×8KÑ8KÈCÔ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°y×7IÑ7IÈ#Ô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                 ó²   — 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).
        rq   z\\\\z\1[^%s]z((?<!\\)(\\\\)*)\.)ÚfnmatchÚ	translater   r   ru   Úsub)r   r^   rl   r   Úescapeds        r   rx   zManifest._glob_to_rek  sT   € ô ×&Ñ& wÓ/ˆ
ô �f‰fˆÜ�6‰6�TŠ>ð ˆCØ˜sÑ"ˆÜ—V‘VÐ1°7¸JÓGˆ
ØÐr   r@   )F)TNF)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r+   r.   r2   rD   rJ   r_   rU   rV   rX   rh   rx   © r   r   r   r   &   sc   „ ñó
	ò#ò6/òó@ò,ò
>.òH-5ð^ =AØ"'ó'ðR =AØ"'óð( ?CØ$)ó5&ónr   )rˆ   r�   Úloggingr   ru   Úsysr5   r   Úcompatr   Úutilr   Ú__all__Ú	getLoggerr…   r7   rv   ÚMÚ_COLLAPSE_PATTERNÚSÚ_COMMENTED_LINEÚversion_inforw   Úobjectr   r‰   r   r   ú<module>r–      s™   ðñó
 Û Û 	Û 	Û 
å Ý Ý ð ˆ,€à	ˆ×	Ñ	˜8Ó	$€ð �B—J‘J˜z¨2¯4©4Ó0Ð Ø�"—*‘*Ð1°2·4±4¸"¿$¹$±;Ó?€ð ×"Ñ" 2 AÐ&€ôZˆvõ Zr   