ó
    µ'Ôiá  ã                   ó¨   • 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    Új/var/www/surfInsights/venv3-11/lib/python3.13/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                 ó4  • 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%                  S5      =(       d    SnSU R&                  -   U-   S-   n	U R)                  X–R*                  5        [        USUR*                  S	9 n
U
R-                  U	5        U
R/                  UR1                  5       5        S S S 5        U(       a  UR3                  5         g g U(       a  UR3                  5         U R5                  X5        g ! , (       d  f       NP= 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Ú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   sz  € ØˆÜ˜fÓ%ˆÜ—'‘'—,‘,˜tŸ~™~¬r¯w©w×/?Ñ/?ÀÓ/GÓHˆØ�‰˜Ô à�z�z¤%¨×"8Ñ"8Ü�IŠIÐ3°VÔ<Øô �MŠM˜&Ó!ˆà—Z‘Z“\ˆ
ÞØ�I‰I˜˜Ð <Ð=Ô>Øä'×-Ñ-¨jÓ9ˆà×Ñ˜WÔ%ÞÜ�HŠHÐ5°v¿~¹~ÔNØ'×-Ñ-¨aÓ0×6°BˆKØ˜TŸ_™_Ñ,¨{Ñ:¸TÑAˆGØ×"Ñ" 7¯J©JÔ7Ü�g˜s¨Q¯Z©ZÒ8¸DØ—
‘
˜7Ô#Ø—‘ §¡£Ô.÷ 9ö Ø—‘•	ð ö Ø—‘”	Ø�N‰N˜6Õ+÷ 9Õ8ús   Æ1H	È	
H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_modess   s)   € Ü�7‰7�gÓØãˆDØ×Ñ˜dÖ#ò r   c                 ó¼   • [         R                  " U5      [           S-  nUS-  S-  nX2:w  a/  [        R                  " SXU5        [         R
                  " X5        g g )Niÿ  im  z!changing mode of %s from %o to %o)r9   Ústatr   r   rE   Úchmod)r   rX   ÚoldmodeÚnewmodes       r   rW   Úbuild_scripts._change_modez   sO   € Ü—'’'˜$“-¤Ñ(¨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)rQ   r8   s     r   rG   Ú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.   rW   ÚstaticmethodrG   Ú__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òòò
'ò&#,òJ$ò$ð ñó ór   r   )Ú__doc__r9   Úrer?   Údistutils._logr   r[   r   Útypingr   Ú	_modifiedr   Úcorer   Úutilr	   ÚcompilerC   Úfirst_line_rer   rq   r   r   Ú<module>r{      sP   ðñ5ó 
Û 	Û Ý Ý Ý å Ý Ý à—*’*Ð<Ó=€ðð
  €ô}�Gõ }r   