3

T'ícä
ã@s¨dZddlZddlZddlmZddlmZmZmZGdd„de	ƒZ
Gdd„deƒZe
Z
ifeeeefeeeeefdd	œd
d„ZGdd
„d
ƒZGdd„deƒZdS)z)Sphinx deprecation classes and utilities.éN)Ú
import_module)ÚAnyÚDictÚTypec@seZdZdS)ÚRemovedInSphinx50WarningN)Ú__name__Ú
__module__Ú__qualname__©r
r
ú4/tmp/pip-build-gk9425m9/sphinx/sphinx/deprecation.pyr	src@seZdZdS)ÚRemovedInSphinx60WarningN)rrr	r
r
r
rr
sr)ÚmodnameÚobjectsÚwarningÚnamesÚreturncCs"t|ƒ}t|||||ƒtj|<dS)N)rÚ_ModuleWrapperÚsysÚmodules)r
rrrÚmoduler
r
rÚdeprecated_aliassrc@sHeZdZeeeeefeeeeefddœdd„Z	eedœdd„Z
dS)rN)rr
rrrrcCs"||_||_||_||_||_dS)N)Ú_moduleÚ_modnameÚ_objectsÚ_warningÚ_names)Úselfrr
rrrr
r
rÚ__init__s
z_ModuleWrapper.__init__)ÚnamercCsr||jkrt|j|ƒS|jj|dƒ}|dk	rLtjdj|j||ƒ|j	ddntjdj|j|ƒ|j	dd|j|S)Nz^The alias '{}.{}' is deprecated, use '{}' instead. Check CHANGES for Sphinx API modifications.é)Ú
stacklevelz@{}.{} is deprecated. Check CHANGES for Sphinx API modifications.)
rÚgetattrrrÚgetÚwarningsÚwarnÚformatrr)rrÚcanonical_namer
r
rÚ__getattr__&s

z_ModuleWrapper.__getattr__)rrr	rÚstrrÚobjectrÚWarningrr'r
r
r
rrs

rcsžeZdZdZeeeeddœ‡fdd„Zee	ddœ‡fdd„Z
dee	e	d	œ‡fd
d„
Zeddœ‡fd
d„Zdee	e	d	œ‡fdd„
Z
eddœ‡fdd„Z‡ZS)ÚDeprecatedDictz-A deprecated dict which warns on each access.N)ÚdataÚmessagerrcs||_||_tƒj|ƒdS)N)r-rÚsuperr)rr,r-r)Ú	__class__r
rr:szDeprecatedDict.__init__)ÚkeyÚvaluercs&tj|j|jddtƒj||ƒdS)Né)r )r#r$r-rr.Ú__setitem__)rr0r1)r/r
rr3?szDeprecatedDict.__setitem__)r0Údefaultrcs"tj|j|jddtƒj||ƒS)Nr2)r )r#r$r-rr.Ú
setdefault)rr0r4)r/r
rr5CszDeprecatedDict.setdefault)r0rcs tj|j|jddtƒj|ƒS)Nr2)r )r#r$r-rr.Ú__getitem__)rr0)r/r
rr6GszDeprecatedDict.__getitem__cs"tj|j|jddtƒj||ƒS)Nr2)r )r#r$r-rr.r")rr0r4)r/r
rr"KszDeprecatedDict.get)Úotherrcs$tj|j|jddtƒj|ƒdS)Nr2)r )r#r$r-rr.Úupdate)rr7)r/r
rr8OszDeprecatedDict.update)N)N)rrr	Ú__doc__rr(rr*rrr3r5r6r"r8Ú
__classcell__r
r
)r/rr+7sr+)r9rr#Ú	importlibrÚtypingrrrÚDeprecationWarningrÚPendingDeprecationWarningrZRemovedInNextVersionWarningr(r)r*rrÚdictr+r
r
r
rÚ<module>s.