
    )i                     ,   S SK r S SKJr  S SKr\R                  R
                  r\R                  R                  r\R                  R                  r
S\4S jrS\4S jrS\4S jrS\4S jrS\R                   S	\S
\4S jrS\R$                  S\4S jrg)    N)pathmsgc                 0    [         R                  " U 5        g )N)typerechor   s    i/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/indic_transliteration/sanscript_cli/utils.py	show_infor
      s    	JJsO    c                 8    [         R                  " U [        SS9  g NT)fgerr)r   sechoSUCCESS_COLORr   s    r	   show_successr          	KK40r   c                 8    [         R                  " U [        SS9  g r   )r   r   WARNING_COLORr   s    r	   show_warningr      r   r   c                 8    [         R                  " U [        SS9  g r   )r   r   ERROR_COLORr   s    r	   
show_errorr      s    	KK.r   
input_fileinput_stringreturnc                     U b  Ub  [        S5        U R                  5       $ Ub  U$ [        S5        [        S5        [        R
                  " SS9e)NzCWarning: The input string is ignored since input file is specified.z6Error: Either a string or a file is required as input.z See help (--help) for more info.   )code)r   readr   r
   r   Exit)r   r   s     r	   get_input_datar"      sU    #U   GH01
**!
r   output_fileoutput_datac                     U c  [         R                  " U5      $ U R                  U5        U [        R                  L a  g [        S[        R                  " U R                  5       35        g )NzOutput written to: )	r   r   writesysstdoutr   r   realpathname)r#   r$   s     r	   write_outputr+   +   sT    zz+&&k"cjj &t}}[5E5E'F&GHIr   )r'   osr   r   colorsGREENr   YELLOWr   
BRIGHT_REDr   strr
   r   r   r   FileTextr"   FileTextWriter+    r   r	   <module>r5      s    
  ""##ll%%3 1c 11c 1/C /u~~ S S  	Je11 	J 	Jr   