o
    ¹E¨e7	  ã                   @   sP   d dl mZ d dlm  mZ d dlZd dlZddlm	Z	 G dd„ dejƒZdS )é    )ÚlogNé   )Úensure_directoryc                   @   s2   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	d
„ZdS )Úinstall_scriptsz;Do normal script install, plus any egg_info wrapper scriptsc                 C   s   t j | ¡ d| _d S )NF)Úorigr   Úinitialize_optionsÚno_ep©Úself© r   úc/var/www/bmteknikk.ddns.net/venv/lib/python3.10/site-packages/setuptools/command/install_scripts.pyr      s   
z"install_scripts.initialize_optionsc                 C   s<   |   d¡ | jjrtj | ¡ ng | _| jrd S |  ¡  d S )NÚegg_info)	Úrun_commandÚdistributionÚ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   )ÚDistributionÚ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	 
|¡ |ƒ }| jsAt|ƒ t|d| ƒ}	|	 |¡ |	 ¡  ||d| ƒ dS dS )z1Write an executable file to the scripts directoryr   )ÚchmodÚcurrent_umaskzInstalling %s script to %sÚwiÿ  N)Úsetuptools.command.easy_installr2   r3   r   ÚinfoÚinstall_dirÚosÚpathÚjoinr   ÚappendÚdry_runr   ÚopenÚwriteÚclose)
r
   Úscript_nameÚcontentsÚmodeÚignoredr2   r3   ÚtargetÚmaskÚfr   r   r   r(   4   s   
ûzinstall_scripts.write_scriptN)r1   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r(   r   r   r   r   r   	   s    r   )
Ú	distutilsr   Ú!distutils.command.install_scriptsÚcommandr   r   r8   r"   Ú_pathr   r   r   r   r   Ú<module>   s    