§
    WŠtjá  ã                   ó¬   — 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  ej        d
¦  «        Z	 eZ G d„ de¦  «        ZdS )zRdistutils.command.build_scripts

Implements the Distutils 'build_scripts' command.é    N)Ú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
eee                  e	d<   d„ Zd„ Zd„ Zd	„ Zd
„ Zd„ Zd„ Zd„ Zed„ ¦   «         ZdS )Ú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   Úboolean_optionsc                 ó>   — d | _         d | _        d | _        d | _        d S ©N)Ú	build_dirÚscriptsr   Ú
executable©Úselfs    úi/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/setuptools/_distutils/command/build_scripts.pyÚinitialize_optionsz build_scripts.initialize_options$   s"   € ØˆŒØˆŒØˆŒ
ØˆŒˆˆó    c                 óX   — |                       dddd¦  «         | j        j        | _        d S )NÚbuild)r   r   )r   r   )r   r   )Úset_undefined_optionsÚdistributionr   r   s    r   Úfinalize_optionszbuild_scripts.finalize_options*   s9   € Ø×"Ò"ØØ*ØØ(ñ		
ô 	
ð 	
ð Ô(Ô0ˆŒˆˆr   c                 ó   — | j         S r   )r   r   s    r   Úget_source_fileszbuild_scripts.get_source_files3   s
   € ØŒ|Ðr   c                 ó@   — | j         sd S |                      ¦   «          d S r   )r   Úcopy_scriptsr   s    r   Úrunzbuild_scripts.run6   s)   € ØŒ|ð 	ØˆFØ×ÒÑÔÐÐÐr   c                 ó²   — |                       | j        ¦  «         g }g }| j        D ]}|                      |||¦  «         Œ|                      |¦  «         ||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;   sm   € ð 	�Š�D”NÑ#Ô#Ð#ØˆØˆØ”lð 	?ð 	?ˆFØ×Ò˜f h°Ñ>Ô>Ð>Ð>à×Ò˜8Ñ$Ô$Ð$à˜Ð&Ð&r   c                 ó8  — d }t          |¦  «        }t          j                             | j        t          j                             |¦  «        ¦  «        }|                     |¦  «         | j        s't          ||¦  «        st          j
        d|¦  «         d S t          j        |¦  «        }|                     ¦   «         }|s|                      |› d�¦  «         d S t                               |¦  «        }|                     |¦  «         |rât          j        d|| j        ¦  «         |                     d¦  «        pd}d| j        z   |z   dz   }	|                      |	|j        ¦  «         t          |d|j        ¬	¦  «        5 }
|
                     |	¦  «         |
                     |                     ¦   «         ¦  «         d d d ¦  «         n# 1 swxY w Y   |r|                     ¦   «          d S d S |r|                     ¦   «          |                      ||¦  «         d S )
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_shebangr2   ÚwriteÚ
writelinesÚ	readlinesÚcloseÚ	copy_file)r   r,   r*   r+   Úshebang_matchÚoutfiler   Ú
first_lineÚpost_interpÚshebangÚoutfs              r   r(   zbuild_scripts._copy_scriptN   s=  € ØˆÝ˜fÑ%Ô%ˆÝ”'—,’,˜tœ~­r¬w×/?Ò/?ÀÑ/GÔ/GÑHÔHˆØ�Š˜Ñ Ô Ð àŒzð 	¥%¨°Ñ"8Ô"8ð 	ÝŒIÐ3°VÑ<Ô<Ð<ØˆFõ ŒM˜&Ñ!Ô!ˆà—Z’Z‘\”\ˆ
Øð 	Ø�IŠI˜Ð=Ð=Ð=Ñ>Ô>Ð>ØˆFå'×-Ò-¨jÑ9Ô9ˆà×Ò˜WÑ%Ô%Ð%Øð 	,ÝŒHÐ5°v¸t¼~ÑNÔNÐNØ'×-Ò-¨aÑ0Ô0Ð6°BˆKØ˜Tœ_Ñ,¨{Ñ:¸TÑAˆGØ×"Ò" 7¨A¬JÑ7Ô7Ð7Ý�g˜s¨Q¬ZÐ8Ñ8Ô8ð /¸DØ—
’
˜7Ñ#Ô#Ð#Ø—’ §¢¡¤Ñ.Ô.Ð.ð/ð /ð /ñ /ô /ð /ð /ð /ð /ð /ð /øøøð /ð /ð /ð /ð ð Ø—’‘	”	�	�	�	ðð ð ð Ø—’‘	”	�	Ø�NŠN˜6 7Ñ+Ô+Ð+Ð+Ð+s   Æ =G	Ç	GÇGc                 ó^   — t           j        dk    rd S |D ]}|                      |¦  «         Œd S )NÚposix)r3   ÚnameÚ_change_mode)r   r*   Úfiles      r   r)   zbuild_scripts._change_modess   sD   € ÝŒ7�gÒÐØˆFàð 	$ð 	$ˆDØ×Ò˜dÑ#Ô#Ð#Ð#ð	$ð 	$r   c                 óÂ   — t          j        |¦  «        t                   dz  }|dz  dz  }||k    r.t          j        d|||¦  «         t          j        ||¦  «         d S d S )Niÿ  im  z!changing mode of %s from %o to %o)r3   Ústatr   r   r?   Úchmod)r   rQ   ÚoldmodeÚnewmodes       r   rP   zbuild_scripts._change_modez   si   € Ý”'˜$‘-”-¥Ô(¨6Ñ1ˆØ˜U‘? fÑ,ˆØ�gÒÐÝŒHÐ8¸$ÀÈÑQÔQÐQÝŒH�T˜7Ñ#Ô#Ð#Ð#Ð#ð Ðr   c                 óê   — 	 |                       d¦  «         n!# t          $ r t          d| ›d�¦  «        ‚w xY w	 |                       |¦  «         d S # 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)rK   r2   s     r   rA   zbuild_scripts._validate_shebang�   sÃ   € ð	UØ�NŠN˜7Ñ#Ô#Ð#Ð#øÝ!ð 	Uð 	Uð 	UÝÐS¨WÐSÐSÐSÑTÔTÐTð	Uøøøð	Ø�NŠN˜8Ñ$Ô$Ð$Ð$Ð$øÝ!ð 	ð 	ð 	Ýð7 ð 7ð 7Ø+3ð7ð 7ð 7ñô ð ð	øøøs   ‚ ˜6ºA Á!A2N)Ú__name__Ú
__module__Ú__qualname__Údescriptionr   r   ÚlistÚtupleÚstrÚ__annotations__r   r   r    r"   r%   r$   r(   r)   rP   ÚstaticmethodrA   © r   r   r   r      s  € € € € € € Ø>€Kð:ð :ð :€L�(˜4  c¨3° mÔ 4Ô5Ô6ð ð ñ ð -4¨9€O�X˜d 3œiÔ(Ð4Ð4Ñ4ðð ð ð1ð 1ð 1ðð ð ðð ð ð
'ð 'ð 'ð&#,ð #,ð #,ðJ$ð $ð $ð$ð $ð $ð ðð ñ „\ðð ð r   r   )Ú__doc__r3   Úrer9   Údistutils._logr   rS   r   Útypingr   Ú	_modifiedr   Úcorer   Úutilr	   Úcompiler=   Úfirst_line_rer   re   r   r   ú<module>ro      sô   ðð5ð 5ð 
€	€	€	Ø 	€	€	€	Ø €€€Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à�"”*Ð<Ñ=Ô=€ðð
  €ð}ð }ð }ð }ð }�Gñ }ô }ð }ð }ð }r   