a
    ˜¥»ab  ã                   @   s>   d dl Z d dlZd dlmZ dd„ Zedkr:ee jd ƒ dS )é    N)ÚTempitac                 C   s~   |   d¡std|  ƒ‚tjj}|| t ¡ d�}| ¡ }tj	 
| ¡d }t|dƒ�}| |¡ W d  ƒ n1 sp0    Y  dS )z½Process tempita templated file and write out the result.

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

    z.inzUnexpected extension: %s)Úencodingr   ÚwN)ÚendswithÚ
ValueErrorÚtempitaÚTemplateÚfrom_filenameÚsysÚgetdefaultencodingÚ
substituteÚosÚpathÚsplitextÚopenÚwrite)Úfromfiler	   ÚtemplateÚcontentÚoutfileÚf© r   úT/home/yuhw/wc/pochoir/venv/lib/python3.9/site-packages/scipy/_build_utils/tempita.pyÚprocess_tempita	   s    
ÿr   Ú__main__é   )r
   r   ZCythonr   r   r   Ú__name__Úargvr   r   r   r   Ú<module>   s
   