
    -Ph
                        d Z ddlmZ ddlZddlZ G d de          Z G d de          ZeZ	dej
        vr ej        d	e	
           	 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/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/sphinx/deprecation.pyr   r   	           Dr   r   c                      e Zd ZdS )RemovedInSphinx10WarningNr   r
   r   r   r   r      r   r   r   PYTHONWARNINGSdefault)category F)raisesmodulestr	attributecanonical_nameremovetuple[int, int]r   boolreturnNonec                   |dk    rt           }n#|dk    rt          }nd|d}t          |          |  d| }|r
d|d|d}n|d	}|rt          |          | d
}t	          j        ||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messages	            r   _deprecation_warningr,      s    V '?	7		077773&&9&&H 1TTTTTT 	 000 &W%%%FFFGM'=Q777777r   )r   )r   r   r   r   r   r   r   r   r   r   r   r   )__doc__
__future__r   osr&   DeprecationWarningr   PendingDeprecationWarningr   RemovedInNextVersionWarningenvironfilterwarningsr,   r
   r   r   <module>r5      s    / / " " " " " " 				 	 	 	 	 	1 	 	 		 	 	 	 	8 	 	 	 7 
 2:%%HI0KLLLL ?8 ?8 ?8 ?8 ?8 ?8 ?8 ?8 ?8r   