
    v;3hG                       d dl mZ d dlmZ  G d de      Z G d de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 G d! d"ee      Z G d# d$e      Z G d% d&e      Z G d' d(ee      Z G d) d*eee      Zy+),    )annotations)
Collectionc                      e Zd Zy)TOMLKitErrorN)__name__
__module____qualname__     R/var/www/html/audio-gradio/venv/lib/python3.12/site-packages/tomlkit/exceptions.pyr   r      s    r   r   c                  F     e Zd ZdZdd fdZed        Zed        Z xZS )
ParseErrorz
    This error occurs when the parser encounters a syntax error
    in the TOML being parsed. The error references the line and
    location within the line where the error was encountered.
    c                    || _         || _        |d}t        |   | d| j                    d| j                          y )NzTOML parse errorz	 at line z col )_line_colsuper__init__selflinecolmessage	__class__s       r   r   zParseError.__init__   sA    
	?(GG9Idjj\tyykJKr   c                    | j                   S N)r   r   s    r   r   zParseError.line   s    zzr   c                    | j                   S r   )r   r   s    r   r   zParseError.col   s    yyr   r   r   intr   r   r   z
str | NonereturnNone)	r   r   r	   __doc__r   propertyr   r   __classcell__r   s   @r   r   r   
   s6    L    r   r   c                  $     e Zd ZdZd fdZ xZS )MixedArrayTypesErrorz@
    An array was found that had two or more element types.
    c                .    d}t         |   |||       y )NzMixed types found in arrayr   r   r   r   s       r   r   zMixedArrayTypesError.__init__(   s    .sG4r   r   r   r   r   r    r!   r   r   r	   r"   r   r$   r%   s   @r   r'   r'   #       5 5r   r'   c                  $     e Zd ZdZd fdZ xZS )InvalidNumberErrorz3
    A numeric field was improperly specified.
    c                .    d}t         |   |||       y )NzInvalid numberr)   r*   r   s       r   r   zInvalidNumberError.__init__3   s    "sG4r   r+   r,   r%   s   @r   r/   r/   .   r-   r   r/   c                  $     e Zd ZdZd fdZ xZS )InvalidDateTimeErrorz4
    A datetime field was improperly specified.
    c                .    d}t         |   |||       y )NzInvalid datetimer)   r*   r   s       r   r   zInvalidDateTimeError.__init__>       $sG4r   r+   r,   r%   s   @r   r2   r2   9   r-   r   r2   c                  $     e Zd ZdZd fdZ xZS )InvalidDateError0
    A date field was improperly specified.
    c                .    d}t         |   |||       y )NzInvalid dater)   r*   r   s       r   r   zInvalidDateError.__init__I        sG4r   r+   r,   r%   s   @r   r6   r6   D   r-   r   r6   c                  $     e Zd ZdZd fdZ xZS )InvalidTimeErrorr7   c                .    d}t         |   |||       y )NzInvalid timer)   r*   r   s       r   r   zInvalidTimeError.__init__T   r9   r   r+   r,   r%   s   @r   r;   r;   O   r-   r   r;   c                  $     e Zd ZdZd fdZ xZS )InvalidNumberOrDateErrorz;
    A numeric or date field was improperly specified.
    c                .    d}t         |   |||       y )NzInvalid number or date formatr)   r*   r   s       r   r   z!InvalidNumberOrDateError.__init___   s    1sG4r   r+   r,   r%   s   @r   r>   r>   Z   r-   r   r>   c                  $     e Zd ZdZd fdZ xZS )InvalidUnicodeValueErrorz2
    A unicode code was improperly specified.
    c                .    d}t         |   |||       y )NzInvalid unicode valuer)   r*   r   s       r   r   z!InvalidUnicodeValueError.__init__j   s    )sG4r   r+   r,   r%   s   @r   rA   rA   e   r-   r   rA   c                  $     e Zd ZdZd fdZ xZS )UnexpectedCharErrorz;
    An unexpected character was found during parsing.
    c                4    d|}t         |   |||       y )NzUnexpected character: r)   r*   r   r   r   charr   r   s        r   r   zUnexpectedCharError.__init__u   s#    *4(3sG4r   r   r   r   r   rG   strr    r!   r,   r%   s   @r   rD   rD   p   r-   r   rD   c                  $     e Zd ZdZd fdZ xZS )EmptyKeyErrorz0
    An empty key was found during parsing.
    c                .    d}t         |   |||       y )Nz	Empty keyr)   r*   r   s       r   r   zEmptyKeyError.__init__   s    sG4r   r+   r,   r%   s   @r   rK   rK   {   r-   r   rK   c                  $     e Zd ZdZd fdZ xZS )EmptyTableNameErrorz7
    An empty table name was found during parsing.
    c                .    d}t         |   |||       y )NzEmpty table namer)   r*   r   s       r   r   zEmptyTableNameError.__init__   r4   r   r+   r,   r%   s   @r   rN   rN      r-   r   rN   c                  $     e Zd ZdZd fdZ xZS )InvalidCharInStringErrorz@
    The string being parsed contains an invalid character.
    c                6    d|d}t         |   |||       y )NzInvalid character z
 in stringr)   r*   rF   s        r   r   z!InvalidCharInStringError.__init__   s%    &thj9sG4r   rH   r,   r%   s   @r   rQ   rQ      r-   r   rQ   c                  $     e Zd ZdZd fdZ xZS )UnexpectedEofErrorzD
    The TOML being parsed ended before the end of a statement.
    c                .    d}t         |   |||       y )NzUnexpected end of filer)   r*   r   s       r   r   zUnexpectedEofError.__init__   s    *sG4r   r+   r,   r%   s   @r   rT   rT      r-   r   rT   c                  &     e Zd ZdZdd fdZ xZS )InternalParserErrorz6
    An error that indicates a bug in the parser.
    c                D    d}|r	|d| dz  }t         |   |||       y )NzInternal parser errorz ()r)   r*   )r   r   r   r   msgr   s        r   r   zInternalParserError.__init__   s1    %Ry?"CsC0r   r   r   r,   r%   s   @r   rW   rW      s    1 1r   rW   c                  "     e Zd ZdZ fdZ xZS )NonExistentKeyz&
    A non-existent key was used.
    c                0    d| d}t         |   |       y )NKey "z" does not exist.r*   r   keyr   r   s      r   r   zNonExistentKey.__init__   s    #/0!r   r,   r%   s   @r   r\   r\      s    " "r   r\   c                  "     e Zd ZdZ fdZ xZS )KeyAlreadyPresentz*
    An already present key was used.
    c                J    t        |d|      }d| d}t        | 	  |       y )Nr`   r^   z" already exists.)getattrr   r   r_   s      r   r   zKeyAlreadyPresent.__init__   s-    c5#&#/0!r   r,   r%   s   @r   rb   rb      s    " "r   rb   c                        e Zd Zd fdZ xZS )InvalidControlCharc                v    d}|dk  r|dz  }|t        |      dd  z  }d| d| d}t        | 	  |||       y )	Nz\u00   0   zFControl characters (codes less than 0x1f and 0x7f) are not allowed in z, use z insteadr)   )hexr   r   )r   r   r   rG   typedisplay_coder   r   s          r   r   zInvalidControlChar.__init__   sc    "9CLD	!"%##'& ).* 	 	sG4r   )
r   r   r   r   rG   r   rl   rI   r    r!   r   r   r	   r   r$   r%   s   @r   rf   rf      s    5 5r   rf   c                        e Zd Zd fdZ xZS )InvalidStringErrorc           	     V    t        |      dd }t        | 	  d| | | d| d       y )N   zInvalid string: z. The character sequences z are invalid.)reprr   r   )r   valueinvalid_sequences	delimiterrepr_r   s        r   r   zInvalidStringError.__init__   sB    UAb!yk% <''8&9H	
r   )ru   rI   rv   zCollection[str]rw   rI   rn   r%   s   @r   rp   rp      s    
 
r   rp   c                      e Zd ZdZy)ConvertErrorzRaised when item() fails to convert a value.
    It should be a TypeError, but due to historical reasons
    it needs to subclass ValueError as well.
    N)r   r   r	   r"   r
   r   r   rz   rz      s    r   rz   N)
__future__r   typingr   	Exceptionr   
ValueErrorr   r'   r/   r2   r6   r;   r>   rA   rD   rK   rN   rQ   rT   rW   KeyErrorr\   rb   rf   rp   	TypeErrorrz   r
   r   r   <module>r      s   " 	9 	\ 25: 55 55: 55z 55z 55z 55z 55* 55J 55* 55z 55 5
1* 
1"X| "	" 	"5 5$
\ 
9j, r   