a
    »ÏOc  ã                   @   sT   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Z‡ fdd„Z‡  ZS )ÚSoftDependencyErrorzE
    Raised when a feature requires a dependency that is missing
    c                    s   t ƒ  d|› �¡ d S )Nz1To use this feature this dependency is required: )ÚsuperÚ__init__)ÚselfÚdep_name©Ú	__class__© úG/var/www/html/gsl.tools/lib/python3.9/site-packages/confu/exceptions.pyr      s    zSoftDependencyError.__init__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__classcell__r   r   r   r	   r      s   r   c                       s4   e Zd ZdZ‡ fdd„Zedd„ ƒZdd„ Z‡  ZS )ÚValidationErrorBasez+
    Config validation error interface
    c                    s.   |› d|› �}||||dœ| _ tƒ  |¡ dS )a  
        **Arguments**

        - attribute (`Attribute`): confu attribute instance
        - path (`list`): attribute path
        - value (`mixed`): value that caused the validation error
        - reason (`str`): human readable reason message for validation error
        z: )ÚpathÚ	attributeÚvalueÚreasonN)Údetailsr   r   )r   r   r   r   r   Úmsgr   r   r	   r      s    
üzValidationErrorBase.__init__c                 C   s(   d  d dd„ | jd D ƒ¡| jd ¡S )z0
        pretty formatted error message
        z{}: {}Ú.c                 S   s   g | ]}t |ƒ‘qS r   )Ústr)Ú.0Úir   r   r	   Ú
<listcomp>(   ó    z.ValidationErrorBase.pretty.<locals>.<listcomp>r   r   )ÚformatÚjoinr   ©r   r   r   r	   Úpretty"   s     ÿzValidationErrorBase.prettyc                 C   sP   t |ƒt | ƒkrdS | jd |jd koN| jd |jd koN| jd |jd kS )NFr   r   r   )Útyper   )r   Úotherr   r   r	   Ú__eq__+   s    ÿýzValidationErrorBase.__eq__)	r
   r   r   r   r   Úpropertyr   r"   r   r   r   r   r	   r   
   s
   
r   c                   @   s   e Zd ZdZdS )ÚValidationWarningz#
    Config validation warning
    N©r
   r   r   r   r   r   r   r	   r$   6   s   r$   c                   @   s   e Zd ZdZdS )ÚValidationErrorz!
    Config validation error
    Nr%   r   r   r   r	   r&   >   s   r&   c                   @   s   e Zd ZdZdd„ ZdS )ÚApplyDefaultErrorz@
    Raised when an exception occured during apply_defaults
    c                 C   s   | j S )N)r   r   r   r   r	   Ú__str__K   s    zApplyDefaultError.__str__N)r
   r   r   r   r(   r   r   r   r	   r'   F   s   r'   N)ÚImportErrorr   Ú
ValueErrorr   r$   r&   r'   r   r   r   r	   Ú<module>   s   	,