o
    Ni	                     @  sT   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Z	dS )z)Sphinx deprecation classes and utilities.    )annotationsNc                   @     e Zd ZdS )RemovedInSphinx90WarningN__name__
__module____qualname__ r	   r	   F/home/ubuntu/.local/lib/python3.10/site-packages/sphinx/deprecation.pyr          r   c                   @  r   )RemovedInSphinx10WarningNr   r	   r	   r	   r
   r      r   r    F)raisesmodulestr	attributecanonical_nameremovetuple[int, int]r   boolreturnNonec          	      C  s   |dkrt }n|dkrt}n
d|d}t||  d| }|r+d|d|d}n|d	}|r6t|| d
}tj||dd dS )aX  Helper function for module-level deprecations using ``__getattr__``.

    :param module: The module containing a deprecated object.
    :param attribute: The name of the deprecated object.
    :param canonical_name: Optional fully-qualified name for its replacement.
    :param remove: Target version for removal.
    :param raises: Indicate whether to raise an exception instead of a warning.

    When *raises* is ``True``, an :exc:`AttributeError` is raised instead
    of emitting a warning so that it is easy to locate deprecated objects
    in tests that could suppress deprecation warnings.

    Usage::

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


       def __getattr__(name: str) -> Any:
           if name not in _DEPRECATED_OBJECTS:
               msg = f'module {__name__!r} has no attribute {name!r}'
               raise AttributeError(msg)

           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AttributeErrorwarningswarn)	r   r   r   r   r   warning_classmsgqualnamemessager	   r	   r
   _deprecation_warning   s   +

r%   )r   )r   r   r   r   r   r   r   r   r   r   r   r   )
__doc__
__future__r   r   DeprecationWarningr   PendingDeprecationWarningr   RemovedInNextVersionWarningr%   r	   r	   r	   r
   <module>   s    