o
    svXj£  ã                   @   sf   d Z ddlmZmZ ddlZddlmZmZ dgZeej	ƒG dd„ deƒƒZ
e
jG dd	„ d	eƒƒZdS )
zAbstract classes.é    )Úabsolute_importÚunicode_literalsNé   )Úwith_metaclassÚCallableÚThenablec                   @   sZ   e Zd ZdZdZejddd„ƒZejddd„ƒZejd	d
„ ƒZ	e
dd„ ƒZe
dd„ ƒZdS )r   z!Object that supports ``.then()``.© Nc                 C   ó   t ƒ ‚©N©ÚNotImplementedError©ÚselfÚ
on_successÚon_errorr   r   úJ/var/www/html/myproject/venv/lib/python3.10/site-packages/vine/abstract.pyÚthen   ó   zThenable.thenTc                 C   r	   r
   r   ©r   ÚexcÚtbÚ	propagater   r   r   Úthrow   r   zThenable.throwc                 C   r	   r
   r   ©r   r   r   r   Úcancel   r   zThenable.cancelc                 C   s$   | t u rtdd„ |jD ƒƒrdS tS )Nc                 s   s   � | ]}d |j v V  qdS )r   N)Ú__dict__)Ú.0ÚBr   r   r   Ú	<genexpr>    s   € z,Thenable.__subclasshook__.<locals>.<genexpr>T)r   ÚanyÚ__mro__ÚNotImplemented)ÚclsÚCr   r   r   Ú__subclasshook__   s   zThenable.__subclasshook__c                 C   s   t | ƒ | |¡ |S r
   )ÚtypeÚregister)r"   Úotherr   r   r   r&   $   s   zThenable.registerr
   ©NNT)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__ÚabcÚabstractmethodr   r   r   Úclassmethodr$   r&   r   r   r   r   r      s    

c                   @   sb   e Zd ZdZdd„ Zddd„Zdd„ Zdd	d
„Zddd„Ze	dd„ ƒZ
e	dd„ ƒZe	dd„ ƒZdS )ÚThenableProxyz*Proxy to object that supports ``.then()``.c                 C   s
   || _ d S r
   )Ú_p)r   Úpr   r   r   Ú_set_promise_target/   ó   
z!ThenableProxy._set_promise_targetNc                 C   s   | j  ||¡S r
   )r2   r   r   r   r   r   r   2   s   zThenableProxy.thenc                 C   s
   | j  ¡ S r
   )r2   r   r   r   r   r   r   5   r5   zThenableProxy.cancelc                 C   s   | j  |¡S r
   )r2   Úthrow1)r   r   r   r   r   r6   8   s   zThenableProxy.throw1Tc                 C   s   | j j|||d�S )N)r   r   )r2   r   r   r   r   r   r   ;   s   zThenableProxy.throwc                 C   ó   | j jS r
   )r2   Ú	cancelledr   r   r   r   r8   >   ó   zThenableProxy.cancelledc                 C   r7   r
   )r2   Úreadyr   r   r   r   r:   B   r9   zThenableProxy.readyc                 C   r7   r
   )r2   Úfailedr   r   r   r   r;   F   r9   zThenableProxy.failedr
   r(   )r)   r*   r+   r,   r4   r   r   r6   r   Úpropertyr8   r:   r;   r   r   r   r   r1   +   s    




r1   )r,   Ú
__future__r   r   r.   Úfiver   r   Ú__all__ÚABCMetar   r&   Úobjectr1   r   r   r   r   Ú<module>   s    