
    e!h|                     H    d dl Z d dlZd dlmZ ddZd Zedk(  r e        yy)    N)Tempitac                    t        | dd      5 }|j                         }ddd       t        j                        }|j	                         }t        |dd      5 }|j                  |       ddd       y# 1 sw Y   WxY w# 1 sw Y   yxY w)zProcess 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ftemplate_contenttemplatecontents         d/var/www/html/diagnosisapp-backend/venv/lib/python3.12/site-packages/sklearn/_build_utils/tempita.pyprocess_tempitar      s     
hg	. $!668$  01H!!#G	gsW	- 	 $ $ s   A6B6A?Bc                     t        j                         } | j                  dt        d       | j                  ddt        d       | j                  ddt        d	       | j	                         }|j
                  j                  d
      st        d|j
                         |j                  st        d      t        j                  j                  t        j                         |j                        }t        j                  j                  |t        j                  j                  t        j                  j                  |j
                        d         d         }t        |j
                  |       y )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
ValueErroroutdirospathjoingetcwdsplitextsplitr   )parserargs
outdir_absr   s       r   mainr,      s   $$&F
s1IJ
js9WX
0   D;;&1$++?@@;;DEEbiik4;;7JggllBGG$$RWW]]4;;%?%BCAFG DKK)    __main__)N)r   r#   Cythonr   r
   r   r,   __name__ r-   r   <module>r2      s.     	 %"*: zF r-   