a
    �ù»j¸  ã                   @   s@   d dl Z d dlZd dlmZ ddd„Zdd„ Zedkr<eƒ  dS )	é    N)ÚTempitac                 C   s„   t | ddd��}| ¡ }W d  ƒ n1 s,0    Y  t |¡}| ¡ }t |ddd��}| |¡ W d  ƒ n1 sv0    Y  dS )z½Process tempita templated file and write out the result.

    The template file is expected to end in `.c.tp` or `.pyx.tp`:
    E.g. processing `template.c.in` generates `template.c`.

    Úrzutf-8)ÚencodingNÚw)ÚopenÚreadÚtempitaÚTemplateÚ
substituteÚwrite)ÚfromfileÚoutfileÚfZtemplate_contentÚtemplateÚcontent© r   úBE:\soccer\ml_env\Lib\site-packages\sklearn/_build_utils/tempita.pyÚprocess_tempita   s    &
r   c                  C   sº   t  ¡ } | jdtdd� | jddtdd� | jddtd	d� |  ¡ }|j d
¡s`td|j› �ƒ‚|jsntdƒ‚t	j
 t	 ¡ |j¡}t	j
 |t	j
 t	j
 |j¡d ¡d ¡}t|j|ƒ d S )NÚinfilezPath to the input file)ÚtypeÚhelpz-oz--outdirzPath to the output directoryz-iz--ignorezKAn ignored input - may be useful to add a dependency between custom targetsz.tpzUnexpected extension: z)Missing `--outdir` argument to tempita.pyé   r   )ÚargparseÚArgumentParserÚadd_argumentÚstrÚ
parse_argsr   ÚendswithÚ
ValueErrorZoutdirÚosÚpathÚjoinÚgetcwdÚsplitextÚsplitr   )ÚparserÚargsZ
outdir_absr   r   r   r   Úmain   s&    û	ÿr'   Ú__main__)N)r   r   ÚCythonr   r   r   r'   Ú__name__r   r   r   r   Ú<module>   s   
