
    2hA                     0   S SK JrJrJr  S SKJrJr  S SKrS SKrS SK	rSSS/0r
SSS	S
00SSSS.0SS/SS.0S.r\R                  R                  \5        \R                  " S5      rS rS rS rS rS r\R*                  " \
S9\R,                  " SSS\S9\R.                  " SSS\R0                  " \" 5       S9S S!9\R.                  " S"S#S\R0                  " S$S%9S&S!9\R.                  " S'S(SS)S*S+9\R.                  " S,S-S.S/S)\S0S19\R.                  " S2S3S4S5S)S)S6S79\R.                  " S8SS)S)S9S:9\R.                  " S;SS)S)S\S<S=9\R.                  " S>SS)S)S\S?S=9\R2                  " \S@9SA 5       5       5       5       5       5       5       5       5       5       5       rg)B    )gTTS	gTTSError__version__)	tts_langs_fallback_deprecated_langNhelp_option_namesz-hz--help   defaultformatz&%(name)s - %(levelname)s - %(message)sconsolezlogging.StreamHandler)class	formattergttsWARNING)handlerslevel)version
formattersr   loggersc                      g)z*Charset to use for --file <path>|- (stdin)utf8 r       @/var/www/auris/envauris/lib/python3.13/site-packages/gtts/cli.pysys_encodingr      s    r   c                     U(       d&  SU R                   ;  a  [        R                  " S5      eU(       a&  SU R                   ;   a  [        R                  " S5      eU$ )zjValidation callback for the <text> argument.
Ensures <text> (arg) and <file> (opt) are mutually exclusive
filez#<text> or -f/--file <file> requiredz2<text> and -f/--file <file> can't be used together)paramsclickBadParameter)ctxparamtexts      r   validate_textr$      sI     F#**,  !FGG#**$  !UVVKr   c                 "   U R                   S   (       a  U$ [        U5      n U[        5       ;  a  [        R                  " SU-  5      eSU R                   S'    U$ ! [
         a(  n[        R                  [        U5      SS9   SnAU$ SnAff = f)zsValidation callback for the <lang> option.
Ensures <lang> is a supported language unless the <nocheck> flag is set
nocheckzp'%s' not in list of supported languages.
Use --all to list languages or add --nocheck to disable language check.Texc_infoN)	r   r   r   r   
UsageErrorRuntimeErrorlogdebugstr)r!   r"   langes       r   validate_langr0   *   s     zz) %T*D)y{""";=AB  %)CJJy! K  ) 			#a&4	(K)s   6A 
B&B		Bc                 r  ^ U(       a  U R                   (       a  g [        5       m[        U4S jT 5       5      n[        R                  " SSR                  U5      -   5        U R                  5         g! [         a8  n[        R                  [        U5      SS9  [        R                  " S5      eSnAff = f)zWCallback for <all> flag.
Prints formatted sorted list of supported languages and exits
Nc              3   N   >#    U  H  nS R                  UTU   5      v   M     g7f)z{}: {}N)r   ).0klangss     r   	<genexpr>"print_languages.<locals>.<genexpr>P   s#     Le58 < <es   "%z  z
  Tr'   zCouldn't fetch language list.)resilient_parsingr   sortedr   echojoinr*   r+   r,   r-   ClickExceptionexit)r!   r"   valuelangs_str_listr/   r5   s        @r   print_languagesr@   G   s     C))DLeLL

4&++n556 HHJ  D		#a&4	(""#BCCDs   AA4 4
B6>3B11B6c                 X    U(       a#  [         R                  [        R                  5        g)z6Callback for <debug> flag.
Sets logger level to DEBUG
N)r+   setLevelloggingDEBUG)r!   r"   r,   s      r   	set_debugrE   X   s     W]]#
r   )context_settingsr#   z<text>F)metavarrequiredcallbackz-fz--filez<file>)encodingz#Read from <file> instead of <text>.)rG   typehelpz-oz--outputwb)modez"Write to <file> instead of stdout.z-sz--slowTzRead more slowly.)r
   is_flagrL   z-lz--langz<lang>enzIIETF language tag. Language to speak in. List documented tags with --all.)rG   r
   show_defaultrI   rL   z-tz--tldz<tld>comzHTop-level domain for the Google host, i.e https://translate.google.<tld>)rG   r
   rQ   is_eagerrL   z	--nocheckzCDisable strict IETF language tag checking. Allow undocumented tags.)r
   rO   rS   rL   z--allz;Print all documented available IETF language tags and exit.)r
   rO   rS   expose_valuerI   rL   z--debugzShow debug information.)r   c                    U S:X  a$  [         R                  " S5      R                  5       n U(       d  [         R                  " S5      nU(       a   UR                  5       n  [        XX4U(       + S9nUR                  U5        g! [         aN  n[
        R                  [        U5      SS9  [         R                  " UR                  S[        5       -  5      eSnAff = f! [        [        4 a$  n[         R                  " [        U5      5      eSnAf[          a$  n[         R"                  " [        U5      5      eSnAff = f)	z|Read <text> to mp3 format using Google Translate's Text-to-Speech API
(set <text> or --file <file> to - for standard input)
-stdinstdoutTr'   z"<file> must be encoded using '%s'.N)r#   r.   slowtld
lang_check)r   get_text_streamreadget_binary_streamUnicodeDecodeErrorr+   r,   r-   	FileErrornamer   r   write_to_fp
ValueErrorAssertionErrorr)   r   r<   )	r#   r   outputrY   rZ   r.   r&   r/   ttss	            r   tts_clirg   a   s   H s{$$W-224 ((2 	99;D+dGT " 	IIc!ftI,//		?,.P 	 ' 's1v&& +""3q6**+s=   B !!C 
CA	CCD>.DD>D99D>)r   r   r   r   	gtts.langr   r   r   rC   logging.configCONTEXT_SETTINGSLOGGER_SETTINGSconfig
dictConfig	getLoggerr+   r   r$   r0   r@   rE   commandargumentoptionFileversion_optionrg   r   r   r   <module>rt      s   - - :    ($)9:  x)QRS&=IVWi[9EF	   / *

:"  015=Q	\^	,	. 			- dHeT@ST	T 	S 	N 	F 	" k*+ + U R 2|+r   