ó
    Á›‘h  ã                   ó¨   • S 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SK
Jr  SSKJr  SS	KJr  \R                   " S
5      r \r " S S\5      rg)zRdistutils.command.build_scripts

Implements the Distutils 'build_scripts' command.é    N)Úlog)ÚST_MODE)ÚClassVaré   )Únewer)ÚCommand)Úconvert_pathz^#!.*python[0-9.]*([ 	].*)?$c                   ó    • \ rS rSr% Sr/ SQr\\\\	\	\	4         \
S'   S/r\\\	      \
S'   S rS rS	 rS
 rS rS rS rS r\S 5       rSrg)Úbuild_scriptsé   z("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   Úboolean_optionsc                 ó<   • S U l         S U l        S U l        S U l        g ©N)Ú	build_dirÚscriptsr   Ú
executable©Úselfs    ÚoC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\setuptools/_distutils/command/build_scripts.pyÚinitialize_optionsÚ build_scripts.initialize_options$   s   € ØˆŒØˆŒØˆŒ
Øˆ�ó    c                 ób   • U R                  SSSS5        U R                  R                  U l        g )NÚbuild)r   r   )r   r   )r   r   )Úset_undefined_optionsÚdistributionr   r   s    r   Úfinalize_optionsÚbuild_scripts.finalize_options*   s1   € Ø×"Ñ"ØØ*ØØ(ô		
ð ×(Ñ(×0Ñ0ˆ�r   c                 ó   • U R                   $ r   )r   r   s    r   Úget_source_filesÚbuild_scripts.get_source_files3   s   € Ø�|‰|Ðr   c                 óH   • U R                   (       d  g U R                  5         g r   )r   Úcopy_scriptsr   s    r   ÚrunÚbuild_scripts.run6   s   € Ø�|�|ØØ×ÑÕr   c                 ó²   • U R                  U R                  5        / n/ nU R                   H  nU R                  X1U5        M     U R	                  U5        X4$ )a  
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(   Úbuild_scripts.copy_scripts;   sU   € ð 	�‰�D—N‘NÔ#ØˆØˆØ—l”lˆFØ×Ñ˜f°Ö>ñ #ð 	×Ñ˜8Ô$àÐ&Ð&r   c                 ó¢  • S n[        U5      n[        R                  R                  U R                  [        R                  R                  U5      5      nUR                  U5        U R                  (       d(  [        X5      (       d  [        R                  " SU5        g  [        R                  " U5      nUR                  5       nU(       d  U R                  U S35        g [        R!                  U5      nUR                  U5        U(       aã  [        R&                  " SXR                  5        U R$                  (       d˜  UR)                  S5      =(       d    SnSU R*                  -   U-   S-   n	U R-                  X–R.                  5        [        USUR.                  S	9 n
U
R1                  U	5        U
R3                  UR5                  5       5        S S S 5        U(       a  UR7                  5         g g U(       a  UR7                  5         U R9                  X5        g ! ["         a    U R$                  (       d  e S n GNEf = f! , (       d  f       Nu= f)
Nznot copying %s (up-to-date)z is an empty file (skipping)zcopying and adjusting %s -> %sé   Ú z#!Ú
Úw)Úencoding)r	   ÚosÚpathÚjoinr   ÚbasenameÚappendr   r   r   ÚdebugÚtokenizeÚopenÚreadlineÚwarnÚshebang_patternÚmatchÚOSErrorÚdry_runÚinfoÚgroupr   Ú_validate_shebangr8   ÚwriteÚ
writelinesÚ	readlinesÚcloseÚ	copy_file)r   r1   r/   r0   Úshebang_matchÚoutfiler   Ú
first_lineÚpost_interpÚshebangÚoutfs              r   r-   Úbuild_scripts._copy_scriptN   s¦  € ØˆÜ˜fÓ%ˆÜ—'‘'—,‘,˜tŸ~™~¬r¯w©w×/?Ñ/?ÀÓ/GÓHˆØ�‰˜Ô à�z�z¤%¨×"8Ñ"8Ü�IŠIÐ3°VÔ<Øð	>Ü—’˜fÓ%ˆAð Ÿ™›ˆJÞØ—	‘	˜V˜HÐ$@ÐAÔBØä+×1Ñ1°*Ó=ˆMà×Ñ˜WÔ%ÞÜ�HŠHÐ5°v¿~¹~ÔNØ—<—<Ø+×1Ñ1°!Ó4×:¸�Ø §¡Ñ0°;Ñ>ÀÑE�Ø×&Ñ& w·
±
Ô;Ü˜' 3°·±Ò<ÀØ—J‘J˜wÔ'Ø—O‘O A§K¡K£MÔ2÷ =ö Ø—‘•	ð ö Ø—‘”	Ø�N‰N˜6Õ+øô7 ó 	Ø—<—<ØØ‹Að	ú÷& =Õ<ús   Â H Æ 1I ÈH=È<H=É 
Ic                 ób   • [         R                  S:w  a  g U H  nU R                  U5        M     g )NÚposix)r9   ÚnameÚ_change_mode)r   r/   Úfiles      r   r.   Úbuild_scripts._change_modesy   s)   € Ü�7‰7�gÓØãˆDØ×Ñ˜dÖ#ò r   c                 ó  • U R                   (       a  [        R                  " SU5        g [        R                  " U5      [
           S-  nUS-  S-  nX2:w  a/  [        R                  " SXU5        [        R                  " X5        g g )Nzchanging mode of %siÿ  im  z!changing mode of %s from %o to %o)rF   r   rG   r9   Ústatr   Úchmod)r   rZ   ÚoldmodeÚnewmodes       r   rY   Úbuild_scripts._change_mode€   sh   € Ø�<�<Ü�HŠHÐ*¨DÔ1Øä—'’'˜$“-¤Ñ(¨6Ñ1ˆØ˜U‘? fÑ,ˆØÓÜ�HŠHÐ8¸$ÈÔQÜ�HŠH�TÕ#ð r   c                 óÊ   •  U R                  S5         U R                  U5        g ! [         a    [        SU < S35      ef = f! [         a    [        SU < SU S35      ef = f)Nzutf-8zThe shebang (z) is not encodable to utf-8z+) is not encodable to the script encoding (Ú))ÚencodeÚUnicodeEncodeErrorÚ
ValueError)rS   r8   s     r   rI   Ú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ÁA")r   r   r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Údescriptionr   r   ÚlistÚtupleÚstrÚ__annotations__r   r   r"   r%   r)   r(   r-   r.   rY   ÚstaticmethodrI   Ú__static_attributes__© r   r   r   r      s~   ‡ Ø>€Kò:€L�(˜4  c¨3° mÑ 4Ñ5Ñ6ó ð -4¨9€O�X˜d 3™iÑ(Ó4òò1òòò
'ò&),òV$ò	$ð ñó ór   r   )Ú__doc__r9   Úrer?   Údistutils._logr   r]   r   Útypingr   Ú	_modifiedr   Úcorer   Úutilr	   ÚcompilerC   Úfirst_line_rer   rs   r   r   Ú<module>r}      sP   ðñ5ó 
Û 	Û Ý Ý Ý å Ý Ý à—*’*Ð<Ó=€ðð
  €ôG�Gõ Gr   