o
    Df$                     @   sp   d Z ddlZddlmZ ddlmZmZ dZdZdZ			dd	d
Z
		dddZ		dddZG dd dZdS )zDeprecation utilities.    Nwraps)CDeprecationWarningCPendingDeprecationWarning)CallablePropertywarnz
    {description} is scheduled for deprecation in     version {deprecation} and removal in version v{removal}.     {alternative}
zc
    {description} is deprecated and scheduled for removal in
    version {removal}. {alternative}
   c                 C   sR   | |||d}|durt tjdi |}n
ttjdi |}tj||d dS )zWarn of (pending) deprecation.)descriptiondeprecationremovalalternativeN)
stacklevel )r   PENDING_DEPRECATION_FMTformatr   DEPRECATION_FMTwarningsr   )r
   r   r   r   r   ctxwr   r   P/home/ubuntu/webapp/venv/lib/python3.10/site-packages/celery/utils/deprecated.pyr      s   r   c                        fdd}|S )a  Decorator for deprecated functions.

    A deprecation warning will be emitted when the function is called.

    Arguments:
        deprecation (str): Version that marks first deprecation, if this
            argument isn't set a ``PendingDeprecationWarning`` will be
            emitted instead.
        removal (str): Future version when this feature will be removed.
        alternative (str): Instructions for an alternative solution (if any).
        description (str): Description of what's being deprecated.
    c                    s    t   fdd}|S )Nc                     s4   ddl m} tp| dd | i |S )N   )qualname   )r
   r   r   r   r   )importsr   r   )argskwargsr   )r   r   r
   funr   r   r   __inner4   s   z)Callable.<locals>._inner.<locals>.__innerr   )r   r   r   r   r
   r   r   r   _inner2   s   zCallable.<locals>._innerr   r   r   r   r
   r"   r   r    r   r   $   s   r   c                    r   )z$Decorator for deprecated properties.c                    s   t |  p	| jdS )N)r   r   r   r
   )_deprecated_property__name__r!   r    r   r   r"   D   s   
zProperty.<locals>._innerr   r#   r   r    r   r   A   s   r   c                   @   s@   e Zd ZdddZdddZdd Zdd	 Zd
d Zdd ZdS )r$   Nc                 K   sF   || _ || _|| _|j|j|j| _| _| _|| _| jdd d S )Nr   r   )_deprecated_property__get_deprecated_property__set_deprecated_property__delr%   
__module____doc__	depreinfo
setdefault)selffgetfsetfdeldocr+   r   r   r   __init__M   s   z_deprecated_property.__init__c                 C   s&   |d u r| S t di | j | |S )Nr   )r   r+   r&   )r-   objtyper   r   r   __get__W   s   
z_deprecated_property.__get__c                 C   s>   |d u r| S | j d u rtdtdi | j |  || d S )Nzcannot set attributer   )r'   AttributeErrorr   r+   )r-   r3   valuer   r   r   __set__]   s   
z_deprecated_property.__set__c                 C   s<   |d u r| S | j d u rtdtdi | j |  | d S )Nzcannot delete attributer   )r(   r6   r   r+   )r-   r3   r   r   r   
__delete__e   s   
z_deprecated_property.__delete__c                 C   s   | j | j|| jfi | jS N)	__class__r&   r(   r+   )r-   r/   r   r   r   setterm      z_deprecated_property.setterc                 C   s   | j | j| j|fi | jS r:   )r;   r&   r'   r+   )r-   r0   r   r   r   deleterp   r=   z_deprecated_property.deleterNNNNr:   )	r%   r)   __qualname__r2   r5   r8   r9   r<   r>   r   r   r   r   r$   K   s    


r$   )NNNNr	   r?   )r*   r   
vine.utilsr   celery.exceptionsr   r   __all__r   r   r   r   r   r$   r   r   r   r   <module>   s"    



