o
    5‘ðiä  ã                   @   sX   d dl Z d dlmZmZ d dlmZ ddlmZ d dlm	Z	m
Z
 G dd„ dejeƒZdS )	é    N)ÚCommandÚ
namespaces)Úunpack_archiveé   )Úensure_directory)Údir_utilÚlogc                   @   sH   e Zd ZdZdZdgZdd„ Zddd„Zdd	d
„Zdd„ Z	ddd„Z
dS )Úinstall_egg_infoz.Install an .egg-info directory for the package)zinstall-dir=Údzdirectory to install toc                 C   s
   d | _ d S ©N)Úinstall_dir©Úself© r   úb/root/parts/websockify/install/lib/python3.10/site-packages/setuptools/command/install_egg_info.pyÚinitialize_options   s   
z#install_egg_info.initialize_optionsÚreturnNc                 C   sH   |   dd¡ |  d¡}| ¡ › d�}|j| _tj | j|¡| _	g | _
d S )NÚinstall_lib)r   r   Úegg_infoz	.egg-info)Úset_undefined_optionsÚget_finalized_commandÚ_get_egg_basenamer   ÚsourceÚosÚpathÚjoinr   ÚtargetÚoutputs)r   Úei_cmdÚbasenamer   r   r   Úfinalize_options   s   

z!install_egg_info.finalize_optionsc                 C   s’   |   d¡ tj | j¡rtj | j¡st | j¡ ntj | j¡r.|  	tj
| jfd| j ¡ t| jƒ |  	| jdd| j› d| j› �¡ |  ¡  d S )Nr   z	Removing r   zCopying z to )Úrun_commandr   r   Úisdirr   Úislinkr   Úremove_treeÚexistsÚexecuteÚunlinkr   Úcopytreer   Úinstall_namespacesr   r   r   r   Úrun   s   

 zinstall_egg_info.runc                 C   s   | j S r   )r   r   r   r   r   Úget_outputs)   s   zinstall_egg_info.get_outputsc                    s    ‡ fdd„}t ˆ jˆ j|ƒ d S )Nc                    sD   dD ]}|   |¡sd| | v r d S qˆ j |¡ t d| |¡ |S )N)z.svn/zCVS/ú/zCopying %s to %s)Ú
startswithr   Úappendr   Údebug)ÚsrcÚdstÚskipr   r   r   Úskimmer.   s   ÿz*install_egg_info.copytree.<locals>.skimmer)r   r   r   )r   r3   r   r   r   r(   ,   s   zinstall_egg_info.copytree)r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚdescriptionÚuser_optionsr   r    r*   r+   r(   r   r   r   r   r	      s    ÿ


r	   )r   Ú
setuptoolsr   r   Úsetuptools.archive_utilr   Ú_pathr   Ú	distutilsr   r   Ú	Installerr	   r   r   r   r   Ú<module>   s    