U
    Y»{j  ã                   @   s„   G d d„ de ƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd	„ d	eƒZG d
d„ deƒZG dd„ deƒZG dd„ deƒZ	dS )c                   @   s   e Zd ZdS )ÚPlotlyErrorN©Ú__name__Ú
__module__Ú__qualname__© r   r   úW/var/www/html/bwave/python/venv/lib/python3.8/site-packages/_plotly_utils/exceptions.pyr      s   r   c                   @   s   e Zd ZdS )ÚPlotlyEmptyDataErrorNr   r   r   r   r   r      s   r   c                       s&   e Zd Zd‡ fdd„	Zdd„ Z‡  ZS )ÚPlotlyGraphObjectErrorÚ r   c                    s0   || _ || _t|ƒ| _|| _tt| ƒ |¡ dS )a  
        General graph object error for validation failures.

        :param (str|unicode) message: The error message.
        :param (iterable) path: A path pointing to the error.
        :param notes: Add additional notes, but keep default exception message.

        N)ÚmessageZplain_messageÚlistÚpathÚnotesÚsuperr	   Ú__init__)Úselfr   r   r   ©Ú	__class__r   r   r   
   s
    	
zPlotlyGraphObjectError.__init__c                 C   s<   | j dd dd„ | jD ƒ¡ d d | j¡dœ}djf |ŽS )	z6This is called by Python to present the error message.ú[z][c                 s   s   | ]}t |ƒV  qd S ©N)Úrepr)Ú.0Úkr   r   r   Ú	<genexpr>   s     z1PlotlyGraphObjectError.__str__.<locals>.<genexpr>ú]Ú
©r   r   r   z){message}

Path To Error: {path}

{notes})r   Újoinr   r   Úformat)r   Úformat_dictr   r   r   Ú__str__   s
    
ýzPlotlyGraphObjectError.__str__)r
   r   r   )r   r   r   r   r    Ú__classcell__r   r   r   r   r	   	   s   r	   c                       s   e Zd Zd‡ fdd„	Z‡  ZS )ÚPlotlyDictKeyErrorr   c                    sL   |d |j dœ}djf |Ž}|jdd�gt|ƒ }tt| ƒj|||d� dS )ú3See PlotlyGraphObjectError.__init__ for param docs.éÿÿÿÿ©Ú	attributeÚobject_namez/'{attribute}' is not allowed in '{object_name}'T©Zreturn_helpr   N)Ú_namer   Úhelpr   r   r"   r   ©r   Úobjr   r   r   r   r   r   r   r   $   s    ÿ
  ÿzPlotlyDictKeyError.__init__)r   ©r   r   r   r   r!   r   r   r   r   r"   #   s   r"   c                       s   e Zd Zd‡ fdd„	Z‡  ZS )ÚPlotlyDictValueErrorr   c                    sR   |d |j dœ}djf |Ž}|j|d dd�gt|ƒ }tt| ƒj|||d� dS )r#   r$   r%   z6'{attribute}' has invalid value inside '{object_name}'Tr(   )r   r   r   N)r)   r   r*   r   r   r.   r   r+   r   r   r   r   1   s    ÿ
  ÿzPlotlyDictValueError.__init__)r   r-   r   r   r   r   r.   0   s   r.   c                       s   e Zd Zd‡ fdd„	Z‡  ZS )ÚPlotlyListEntryErrorr   c                    sL   |d |j dœ}djf |Ž}|jdd�gt|ƒ }tt| ƒj|||d� dS )r#   r$   ©Úindexr'   ú:Invalid entry found in '{object_name}' at index, '{index}'Tr(   r   N)r)   r   r*   r   r   r/   r   r+   r   r   r   r   >   s    ÿ
  ÿzPlotlyListEntryError.__init__)r   r-   r   r   r   r   r/   =   s   r/   c                       s   e Zd Zd‡ fdd„	Z‡  ZS )ÚPlotlyDataTypeErrorr   c                    sH   |d |j dœ}djf |Ž}d}|gt|ƒ }tt| ƒj|||d� dS )r#   r$   r0   r2   z=It's invalid because it doesn't contain a valid 'type' value.r   N)r)   r   r   r   r3   r   )r   r,   r   r   r   r   Znoter   r   r   r   K   s    ÿ
  ÿzPlotlyDataTypeError.__init__)r   r-   r   r   r   r   r3   J   s   r3   c                   @   s   e Zd ZdZdd„ ZdS )ÚPlotlyKeyErrora  
    KeyErrors are not printed as beautifully as other errors (this is so that
    {}[''] prints    "KeyError: ''" and not "KeyError:"). So here we use
    LookupError's __str__ to make a PlotlyKeyError object which will print nicer
    error messages for KeyErrors.
    c                 C   s
   t  | ¡S r   )ÚLookupErrorr    )r   r   r   r   r    `   s    zPlotlyKeyError.__str__N)r   r   r   Ú__doc__r    r   r   r   r   r4   X   s   r4   N)
Ú	Exceptionr   r   r	   r"   r.   r/   r3   ÚKeyErrorr4   r   r   r   r   Ú<module>   s   