U
    ËAš`  ã                   @   s<   d Z ddl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.é    N)ÚCommand)Úchange_rootÚconvert_pathc                   @   sH   e Zd ZdZdddgZdgZdd„ Zdd	„ Z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 )Nr   é   )Úinstall_dirÚoutfilesÚrootr   ZdistributionÚ
data_filesÚwarn_dir©Úself© r   ú4/usr/lib/python3.8/distutils/command/install_data.pyÚinitialize_options   s    
zinstall_data.initialize_optionsc                 C   s   |   dddd¡ d S )NZinstall)r   r
   )r   r   )r   r   )Zset_undefined_optionsr   r   r   r   Úfinalize_options#   s
    ýzinstall_data.finalize_optionsc                 C   sú   |   | j¡ | jD ]â}t|tƒrbt|ƒ}| jrB|  d|| jf ¡ |  || j¡\}}| j	 
|¡ qt|d ƒ}tj |¡sŒtj | j|¡}n| jržt| j|ƒ}|   |¡ |d g krÂ| j	 
|¡ q|d D ](}t|ƒ}|  ||¡\}}| j	 
|¡ qÊqd S )NzMsetup script did not provide a directory for '%s' -- installing right in '%s'r   r	   )Zmkpathr
   r   Ú
isinstanceÚstrr   r   ÚwarnZ	copy_filer   ÚappendÚosÚpathÚisabsÚjoinr   r   )r   r   ÚoutÚ_ÚdirÚdatar   r   r   Úrun*   s,    

þ
zinstall_data.runc                 C   s
   | j pg S ©N)r   r   r   r   r   Ú
get_inputsK   s    zinstall_data.get_inputsc                 C   s   | j S r"   )r   r   r   r   r   Úget_outputsN   s    zinstall_data.get_outputsN)Ú__name__Ú
__module__Ú__qualname__ZdescriptionZuser_optionsZboolean_optionsr   r   r!   r#   r$   r   r   r   r   r      s   ú	!r   )Ú__doc__r   Zdistutils.corer   Zdistutils.utilr   r   r   r   r   r   r   Ú<module>   s   