o
    ›¨Êh$  ã                   @   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   úI/var/www/html/env/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"    
ÿ
ÿ
ÿ
