Ë
    nûàgà  ã                   ó´   — d 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dl
mZ ddlmZ dd	lmZ dd
lmZ  ej$                  d«      Z	 eZ G d„ de«      Zy)zRdistutils.command.build_scripts

Implements the Distutils 'build_scripts' command.é    N)Ú	sysconfig)Úlog)ÚST_MODE)ÚClassVaré   )Únewer)ÚCommand)Úconvert_pathz^#!.*python[0-9.]*([ 	].*)?$c                   ó‚   — e Zd ZU dZg d¢Zeeeeeef         e	d<   dgZ
d„ Zd„ Zd„ Zd„ Zd	„ Zd
„ Zd„ Zd„ Zed„ «       Zy)Úbuild_scriptsz("build" scripts (copy and fixup #! line)))z
build-dir=Údzdirectory to "build" (copy) to)ÚforceÚfz1forcibly build everything (ignore file timestamps)zexecutable=Úez*specify final destination interpreter pathÚuser_optionsr   c                 ó<   — d | _         d | _        d | _        d | _        y ©N)Ú	build_dirÚscriptsr   Ú
executable©Úselfs    úi/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/setuptools/_distutils/command/build_scripts.pyÚinitialize_optionsz build_scripts.initialize_options%   s   € ØˆŒØˆŒØˆŒ
Øˆ�ó    c                 ób   — | j                  dddd«       | j                  j                  | _        y )NÚbuild)r   r   )r   r   )r   r   )Úset_undefined_optionsÚdistributionr   r   s    r   Úfinalize_optionszbuild_scripts.finalize_options+   s1   € Ø×"Ñ"ØØ*ØØ(ô		
ð ×(Ñ(×0Ñ0ˆ�r   c                 ó   — | j                   S r   )r   r   s    r   Úget_source_fileszbuild_scripts.get_source_files4   s   € Ø�|‰|Ðr   c                 ó>   — | j                   sy | j                  «        y r   )r   Úcopy_scriptsr   s    r   Úrunzbuild_scripts.run7   s   € Ø�|Š|ØØ×ÑÕr   c                 ó²   — | j                  | j                  «       g }g }| j                  D ]  }| j                  |||«       Œ | j	                  |«       ||fS )a2  
        Copy each script listed in ``self.scripts``.

        If a script is marked as a Python script (first line matches
        'shebang_pattern', i.e. starts with ``#!`` and contains
        "python"), then adjust in the copy the first line to refer to
        the current Python interpreter.
        )Úmkpathr   r   Ú_copy_scriptÚ_change_modes)r   ÚoutfilesÚupdated_filesÚscripts       r   r$   zbuild_scripts.copy_scripts<   s^   € ð 	�‰�D—N‘NÔ#ØˆØˆØ—l‘lò 	?ˆFØ×Ñ˜f h°Õ>ð	?ð 	×Ñ˜8Ô$à˜Ð&Ð&r   c           	      ó@  — d }t        |«      }t        j                  j                  | j                  t        j                  j                  |«      «      }|j                  |«       | j                  s#t        ||«      st        j                  d|«       y 	 t        j                  |«      }|j                  «       }|s| j                  |› d�«       y t        j!                  |«      }|j                  |«       |�rUt        j&                  d|| j                  «       | j$                  �st(        j*                  s| j,                  }nit        j                  j                  t)        j.                  d«      dj1                  t)        j.                  d«      t)        j.                  d«      «      «      }|j3                  d«      xs d	}	d
|z   |	z   dz   }
| j5                  |
|j6                  «       t        |d|j6                  ¬«      5 }|j9                  |
«       |j;                  |j=                  «       «       d d d «       |r|j?                  «        y y |r|j?                  «        | jA                  ||«       y # t"        $ r | j$                  s‚ d }Y �Œ©w xY w# 1 sw Y   ŒaxY w)Nznot copying %s (up-to-date)z is an empty file (skipping)zcopying and adjusting %s -> %sÚBINDIRz
python{}{}ÚVERSIONÚEXEé   Ú z#!ú
Úw)Úencoding)!r
   ÚosÚpathÚjoinr   ÚbasenameÚappendr   r   r   ÚdebugÚtokenizeÚopenÚreadlineÚwarnÚshebang_patternÚmatchÚOSErrorÚdry_runÚinfor   Úpython_buildr   Úget_config_varÚformatÚgroupÚ_validate_shebangr5   ÚwriteÚ
writelinesÚ	readlinesÚcloseÚ	copy_file)r   r,   r*   r+   Úshebang_matchÚoutfiler   Ú
first_liner   Úpost_interpÚshebangÚoutfs               r   r(   zbuild_scripts._copy_scriptO   s  € ØˆÜ˜fÓ%ˆÜ—'‘'—,‘,˜tŸ~™~¬r¯w©w×/?Ñ/?ÀÓ/GÓHˆØ�‰˜Ô à�zŠz¤%¨°Ô"8Ü�I‰IÐ3°VÔ<Øð	>Ü—‘˜fÓ%ˆAð Ÿ™›ˆJÙØ—	‘	˜V˜HÐ$@ÐAÔBØä+×1Ñ1°*Ó=ˆMà×Ñ˜WÔ%ÚÜ�H‰HÐ5°v¸t¿~¹~ÔNØ—<“<Ü ×-Ò-Ø!%§¡‘Jä!#§¡§¡Ü!×0Ñ0°Ó:Ø$×+Ñ+Ü%×4Ñ4°YÓ?Ü%×4Ñ4°UÓ;óó"�Jð ,×1Ñ1°!Ó4Ò:¸�Ø Ñ+¨kÑ9¸DÑ@�Ø×&Ñ& w°·
±
Ô;Ü˜' 3°·±Ô<ð 3ÀØ—J‘J˜wÔ'Ø—O‘O A§K¡K£MÔ2÷3ñ Ø—‘•	ð ñ Ø—‘”	Ø�N‰N˜6 7Õ+øôK ò 	Ø—<’<ØØ‹Að	ú÷:3ð 3ús   ÂI5 È1JÉ5JÊJÊJc                 ó\   — t         j                  dk7  ry |D ]  }| j                  |«       Œ y )NÚposix)r6   ÚnameÚ_change_mode)r   r*   Úfiles      r   r)   zbuild_scripts._change_modes„   s.   € Ü�7‰7�gÒØàò 	$ˆDØ×Ñ˜dÕ#ñ	$r   c                 ó   — | j                   rt        j                  d|«       y t        j                  |«      t
           dz  }|dz  dz  }||k7  r/t        j                  d|||«       t        j                  ||«       y y )Nzchanging mode of %siÿ  im  z!changing mode of %s from %o to %o)rC   r   rD   r6   Ústatr   Úchmod)r   rY   ÚoldmodeÚnewmodes       r   rX   zbuild_scripts._change_mode‹   sn   € Ø�<Š<Ü�H‰HÐ*¨DÔ1Øä—'‘'˜$“-¤Ñ(¨6Ñ1ˆØ˜U‘? fÑ,ˆØ�gÒÜ�H‰HÐ8¸$ÀÈÔQÜ�H‰H�T˜7Õ#ð r   c                 óÂ   — 	 | j                  d«       	 | j                  |«       y # t        $ r t        d| ›d�«      ‚w xY w# t        $ r t        d| ›d|› d�«      ‚w xY w)Nzutf-8zThe shebang (z) is not encodable to utf-8z+) is not encodable to the script encoding (ú))ÚencodeÚUnicodeEncodeErrorÚ
ValueError)rS   r5   s     r   rI   zbuild_scripts._validate_shebang–   s‚   € ð	UØ�N‰N˜7Ô#ð	Ø�N‰N˜8Õ$øô "ò 	UÜ˜}¨W¨KÐ7RÐSÓTÐTð	Uûô "ò 	ÜØ ˜{ð ++Ø+3¨*°Að7óð ð	ús   ‚& ”A ¦?ÁAN)Ú__name__Ú
__module__Ú__qualname__Údescriptionr   r   ÚlistÚtupleÚstrÚ__annotations__Úboolean_optionsr   r    r"   r%   r$   r(   r)   rX   ÚstaticmethodrI   © r   r   r   r      sp   … Ø>€Kò:€L�(˜4  c¨3° mÑ 4Ñ5Ñ6ó ð �i€Oòò1òòò
'ò&3,òj$ò	$ð ñó ñr   r   )Ú__doc__r6   Úrer<   Ú	distutilsr   Údistutils._logr   r[   r   Útypingr   Ú	_modifiedr   Úcorer	   Úutilr
   Úcompiler@   Úfirst_line_rer   rn   r   r   ú<module>ry      sU   ðñ5ó 
Û 	Û Ý Ý Ý Ý å Ý Ý à�"—*‘*Ð<Ó=€ðð
  €ôQ�Gõ Qr   