B
    18™\  ã               @   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   ÚdistributionÚ
data_filesÚwarn_dir)Úself© r   úb/oak/stanford/groups/akundaje/marinovg/programs/Python-3.7.3/Lib/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_options)r   r   r   r   Úfinalize_options#   s    zinstall_data.finalize_optionsc             C   s  |   | j¡ xð| jD ]æ}t|tƒrdt|ƒ}| jrD|  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x4|d D ](}t|ƒ}|  ||¡\}}| j	 
|¡ qÎW qW d S )NzMsetup script did not provide a directory for '%s' -- installing right in '%s'r   r	   )Úmkpathr
   r   Ú
isinstanceÚstrr   r   ÚwarnÚ	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 )N)r   )r   r   r   r   Úget_outputsN   s    zinstall_data.get_outputsN)Ú__name__Ú
__module__Ú__qualname__ÚdescriptionÚuser_optionsÚboolean_optionsr   r   r%   r&   r'   r   r   r   r   r      s   !r   )Ú__doc__r   Údistutils.corer   Údistutils.utilr   r   r   r   r   r   r   Ú<module>   s   