Ë
    nûàgÿ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é   )Úlog)ÚDistutilsInternalErrorÚDistutilsTemplateError)Úconvert_pathc                   óv   — 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      ú\/var/www/skyplay_api_hub/venv/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.append7   s   € Ø�
‰
×Ñ˜$Õr   c                 ó:   — | j                   j                  |«       y r   )r   Úextend)r   Úitemss     r   r"   zFileList.extend:   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 )Nr   r   éÿÿÿÿ)ÚrangeÚlenr   )r   Úis     r   Úremove_duplicateszFileList.remove_duplicatesF   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 r9t        |«      dk  rt        d|› d�«      ‚|dd  D �cg c]  }t        |«      ‘Œ }}nŠ|dv rGt        |«      dk  rt        d|› d	�«      ‚t        |d   «      }|dd  D �cg c]  }t        |«      ‘Œ }}n?|d
v r,t        |«      dk7  rt        d|› d�«      ‚t        |d   «      }nt        d|› d�«      ‚||||fS c c}w c c}w )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 ')r)   r1   r   r   )r   ÚlineÚwordsÚactionÚpatternsr   Údir_patternÚws           r   Ú_parse_template_linezFileList._parse_template_lineN   s9  € Ø—
‘
“ˆØ�q‘ˆà'+Ð+ˆÐ+�3˜àÐOÑOÜ�5‹z˜AŠ~Ü,Ø˜�xÐBÐCóð ð 27°q°r°Ö;¨Aœ Q�Ð;ˆHÑ;ØÐAÑAÜ�5‹z˜AŠ~Ü,Ø˜�xÐHÐIóð ô ˜u Q™xÓ(ˆCØ16°q°r°Ö;¨Aœ Q�Ð;ˆHÑ;ØÐ)Ñ)Ü�5‹z˜QŠÜ,Ø˜�xÐ?Ð@óð ô ' u¨Q¡xÓ0‰Kä(Ð+;¸F¸8À1Ð)EÓFÐFà˜ # {Ð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(  re| j                  dj                  |dj                  |«      «      «       |D ]/  }| j                  ||¬«      rŒd}t	        j
                  |||«       Œ1 y |dk(  rc| j                  dj                  |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|› d�«      ‚) Nr5   zinclude ú T)Úanchorz%warning: no files found matching '%s'r6   zexclude z9warning: no previously-included files found matching '%s'r7   zglobal-include Fz>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 'r:   )	rF   r   r*   Úinclude_patternr   ÚwarningÚexclude_patternÚformatr   )r   r@   rB   rC   r   rD   Úpatternr   s           r   Úprocess_template_linezFileList.process_template_linel   s  € ð 04×/HÑ/HÈÓ/NÑ,ˆ�˜3 ð
 �YÒØ×Ñ˜Z¨#¯(©(°8Ó*<Ñ<Ô=Ø#ò R�Ø×+Ñ+¨G¸DÐ+ÕAÜ—K‘KÐ GÈÕQñRð �yÒ Ø×Ñ˜Z¨#¯(©(°8Ó*<Ñ<Ô=Ø#ò �Ø×+Ñ+¨G¸DÐ+ÕAÜ—K‘KØSØõñð Ð'Ò'Ø×ÑÐ.°·±¸(Ó1CÑCÔDØ#ò �Ø×+Ñ+¨G¸EÐ+ÕBÜ—K‘Kð7ð  õñð Ð'Ò'Ø×ÑÐ.°·±¸(Ó1CÑCÔDØ#ò �Ø×+Ñ+¨G¸EÐ+ÕBÜ—K‘KðBð  õñð Ð*Ò*Ø×ÑÐ6×=Ñ=¸cÀ3Ç8Á8ÈHÓCUÓVÔWØ#ò 3�Ø×+Ñ+¨G¸CÐ+Õ@ØV�CÜ—K‘K  W¨cÕ2ñ3ð
 Ð*Ò*Ø×ÑÐ6×=Ñ=¸cÀ3Ç8Á8ÈHÓCUÓVÔWØ#ò 	�Ø×+Ñ+¨G¸CÐ+Õ@Ü—K‘Kð>ð  Øõñ	ð �wÒØ×Ñ˜X¨Ñ3Ô4Ø×'Ñ'¨°[Ð'ÔAÜ—‘ÐIÈ;ÕWð Bð �wÒØ×Ñ˜X¨Ñ3Ô4Ø×'Ñ'¨°[Ð'ÔAÜ—‘ØMØõð Bô )Ø6°v°h¸aÐ@óð r   c                 óD  — d}t        ||||«      }| j                  d|j                  › d�«       | 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'r:   z adding T)Útranslate_patternr   rO   r   r   Úsearchr   r   )r   rO   rI   rJ   Úis_regexÚfiles_foundÚ
pattern_reÚnames           r   rK   zFileList.include_patternÅ   s¡   € ð4 ˆÜ& w°¸ÀÓIˆ
Ø×ÑÐ=¸j×>PÑ>PÐ=QÐQRÐSÔTð �=‰=Ð Ø�L‰LŒNà—M‘Mò 	#ˆDØ× Ñ  Õ&Ø× Ñ  ¨dÑ!2Ô3Ø—
‘
×!Ñ! $Ô'Ø"‘ð		#ð
 Ðr   c                 óR  — d}t        ||||«      }| j                  d|j                  › d�«       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'r:   r   r/   z
 removing T)rR   r   rO   r0   r1   r   rS   )r   rO   rI   rJ   rT   rU   rV   r2   s           r   rM   zFileList.exclude_patternî   s§   € ð ˆÜ& w°¸ÀÓIˆ
Ø×ÑÐ=¸j×>PÑ>PÐ=QÐQRÐSÔTÜ”s˜4Ÿ:™:“¨Ñ*¨B°Ó3ò 	#ˆAØ× Ñ  §¡¨A¡Õ/Ø× Ñ  °·
±
¸1±Ñ!=Ô>Ø—J‘J˜q�MØ"‘ð		#ð
 Ðr   )NN©TNF)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r'   Úcurdirr   r   r   r"   r-   r3   rF   rP   rK   rM   © r   r   r	   r	      sO   „ ñóò!ð Ÿ)™)ó %òò ò!ò9ò"ò4ò<Uór'ôR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>  s=   è ø€ ò Ù%6 T¨4°ÐQVòØIMŒ�‰�‰�T˜4× ðØ ñùs   ‚57)Ú_UniqueDirsÚfilterr'   Úwalkr(   Úisfile)r(   Ú
all_uniqueÚresultss      r   Ú_find_all_simplern     sE   € ô ×#Ñ#¤B§G¡G¨D¸dÔ$CÓD€JñØ:Dô€Gô ”"—'‘'—.‘. 'Ó*Ð*r   c                   ó&   — e Zd ZdZd„ Zed„ «       Zy)rh   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_itemrd   re   r   rq   Ú	candidateÚfounds           r   Ú__call__z_UniqueDirs.__call__  sW   € ð &Ñˆˆd�EÜ�w‰w�t‹}ˆØ—K‘K §¡Ð,ˆ	Ø˜TÐ!ˆÙØ’Q�Ø�‰�ÔØˆyÐr   c                 ó$   — t         | «       |«      S r   )ri   )Úclsr#   s     r   ri   z_UniqueDirs.filter$  s   € ä‘c“e˜UÓ#Ð#r   N)rZ   r[   r\   r]   rx   Úclassmethodri   r_   r   r   rh   rh     s    „ ñòð ñ$ó ñ$r   rh   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)	rn   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|› d�}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[^ú]z((?<!\\)(\\\\)*)\.)ÚfnmatchÚ	translater'   ÚsepÚreÚsub)rO   rV   rˆ   Úescapeds       r   Ú
glob_to_rerŒ   5  sW   € ô ×"Ñ" 7Ó+€Jô �&‰&€CÜ	‡v�v�‚~ð ˆØ�c�U˜!ˆn€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ˆ   )
rO   rI   rJ   rT   r}   rŽ   ÚendrV   Ú	prefix_rerˆ   s
             r   rR   rR   L  sD  € ñ Ü�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¬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   rY   )r]   r†   r~   r'   r‰   Ú_logr   Úerrorsr   r   Úutilr   r	   rn   Úsetrh   r^   r   rŒ   rR   r_   r   r   ú<module>rœ      sW   ðñó Û Û 	Û 	å ß BÝ ÷lñ lòd+ô$�#ô $ð6 —	‘	ó 	òô.""r   