
    P}bg                         d dl Z d dlZd dlZd dlmZ  G d de          Z G d de          ZeZ	 G d d          Z
 G d	 d
e          Z G d de          Z G d d          ZdS )    N)sync_to_asyncc                       e Zd ZdS )RemovedInDjango41WarningN__name__
__module____qualname__     k/home/e360mart.nyusoft.in/public_html/e360mart_env/lib/python3.11/site-packages/django/utils/deprecation.pyr   r              Dr   r   c                       e Zd ZdS )RemovedInDjango50WarningNr   r
   r   r   r   r      r   r   r   c                       e Zd Zd Zd ZdS )warn_about_renamed_methodc                 >    || _         || _        || _        || _        d S )N)
class_nameold_method_namenew_method_namedeprecation_warning)selfr   r   r   r   s        r   __init__z"warn_about_renamed_method.__init__   s'    $..#6   r   c                       fd}|S )Nc            	      |    t          j        dj        dj        dj        dj        d            | i |S )N`.` is deprecated, use `
` instead.   )warningswarnr   r   r   r   )argskwargsfr   s     r   wrappedz3warn_about_renamed_method.__call__.<locals>.wrapped   s]    MM$"6"6"68L8L8LN(!- - - 1d%f%%%r   r
   )r   r$   r%   s   `` r   __call__z"warn_about_renamed_method.__call__   s)    	& 	& 	& 	& 	& 	& r   N)r   r   r	   r   r&   r
   r   r   r   r      s2        7 7 7    r   r   c                   &     e Zd ZdZdZ fdZ x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                 ,   t                                          | |||          }t          j        |          D ]}|j        }| j        D ]}|d         }|j                            |          }	|d         }
|j                            |
          }|d         }t          |g|R  }|sM|	rKt          j
        d|d|d|
d|d           t          ||
|	           t          || ||	                     |	s|rt          || ||                     Ɍ|S )Nr      r   r   r   z` method should be renamed `z`.)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__s                 r   r,   zRenameMethodsBase.__new__2   sg   GGOOCue<<	N9-- 	H 	HDJ"%"5 H H"0"3!]..??
"0"3!]..??
&4Q&7#3JPPPP " Hj HMM#___oooG+Q0 0 0 D/:>>>D/77:3F3FGGG " Hj HD/77:3F3FGGG'H* r   )r   r   r	   __doc__r/   r,   __classcell__r=   s   @r   r(   r(   $   sI        	 	 O        r   r(   c                        e Zd Z fdZ xZS )DeprecationInstanceCheckc                     t          j        d| j        d| j        d| j        d           t                                          |          S )Nr   r   r   r   )r    r!   r   alternativer   r+   __instancecheck__)r   instancer=   s     r   rE   z*DeprecationInstanceCheck.__instancecheck__P   sR    7;}}}dFVFVFVW$a	
 	
 	
 ww((222r   )r   r   r	   rE   r?   r@   s   @r   rB   rB   O   s8        3 3 3 3 3 3 3 3 3r   rB   c                   >     e Zd ZdZdZ fdZd Zd Zd Zd Z	 xZ
S )MiddlewareMixinTc                     |t          d          || _        |                                  t                                                       d S )Nzget_response must be provided.)
ValueErrorget_response_async_checkr+   r   )r   rK   r=   s     r   r   zMiddlewareMixin.__init__\   sN    =>>>(r   c                 n    d| j         j        dt          | j        d| j        j         j                  dS )N<z get_response=r	   >)r=   r	   getattrrK   r   r   s    r   __repr__zMiddlewareMixin.__repr__c   sH     N'''!!+4   
 	
r   c                 h    t          j        | j                  rt           j        j        | _        dS dS )z
        If get_response is a coroutine function, turns us into async mode so
        a thread is not consumed during a whole request.
        N)asyncioiscoroutinefunctionrK   
coroutines_is_coroutinerQ   s    r   rL   zMiddlewareMixin._async_checkm   s=    
 &t'899 	B ")!3!AD	B 	Br   c                 *   t          j        | j                  r|                     |          S d }t	          | d          r|                     |          }|p|                     |          }t	          | d          r|                     ||          }|S )Nprocess_requestprocess_response)rT   rU   rK   	__acall__hasattrrY   rZ   r   requestresponses      r   r&   zMiddlewareMixin.__call__w   s    &t'899 	+>>'***4*++ 	5++G44H9t00994+,, 	@,,Wh??Hr   c                   K   d}t          | d          r% t          | j        d          |           d{V }|p|                     |           d{V }t          | d          r& t          | j        d          ||           d{V }|S )zh
        Async version of __call__ that is swapped in when an async request
        is running.
        NrY   T)thread_sensitiverZ   )r\   r   rY   rK   rZ   r]   s      r   r[   zMiddlewareMixin.__acall__   s     
 4*++ 	]$!%          H ?T%6%6w%?%???????4+,, 	!]%!%   x! ! ! ! ! ! ! !H r   )r   r   r	   sync_capableasync_capabler   rR   rL   r&   r[   r?   r@   s   @r   rH   rH   X   s        LM    
 
 
B B B
 
 
      r   rH   )rT   r-   r    asgiref.syncr   DeprecationWarningr   PendingDeprecationWarningr   RemovedInNextVersionWarningr   typer(   rB   rH   r
   r   r   <module>ri      s?      & & & & & &	 	 	 	 	1 	 	 		 	 	 	 	8 	 	 	 7        "( ( ( ( ( ( ( (V3 3 3 3 3t 3 3 3< < < < < < < < < <r   