o
    :Zœc  ã                   @   st   d dl Z d dlZG dd„ deƒZG dd„ deƒZeZG dd„ dƒZG dd	„ d	eƒZ	G d
d„ deƒZ
G dd„ dƒZdS )é    Nc                   @   ó   e Zd ZdS )ÚRemovedInDjango31WarningN©Ú__name__Ú
__module__Ú__qualname__© r   r   úN/var/www/chikooza/env/lib/python3.10/site-packages/django/utils/deprecation.pyr      ó    r   c                   @   r   )ÚRemovedInDjango40WarningNr   r   r   r   r	   r   	   r
   r   c                   @   s   e Zd Zdd„ Zdd„ ZdS )Úwarn_about_renamed_methodc                 C   s   || _ || _|| _|| _d S ©N)Ú
class_nameÚold_method_nameÚnew_method_nameÚdeprecation_warning)Úselfr   r   r   r   r   r   r	   Ú__init__   s   
z"warn_about_renamed_method.__init__c                    s   ‡ ‡fdd„}|S )Nc                     s.   t  dˆjˆjˆjf ˆjd¡ ˆ | i |¤ŽS )Nz(`%s.%s` is deprecated, use `%s` instead.é   )ÚwarningsÚwarnr   r   r   r   )ÚargsÚkwargs©Úfr   r   r	   Úwrapped   s   ÿýz3warn_about_renamed_method.__call__.<locals>.wrappedr   )r   r   r   r   r   r	   Ú__call__   s   z"warn_about_renamed_method.__call__N)r   r   r   r   r   r   r   r   r	   r      s    r   c                       s$   e Zd ZdZdZ‡ fdd„Z‡  ZS )ÚRenameMethodsBasea#  
    Handles the deprecation paths when renaming a method.

    It does the following:
        1) Define the new method if missing and complain about it.
        2) Define the old method if missing.
        3) Complain whenever an old method is called.

    See #15363 for more details.
    r   c                    sÌ   t ƒ  | |||¡}t |¡D ]U}|j}| jD ]L}|d }|j |¡}	|d }
|j |
¡}|d }t|g|¢R Ž }|sV|	rVt	 
d|||
f |d¡ t||
|	ƒ t||||	ƒƒ |	sb|rbt||||ƒƒ qq|S )Nr   é   r   z&`%s.%s` method should be renamed `%s`.)ÚsuperÚ__new__ÚinspectÚgetmror   Úrenamed_methodsÚ__dict__Úgetr   r   r   Úsetattr)ÚclsÚnameÚbasesÚattrsÚ	new_classÚbaser   Úrenamed_methodr   Ú
old_methodr   Ú
new_methodr   Úwrapper©Ú	__class__r   r	   r    /   s0   
ÿý€ízRenameMethodsBase.__new__)r   r   r   Ú__doc__r#   r    Ú__classcell__r   r   r1   r	   r   !   s    r   c                       s   e Zd Z‡ fdd„Z‡  ZS )ÚDeprecationInstanceCheckc                    s(   t  d| j| jf | jd¡ tƒ  |¡S )Nz%`%s` is deprecated, use `%s` instead.r   )r   r   r   Úalternativer   r   Ú__instancecheck__)r   Úinstancer1   r   r	   r7   M   s
   þz*DeprecationInstanceCheck.__instancecheck__)r   r   r   r7   r4   r   r   r1   r	   r5   L   s    r5   c                       s&   e Zd Zd‡ fdd„	Zdd„ Z‡  ZS )ÚMiddlewareMixinNc                    s   || _ tƒ  ¡  d S r   )Úget_responser   r   )r   r:   r1   r   r	   r   V   s   zMiddlewareMixin.__init__c                 C   s@   d }t | dƒr|  |¡}|p|  |¡}t | dƒr|  ||¡}|S )NÚprocess_requestÚprocess_response)Úhasattrr;   r:   r<   )r   ÚrequestÚresponser   r   r	   r   Z   s   


zMiddlewareMixin.__call__r   )r   r   r   r   r   r4   r   r   r1   r	   r9   U   s    r9   )r!   r   ÚDeprecationWarningr   ÚPendingDeprecationWarningr   ÚRemovedInNextVersionWarningr   Útyper   r5   r9   r   r   r   r	   Ú<module>   s    +	