U
    \Sh                     @  sV   d Z ddlmZ ddlZG dd deZG dd deZeZdddd	d
dddZ	dS )z)Sphinx deprecation classes and utilities.    )annotationsNc                   @  s   e Zd ZdS )RemovedInSphinx80WarningN__name__
__module____qualname__ r   r   E/root/rtd-docs/venv/lib/python3.8/site-packages/sphinx/deprecation.pyr      s   r   c                   @  s   e Zd ZdS )RemovedInSphinx90WarningNr   r   r   r   r	   r
      s   r
   strztuple[int, int]None)module	attributecanonical_nameremovereturnc                C  st   |dkrt }n|dkrt}ntd|d|  d| }|rRd|d|d}n
|d	}tj|d
 |dd dS )a  Helper function for module-level deprecations using __getattr__

    Exemplar usage:

    .. code:: python

       # deprecated name -> (object to return, canonical path or empty string)
       _DEPRECATED_OBJECTS = {
           'deprecated_name': (object_to_return, 'fully_qualified_replacement_name', (8, 0)),
       }


       def __getattr__(name):
           if name not in _DEPRECATED_OBJECTS:
               raise AttributeError(f'module {__name__!r} has no attribute {name!r}')

           from sphinx.deprecation import _deprecation_warning

           deprecated_object, canonical_name, remove = _DEPRECATED_OBJECTS[name]
           _deprecation_warning(__name__, name, canonical_name, remove=remove)
           return deprecated_object
    )   r   )	   r   zremoval version z is invalid!.z
The alias z is deprecated, use z	 instead.z is deprecated.z, Check CHANGES for Sphinx API modifications.   )
stacklevelN)r   r
   RuntimeErrorwarningswarn)r   r   r   r   Zwarning_classZqualified_namemessager   r   r	   _deprecation_warning   s    

 r   )
__doc__
__future__r   r   DeprecationWarningr   PendingDeprecationWarningr
   ZRemovedInNextVersionWarningr   r   r   r   r	   <module>   s   