https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/django/utils/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/django/utils/__pycache__/deprecation.cpython-310.pyc
o

3�aN�@s�ddlZddlZddlZddlmZGdd�de�ZGdd�de�ZeZ	Gdd�d�Z
Gd	d
�d
e�ZGdd�de�Z
Gd
d�d�ZdS)�N)�
sync_to_asyncc@�eZdZdS)�RemovedInDjango40WarningN��__name__�
__module__�__qualname__�r	r	�:/usr/lib/python3/dist-packages/django/utils/deprecation.pyr�rc@r)�RemovedInDjango41WarningNrr	r	r	r
rrrc@seZdZdd�Zdd�ZdS)�warn_about_renamed_methodcCs||_||_||_||_dS�N)�
class_name�old_method_name�new_method_name�deprecation_warning)�selfrrrrr	r	r
�__init__s
z"warn_about_renamed_method.__init__cs��fdd�}|S)Ncs.t�d�j�j�jf�jd��|i|��S)Nz(`%s.%s` is deprecated, use `%s` instead.�)�warnings�warnrrrr)�args�kwargs��frr	r
�wrappeds��z3warn_about_renamed_method.__call__.<locals>.wrappedr	)rrrr	rr
�__call__sz"warn_about_renamed_method.__call__N)rrrrrr	r	r	r
r
sr
cs$eZdZdZdZ�fdd�Z�ZS)�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	cs�t��||||�}t�|�D]U}|j}|jD]L}|d}|j�|�}	|d}
|j�|
�}|d}t|g|�R�}
|sV|	rVt	�
d|||
f|d�t||
|	�t|||
|	��|	sb|rbt|||
|��qq|S)Nr�rz&`%s.%s` method should be renamed `%s`.)�super�__new__�inspect�getmror�renamed_methods�__dict__�getr
rr�setattr)�cls�name�bases�attrs�	new_class�baser�renamed_methodr�
old_methodr�
new_methodr�wrapper��	__class__r	r
r!2s0
����zRenameMethodsBase.__new__)rrr�__doc__r$r!�
__classcell__r	r	r2r
r$srcseZdZ�fdd�Z�ZS)�DeprecationInstanceCheckcs(t�d|j|jf|jd�t��|�S)Nz%`%s` is deprecated, use `%s` instead.r)rrr�alternativerr �__instancecheck__)r�instancer2r	r
r8Ps
�z*DeprecationInstanceCheck.__instancecheck__)rrrr8r5r	r	r2r
r6Osr6csFeZdZdZdZd
�fdd�	Zdd�Zdd�Zd	d
�Zdd�Z	�Z
S)�MiddlewareMixinTNcs&|�|�||_|��t���dSr)�_get_response_none_deprecation�get_response�_async_checkr r�rr<r2r	r
r^s
zMiddlewareMixin.__init__cCst�|j�r
tjj|_dSdS)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�iscoroutinefunctionr<�
coroutines�
_is_coroutine)rr	r	r
r=ds�zMiddlewareMixin._async_checkcCsVt�|j�r|�|�Sd}t|d�r|�|�}|p|�|�}t|d�r)|�||�}|S)N�process_request�process_response)r?r@r<�	__acall__�hasattrrCrD�r�request�responser	r	r
rns



zMiddlewareMixin.__call__c�sd�d}t|d�rt|jdd�|�IdH}|p|�|�IdH}t|d�r0t|jdd�||�IdH}|S)zh
        Async version of __call__ that is swapped in when an async request
        is running.
        NrCT)�thread_sensitiverD)rFrrCr<rDrGr	r	r
rEzs$�
�
�
�
�zMiddlewareMixin.__acall__cCs |durtjdtdd�dSdS)NzDPassing None for the middleware get_response argument is deprecated.�)�
stacklevel)rrrr>r	r	r
r;�s
��z.MiddlewareMixin._get_response_none_deprecationr)rrr�sync_capable�
async_capablerr=rrEr;r5r	r	r2r
r:Xs
r:)r?r"r�asgiref.syncr�DeprecationWarningr�PendingDeprecationWarningr�RemovedInNextVersionWarningr
�typerr6r:r	r	r	r
�<module>s+	

https://t.me/RX1948 - 2025