§
    û�ÄjÞ  ã                   ó’  — d Z  G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d	„ d
e¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z	 G d„ de¦  «        Z
 G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        ZdS )z"Copyright (C) 2020 Nidhal Baccouric                   ó(   ‡ — e Zd ZdZˆ fd„Zd„ Zˆ xZS )Ú	BaseErrorz$
    base error structure class
    c                 ód   •— || _         || _        t          ¦   «                              ¦   «          dS )z\
        @param val: actual value
        @param message: message shown to the user
        N)ÚvalÚmessageÚsuperÚ__init__©Úselfr   r   Ú	__class__s      €úKC:\Projects\Historical\venv\Lib\site-packages\deep_translator/exceptions.pyr   zBaseError.__init__	   s/   ø€ ð
 ˆŒØˆŒÝ‰Œ×ÒÑÔÐÐÐó    c                 óB   — d                      | j        | j        ¦  «        S )Nz	{} --> {})Úformatr   r   ©r
   s    r   Ú__str__zBaseError.__str__   s   € Ø×!Ò! $¤(¨D¬LÑ9Ô9Ð9r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Ú__classcell__©r   s   @r   r   r      sQ   ø€ € € € € ðð ðð ð ð ð ð:ð :ð :ð :ð :ð :ð :r   r   c                   ó&   ‡ — e Zd ZdZ	 dˆ fd„	Zˆ xZS )ÚLanguageNotSupportedExceptionzg
    exception thrown if the user uses a language
    that is not supported by the deep_translator
    ú+There is no support for the chosen languagec                 óL   •— t          ¦   «                              ||¦  «         d S ©N©r   r   r	   s      €r   r   z&LanguageNotSupportedException.__init__   s%   ø€ õ 	‰Œ×Ò˜˜gÑ&Ô&Ð&Ð&Ð&r   )r   ©r   r   r   r   r   r   r   s   @r   r   r      sM   ø€ € € € € ðð ð Ið'ð 'ð 'ð 'ð 'ð 'ð 'ð 'ð 'ð 'r   r   c                   ó&   ‡ — e Zd ZdZ	 dˆ fd„	Zˆ xZS )ÚNotValidPayloadú@
    exception thrown if the user enters an invalid payload
    úWtext must be a valid text with maximum 5000 character,otherwise it cannot be translatedc                 óZ   •— t          t          | ¦  «                             ||¦  «         d S r   )r   r    r   r	   s      €r   r   zNotValidPayload.__init__'   s+   ø€ õ 	�o˜tÑ$Ô$×-Ò-¨c°7Ñ;Ô;Ð;Ð;Ð;r   )r"   r   r   s   @r   r    r    "   sL   ø€ € € € € ðð ð,ð<ð <ð <ð <ð <ð <ð <ð <ð <ð <r   r    c                   ó$   ‡ — e Zd ZdZdˆ fd„	Zˆ xZS )ÚInvalidSourceOrTargetLanguager!   ú"Invalid source or target language!c                 óZ   •— t          t          | ¦  «                             ||¦  «         d S r   )r   r%   r   r	   s      €r   r   z&InvalidSourceOrTargetLanguage.__init__5   s*   ø€ ÝÕ+¨TÑ2Ô2×;Ò;¸CÀÑIÔIÐIÐIÐIr   )r&   r   r   s   @r   r%   r%   0   sQ   ø€ € € € € ðð ðJð Jð Jð Jð Jð Jð Jð Jð Jð Jr   r%   c                   ó&   ‡ — e Zd ZdZ	 dˆ fd„	Zˆ xZS )ÚTranslationNotFoundzX
    exception thrown if no translation was found for the text provided by the user
    úNNo translation was found using the current translator. Try another translator?c                 óZ   •— t          t          | ¦  «                             ||¦  «         d S r   )r   r)   r   r	   s      €r   r   zTranslationNotFound.__init__>   s,   ø€ õ
 	Õ! 4Ñ(Ô(×1Ò1°#°wÑ?Ô?Ð?Ð?Ð?r   )r*   r   r   s   @r   r)   r)   9   sW   ø€ € € € € ðð ð að@ð @ð @ð @ð @ð @ð @ð @ð @ð @r   r)   c                   ó&   ‡ — e Zd ZdZ	 dˆ fd„	Zˆ xZS )ÚElementNotFoundInGetRequestz`
    exception thrown if the html element was not found in the body parsed by beautifulsoup
    ú2Required element was not found in the API responsec                 óZ   •— t          t          | ¦  «                             ||¦  «         d S r   )r   r-   r   r	   s      €r   r   z$ElementNotFoundInGetRequest.__init__K   s,   ø€ õ 	Õ)¨4Ñ0Ô0×9Ò9¸#¸wÑGÔGÐGÐGÐGr   )r.   r   r   s   @r   r-   r-   F   sW   ø€ € € € € ðð ð
 PðHð Hð Hð Hð Hð Hð Hð Hð Hð Hr   r-   c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )ÚNotValidLengthzY
    exception thrown if the provided text exceed the length limit of the translator
    c                 ól   •— d|› d|› d�}t          t          | ¦  «                             ||¦  «         d S )NzText length need to be between z and z characters)r   r1   r   )r
   r   Ú	min_charsÚ	max_charsr   r   s        €r   r   zNotValidLength.__init__V   sA   ø€ ØZ°IÐZÐZÀIÐZÐZÐZˆÝ�n˜dÑ#Ô#×,Ò,¨S°'Ñ:Ô:Ð:Ð:Ð:r   r   r   s   @r   r1   r1   Q   sB   ø€ € € € € ðð ð;ð ;ð ;ð ;ð ;ð ;ð ;ð ;ð ;r   r1   c                   ó"   — e Zd ZdZ	 dd„Zd„ ZdS )ÚRequestErrorúb
    exception thrown if an error occurred during the request call, e.g a connection problem.
    úgRequest exception can happen due to an api connection error. Please check your connection and try againc                 ó   — || _         d S r   ©r   ©r
   r   s     r   r   zRequestError.__init__`   s   € ð
 ˆŒˆˆr   c                 ó   — | j         S r   r:   r   s    r   r   zRequestError.__str__g   ó
   € ØŒ|Ðr   N)r8   ©r   r   r   r   r   r   © r   r   r6   r6   [   sF   € € € € € ðð ð5ðð ð ð ðð ð ð ð r   r6   c                   ó   — e Zd ZdZd„ Zd„ ZdS )ÚMicrosoftAPIerrorzE
    exception thrown if Microsoft API returns one of its errors
    c                 ó<   — t          |¦  «        | _        d| _        d S )Nz*Microsoft API returned the following error©ÚstrÚapi_messager   ©r
   rE   s     r   r   zMicrosoftAPIerror.__init__p   s   € Ý˜{Ñ+Ô+ˆÔØCˆŒˆˆr   c                 óB   — d                      | j        | j        ¦  «        S ©Nz{}: {}©r   r   rE   r   s    r   r   zMicrosoftAPIerror.__str__t   ó   € Ø�Š˜tœ|¨TÔ-=Ñ>Ô>Ð>r   Nr>   r?   r   r   rA   rA   k   s?   € € € € € ðð ðDð Dð Dð?ð ?ð ?ð ?ð ?r   rA   c                   ó"   — e Zd ZdZ	 dd„Zd„ ZdS )ÚTooManyRequestsr7   úåServer Error: You made too many requests to the server.According to google, you are allowed to make 5 requests per secondand up to 200k requests per day. You can wait and try again later oryou can try the translate_batch functionc                 ó   — || _         d S r   r:   r;   s     r   r   zTooManyRequests.__init__}   s   € ð ˆŒˆˆr   c                 ó   — | j         S r   r:   r   s    r   r   zTooManyRequests.__str__†   r=   r   N)rM   r>   r?   r   r   rL   rL   x   sF   € € € € € ðð ð3ðð ð ð ðð ð ð ð r   rL   c                   ó>   ‡ — e Zd ZdZdddddddd	d
dddœZˆ fd„Zˆ xZS )ÚServerExceptionzE
    Default YandexTranslate exception from the official website
    ÚERR_BAD_REQUESTÚERR_KEY_INVALIDÚERR_KEY_BLOCKEDÚERR_DAILY_REQ_LIMIT_EXCEEDEDÚERR_DAILY_CHAR_LIMIT_EXCEEDEDÚERR_TEXT_TOO_LONGÚERR_TOO_MANY_REQUESTSÚERR_UNPROCESSABLE_TEXTÚERR_INTERNAL_SERVER_ERRORÚERR_LANG_NOT_SUPPORTEDÚERR_SERVICE_NOT_AVAIBLE)i�  i‘  i’  i“  i”  i�  i­  i¦  iô  iõ  i÷  c                 ó€   •— | j                              |d¦  «        } t          t          | ¦  «        j        |g|¢R Ž  d S )NzAPI server error)ÚerrorsÚgetr   rQ   r   )r
   Ústatus_codeÚargsr   r   s       €r   r   zServerException.__init__�   sD   ø€ Ø”+—/’/ +Ð/AÑBÔBˆØ-��o˜tÑ$Ô$Ô-¨gÐ=¸Ð=Ð=Ð=Ð=Ð=Ð=r   )r   r   r   r   r^   r   r   r   s   @r   rQ   rQ   Š   sq   ø€ € € € € ðð ð
 ØØØ+Ø,Ø Ø$Ø%Ø(Ø%Ø&ðð €Fð>ð >ð >ð >ð >ð >ð >ð >ð >r   rQ   c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )ÚApiKeyExceptionz4
    exception thrown if no ApiKey was provided
    c                 ó^   •— d|› d|› d�}t          ¦   «                              d |¦  «         d S )Nzš
You have to pass your api_key!
You can do this by passing the key as a parameter/argument to the translator class
or by setting the environment variable z

Example: export z="your_api_key"
r   )r
   Úenv_varÚmsgr   s      €r   r   zApiKeyException.__init__§   sO   ø€ ðð )0ðð ð
 ðð ð ˆõ 	‰Œ×Ò˜˜sÑ#Ô#Ð#Ð#Ð#r   r   r   s   @r   rc   rc   ¢   sB   ø€ € € € € ðð ð	$ð 	$ð 	$ð 	$ð 	$ð 	$ð 	$ð 	$ð 	$r   rc   c                   ó   ‡ — e Zd Zˆ fd„Zˆ xZS )ÚAuthorizationExceptionc                 óF   •— d|z   } t          ¦   «         j        |g|¢R Ž  d S )Nz%Unauthorized access with the api key r   )r
   Úapi_keyra   rf   r   s       €r   r   zAuthorizationException.__init__´   s2   ø€ Ø5¸Ñ?ˆØ�‰ŒÔ˜Ð$˜tÐ$Ð$Ð$Ð$Ð$Ð$r   )r   r   r   r   r   r   s   @r   rh   rh   ³   s8   ø€ € € € € ð%ð %ð %ð %ð %ð %ð %ð %ð %r   rh   c                   ó   — e Zd ZdZd„ Zd„ ZdS )ÚBaiduAPIerrorzA
    exception thrown if Baidu API returns one of its errors
    c                 ó<   — t          |¦  «        | _        d| _        d S )Nz&Baidu API returned the following errorrC   rF   s     r   r   zBaiduAPIerror.__init__¾   s   € Ý˜{Ñ+Ô+ˆÔØ?ˆŒˆˆr   c                 óB   — d                      | j        | j        ¦  «        S rH   rI   r   s    r   r   zBaiduAPIerror.__str__Â   rJ   r   Nr>   r?   r   r   rl   rl   ¹   s?   € € € € € ðð ð@ð @ð @ð?ð ?ð ?ð ?ð ?r   rl   N)Ú__copyright__Ú	Exceptionr   r   r    r%   r)   r-   r1   r6   rA   rL   rQ   rc   rh   rl   r?   r   r   ú<module>rq      sx  ðØ4€ð:ð :ð :ð :ð :�	ñ :ô :ð :ð$	'ð 	'ð 	'ð 	'ð 	' Iñ 	'ô 	'ð 	'ð<ð <ð <ð <ð <�iñ <ô <ð <ðJð Jð Jð Jð J Iñ Jô Jð Jð
@ð 
@ð 
@ð 
@ð 
@˜)ñ 
@ô 
@ð 
@ðHð Hð Hð Hð H )ñ Hô Hð Hð;ð ;ð ;ð ;ð ;�Yñ ;ô ;ð ;ðð ð ð ð �9ñ ô ð ð 
?ð 
?ð 
?ð 
?ð 
?˜	ñ 
?ô 
?ð 
?ðð ð ð ð �iñ ô ð ð$>ð >ð >ð >ð >�iñ >ô >ð >ð0$ð $ð $ð $ð $�iñ $ô $ð $ð"%ð %ð %ð %ð %˜Yñ %ô %ð %ð
?ð 
?ð 
?ð 
?ð 
?�Iñ 
?ô 
?ð 
?ð 
?ð 
?r   