
    @'h                         d dl Z d dlZd dlmZ d dlmZmZmZmZ d dl	m
Z
 defdZdefdZdefd	Z	 dd
edede
e   fdZy)    N)Path)pyproject_str
readme_strinit_strinit_with_prefix_str)Optionaldirc                 <    t        | dz         j                          y )N/__init__.pyr   touch)r	   s    g/home/kushmeetdev/Regenta/Chatbot/venv/lib/python3.12/site-packages/llama_index/cli/new_package/base.py_create_init_filer      s    ~	$$&    filenamec                 6    t        |       j                          y Nr   )r   s    r   _create_test_filer      s    Nr   c                 \    	 t        j                  |        y # t        $ r
}Y d }~y d }~ww xY wr   )osmakedirsFileExistsError)r	   es     r   	_makedirsr      s&    
C s    	++integration_typeintegration_nameprefixc           	         |6d|  d| j                  dd      j                  dd      j                         n8d| d|  d| j                  dd      j                  dd      j                         }t        j                  j	                  t        j
                         |      }t        j                  j	                  |d      }t        j                  j	                  |d      }t        j                  j	                  ||&d|  d| j                  dd      j                         n(d| d|  d| j                  dd      j                               }t        |       t        |       t        |       t        |       t        |       t        |d	z   d
      5 }|St        j                  | j                  dd      j                         |j                  dd      j                               nqt        j                  | j                  dd      j                         |j                  dd      j                         |j                  dd      j                               }	|j                  |	       d d d        t        |dz   d
      5 }|j                  t        j                  || j                         |j                                      d d d        t        |dz   d
      5 }|j                  t        j                  || j                         j                         |j                         j                                      d d d        ||'d|  d| dj                  dd      j                         n)d| d|  d| dj                  dd      j                         z   }
t!        |
       t#        t$              j&                  j)                         }t        j                  j	                  |d      }t+        j,                  |dz   |dz          t+        j,                  |dz   |dz          t+        j,                  |dz   |dz          y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   !xY w)Nzllama-index-- _testsexampleszllama_index//r   w)TYPENAME)r&   r'   PREFIXz/pyproject.toml)PACKAGE_NAMEr&   r'   z
/README.mdz/test_z.pycommonz/.gitignorez	/Makefilez/_buildz/BUILD)replacelowerr   pathjoingetcwdr   r   openr   formatr   writer   r   titler   r   __file__parentresolveshutilcopyfile)r   r   r   pkg_namepkg_path
tests_pathexamples_pathpkg_src_dirfinit_stringtest_file_namescript_pathcommon_paths                r   init_new_packagerC      s    > '(*:);<DDS#N	c		F81%5$6a8H7IJRR
 
c		  ww||BIIK2Hh0JGGLL:6M'',,
 ~ +,A.>-?@HHSegxq)9(:!<L;MNVVSegK hjmk j!	kN*C	0 A ~	 OO%--c37==?%--c37==?
 &,,%--c37==?%--c37==?~~c3/557 	 	
  
h**C	0 
A	  %%++-%++-	

 
h%s	+ 
q	%%++-335%++-335	

  > !"!$4#5S9AA#sKQQSfXQ/02B1C3GOO

%'N n% x.''//1K'',,{H5K
OOK-/M1IJ
OOK+-x+/EF
OOK)+X-@Ae  
 

 
s'   CQ		AQ$A Q#	QQ #Q-r   )r   r7   pathlibr   %llama_index.cli.new_package.templatesr   r   r   r   typingr   strr   r   r   rC    r   r   <module>rI      sq    	    '3 '
 3  ![B[B[B SM[Br   