B
    ÿ‹dX  ã               @   sè   d Z ddlmZm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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 )z*Contains SphinxError and a few subclasses.é    )ÚAnyÚOptionalc               @   s   e Zd ZdZdZdS )ÚSphinxErrora»  Base class for Sphinx errors.

    This is the base class for "nice" exceptions.  When such an exception is
    raised, Sphinx will abort the build and present the exception category and
    message to the user.

    Extensions are encouraged to derive from this exception for their custom
    errors.

    Exceptions *not* derived from :exc:`SphinxError` are treated as unexpected
    and shown to the user with a part of the traceback (and the full traceback
    saved in a temporary file).

    .. attribute:: category

       Description of the exception "category", used in converting the
       exception to a string ("category: message").  Should be set accordingly
       in subclasses.
    zSphinx errorN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úcategory© r
   r
   úZ/work/yifan.wang/ringdown/master-ringdown-env/lib/python3.7/site-packages/sphinx/errors.pyr      s   r   c               @   s   e Zd ZdZdZdS )ÚSphinxWarningzWarning, treated as error.zWarning, treated as errorN)r   r   r   r   r	   r
   r
   r
   r   r      s   r   c               @   s   e Zd ZdZdZdS )ÚApplicationErrorz!Application initialization error.zApplication errorN)r   r   r   r   r	   r
   r
   r
   r   r   "   s   r   c                   sh   e Zd ZdZdeee ee ddœ‡ fdd„Zeedœdd„ƒZ	edœd	d
„Z
edœ‡ fdd„Z‡  ZS )ÚExtensionErrorzExtension error.N)ÚmessageÚorig_excÚmodnameÚreturnc                s"   t ƒ  |¡ || _|| _|| _d S )N)ÚsuperÚ__init__r   r   r   )Úselfr   r   r   )Ú	__class__r
   r   r   *   s    zExtensionError.__init__)r   c             C   s   | j rd| j  S dS d S )NzExtension error (%s)zExtension error)r   )r   r
   r
   r   r	   2   s    
zExtensionError.categoryc             C   s.   | j rd| jj| j| j f S d| jj| jf S )Nz
%s(%r, %r)z%s(%r))r   r   r   r   )r   r
   r
   r   Ú__repr__9   s    zExtensionError.__repr__c                s"   t ƒ  ¡ }| jrd|| jf S |S )Nz%s (exception: %s))r   Ú__str__r   )r   Z
parent_str)r   r
   r   r   ?   s    
zExtensionError.__str__)NN)r   r   r   r   Ústrr   Ú	Exceptionr   Úpropertyr	   r   r   Ú__classcell__r
   r
   )r   r   r   '   s   r   c               @   s   e Zd ZdZdZdS )ÚBuildEnvironmentErrorzBuildEnvironment error.zBuildEnvironment errorN)r   r   r   r   r	   r
   r
   r
   r   r   F   s   r   c               @   s   e Zd ZdZdZdS )ÚConfigErrorzConfiguration error.zConfiguration errorN)r   r   r   r   r	   r
   r
   r
   r   r   K   s   r   c               @   s   e Zd ZdZdZdS )ÚDocumentErrorzDocument error.zDocument errorN)r   r   r   r   r	   r
   r
   r
   r   r   P   s   r   c               @   s   e Zd ZdZdZdS )Ú
ThemeErrorzTheme error.zTheme errorN)r   r   r   r   r	   r
   r
   r
   r   r    U   s   r    c               @   s   e Zd ZdZdZdS )ÚVersionRequirementErrorz"Incompatible Sphinx version error.zSphinx version errorN)r   r   r   r   r	   r
   r
   r
   r   r!   Z   s   r!   c               @   s4   e Zd ZdZdZeeddœdd„Zedœdd	„ZdS )
ÚSphinxParallelErrorzSphinx parallel build error.zSphinx parallel build errorN)r   Ú	tracebackr   c             C   s   || _ || _d S )N)r   r#   )r   r   r#   r
   r
   r   r   d   s    zSphinxParallelError.__init__)r   c             C   s   | j S )N)r   )r   r
   r
   r   r   h   s    zSphinxParallelError.__str__)	r   r   r   r   r	   r   r   r   r   r
   r
   r
   r   r"   _   s   r"   c               @   s   e Zd ZdZedœdd„ZdS )ÚPycodeErrorz)Pycode Python source code analyser error.)r   c             C   s.   | j d }t| j ƒdkr*|d| j d  7 }|S )Nr   é   z (exception was: %r))ÚargsÚlen)r   Úresr
   r
   r   r   o   s    
zPycodeError.__str__N)r   r   r   r   r   r   r
   r
   r
   r   r$   l   s   r$   c               @   s   e Zd ZdZdS )ÚNoUriziRaised by builder.get_relative_uri() or from missing-reference handlers
    if there is no URI available.N)r   r   r   r   r
   r
   r
   r   r)   v   s   r)   c               @   s   e Zd ZdZdS )ÚFiletypeNotFoundErrorz@Raised by get_filetype() if a filename matches no source suffix.N)r   r   r   r   r
   r
   r
   r   r*   |   s   r*   N)r   Útypingr   r   r   r   r   r   r   r   r   r   r    r!   r"   r$   r)   r*   r
   r
   r
   r   Ú<module>   s   
