o
    g6
                     @  sh   d dl mZ d dlZd dlZddlmZ ddlmZ d dlm	  m
Z d dlmZ G dd dej
Z
dS )	    )annotationsN   )ensure_directory)Distribution)logc                   @  s>   e Zd ZU dZded< dd Zddd	Zd
d ZdddZdS )install_scriptsz;Do normal script install, plus any egg_info wrapper scriptsr   distributionc                 C  s   t j|  d| _d S )NF)origr   initialize_optionsno_epself r   _/var/www/rescue_company/venv/lib/python3.10/site-packages/setuptools/command/install_scripts.pyr
      s   
z"install_scripts.initialize_optionsreturnNonec                 C  s<   |  d | jjrtj|  ng | _| jrd S |   d S )Negg_info)	run_commandr   scriptsr	   r   runoutfilesr   _install_ep_scriptsr   r   r   r   r      s   
zinstall_scripts.runc                 C  s   ddl m}m} ddlm} | d}||j||j|j|j|j	}| d}t
|dd }|j}|tjkr8|g}| }|j |}	|||	 D ]}
| j|
  qLd S )Nr   )r   PathMetadata   )easy_installr   build_scripts
executable)pkg_resourcesr   r    r   get_finalized_commandegg_baser   egg_nameegg_versiongetattrScriptWritersysr   bestcommand_spec_class
from_paramget_args	as_headerwrite_script)r   r   r   eiei_cmddistbs_cmd
exec_paramwritercmdargsr   r   r   r   !   s&   


z#install_scripts._install_ep_scriptstc                 G  s   ddl m}m} td|| j tj| j|}| j	
| d|v r$dnd}| }	| jsWt| t|d| |d}
|
| W d   n1 sIw   Y  ||d	|	  dS dS )
z1Write an executable file to the scripts directoryr   )chmodcurrent_umaskzInstalling %s script to %sbNzutf-8w)encodingi  )setuptools.command.easy_installr5   r6   r   infoinstall_dirospathjoinr   appenddry_runr   openwrite)r   script_namecontentsmodeignoredr5   r6   targetr9   maskfr   r   r   r+   ;   s   zinstall_scripts.write_scriptN)r   r   )r4   )	__name__
__module____qualname____doc____annotations__r
   r   r   r+   r   r   r   r   r      s   
 
r   )
__future__r   r=   r%   _pathr   r.   r   !distutils.command.install_scriptscommandr   r	   	distutilsr   r   r   r   r   <module>   s    