U
    aÊ¹j   ã                   @  s\   d Z 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
Z
mZ G dd	„ d	eƒZdS )
z€distutils.command.install_data

Implements the Distutils 'install_data' command, for installing
platform-independent data files.é    )ÚannotationsN)ÚIterableé   )ÚCommand)Úchange_rootÚconvert_pathc                   @  s€   e Zd ZdZdddgZdgZdd„ Zdd	„ Zd
d„ Ze	j
ddœdd„ƒZe e¡e ej¡ddœdd„ƒƒZdd„ Zdd„ ZdS )Úinstall_datazinstall data files)zinstall-dir=ÚdzIbase directory for installing data files [default: installation base dir])zroot=Nz<install everything relative to this alternate root directory)ÚforceÚfz-force installation (overwrite existing files)r
   c                 C  s,   d | _ g | _d | _d| _| jj| _d| _d S )NFT)Úinstall_dirÚoutfilesÚrootr
   ÚdistributionÚ
data_filesÚwarn_dir©Úself© r   úi/var/www/html/bwave/python/venv/lib/python3.8/site-packages/setuptools/_distutils/command/install_data.pyÚinitialize_options"   s    
zinstall_data.initialize_optionsc                 C  s   |   dddd¡ d S )NÚinstall)r   r   )r   r   )r
   r
   )Úset_undefined_optionsr   r   r   r   Úfinalize_options*   s    üzinstall_data.finalize_optionsc                 C  s&   |   | j¡ | jD ]}|  |¡ qd S ©N)Úmkpathr   r   Ú_copy)r   r   r   r   r   Úrun2   s    
zinstall_data.runz5tuple[str | os.PathLike, Iterable[str | os.PathLike]])r   c                 C  s–   t |d ƒ}tj |¡s*tj | j|¡}n| jr<t| j|ƒ}|  |¡ |d g kr`| j	 
|¡ n2|d D ](}t |ƒ}|  ||¡\}}| j	 
|¡ qhd S )Nr   é   )r   ÚosÚpathÚisabsÚjoinr   r   r   r   r   ÚappendÚ	copy_file)r   r   ÚdirÚdataÚoutÚ_r   r   r   r   7   s    
zinstall_data._copyzstr | os.PathLikec                 C  sJ   t |ƒ}| jr(|  d|› d| j› d�¡ |  || j¡\}}| j |¡ d S )Nz.setup script did not provide a directory for 'z' -- installing right in 'ú')r   r   Úwarnr   r$   r   r#   )r   r   r'   r(   r   r   r   r(   M   s    ÿzinstall_data._c                 C  s
   | j pg S r   )r   r   r   r   r   Ú
get_inputsZ   s    zinstall_data.get_inputsc                 C  s   | j S r   )r   r   r   r   r   Úget_outputs]   s    zinstall_data.get_outputsN)Ú__name__Ú
__module__Ú__qualname__ÚdescriptionÚuser_optionsÚboolean_optionsr   r   r   Ú	functoolsÚsingledispatchmethodr   ÚregisterÚstrr   ÚPathLiker(   r+   r,   r   r   r   r   r      s    ø
r   )Ú__doc__Ú
__future__r   r3   r   Útypingr   Úcorer   Úutilr   r   r   r   r   r   r   Ú<module>   s   