
    <6h                     J   d dl Z d dlZd dlmZ ej                  r
d dlZd dlmZ  G d de j                        Zej                  eej                  dgef   f   Z G d de      Z G d	 d
e      Z G d de      Z e       Z G d de      Z G d de      Z G d de      Zy)    N)_utils)RetryCallStatec                   N    e Zd ZdZej
                  dddefd       Zd	dZd
dZ	y)	stop_basez(Abstract base class for stop strategies.retry_stater   returnc                      y N selfr   s     ^/var/www/panel.atabookie.online/venv/lib/python3.12/site-packages/pip/_vendor/tenacity/stop.py__call__zstop_base.__call__   s        c                     t        | |      S r
   )stop_allr   others     r   __and__zstop_base.__and__"       e$$r   c                     t        | |      S r
   )stop_anyr   s     r   __or__zstop_base.__or__%   r   r   N)r   r   r   r   )r   r   r   r   )
__name__
__module____qualname____doc__abcabstractmethodboolr   r   r   r   r   r   r   r      s6    2$4   %%r   r   r   c                   0    e Zd ZdZdeddfdZdddefdZy)	r   z+Stop if any of the stop condition is valid.stopsr   Nc                     || _         y r
   r"   r   r"   s     r   __init__zstop_any.__init__/   	    
r   r   r   c                 @    t        fd| j                  D              S )Nc              3   .   K   | ]  } |        y wr
   r   .0xr   s     r   	<genexpr>z$stop_any.__call__.<locals>.<genexpr>3        6a1[>6   )anyr"   r   s    `r   r   zstop_any.__call__2       64::666r   r   r   r   r   r   r&   r    r   r   r   r   r   r   ,   s,    5y T 7$4 7 7r   r   c                   0    e Zd ZdZdeddfdZdddefdZy)	r   z*Stop if all the stop conditions are valid.r"   r   Nc                     || _         y r
   r$   r%   s     r   r&   zstop_all.__init__9   r'   r   r   r   c                 @    t        fd| j                  D              S )Nc              3   .   K   | ]  } |        y wr
   r   r*   s     r   r-   z$stop_all.__call__.<locals>.<genexpr>=   r.   r/   )allr"   r   s    `r   r   zstop_all.__call__<   r1   r   r2   r   r   r   r   r   6   s,    4y T 7$4 7 7r   r   c                        e Zd ZdZdddefdZy)_stop_neverzNever stop.r   r   r   c                      y)NFr   r   s     r   r   z_stop_never.__call__C   s    r   N)r   r   r   r   r    r   r   r   r   r9   r9   @   s    $4  r   r9   c                   (    e Zd ZdZddZdddefdZy)	stop_when_event_setz!Stop when the given event is set.r   Nc                     || _         y r
   )event)r   r>   s     r   r&   zstop_when_event_set.__init__M   r'   r   r   r   c                 6    | j                   j                         S r
   )r>   is_setr   s     r   r   zstop_when_event_set.__call__P   s    zz  ""r   )r>   zthreading.Eventr   N)r   r   r   r   r&   r    r   r   r   r   r<   r<   J   s    +#$4 # #r   r<   c                   0    e Zd ZdZdeddfdZdddefdZy)	stop_after_attemptz.Stop when the previous attempt >= max_attempt.max_attempt_numberr   Nc                     || _         y r
   )rC   )r   rC   s     r   r&   zstop_after_attempt.__init__W   s
    "4r   r   r   c                 4    |j                   | j                  k\  S r
   )attempt_numberrC   r   s     r   r   zstop_after_attempt.__call__Z   s    ))T-D-DDDr   )r   r   r   r   intr&   r    r   r   r   r   rB   rB   T   s/    853 54 5E$4 E Er   rB   c                   D    e Zd ZdZdej
                  ddfdZdddefdZy)	stop_after_delayz3Stop when the time from the first attempt >= limit.	max_delayr   Nc                 8    t        j                  |      | _        y r
   )r   
to_secondsrJ   )r   rJ   s     r   r&   zstop_after_delay.__init__a   s    **95r   r   r   c                 b    |j                   t        d      |j                   | j                  k\  S )Nz4__call__() called but seconds_since_start is not set)seconds_since_startRuntimeErrorrJ   r   s     r   r   zstop_after_delay.__call__d   s/    **2UVV..$..@@r   )	r   r   r   r   r   time_unit_typer&   r    r   r   r   r   rI   rI   ^   s5    =6&"7"7 6D 6A$4 A Ar   rI   )r   typingpip._vendor.tenacityr   TYPE_CHECKING	threadingr   ABCr   UnionCallabler    	StopBaseTr   r   r9   
stop_neverr<   rB   rI   r   r   r   <module>rZ      s       '	3% % LLFOO5E4F4L$MMN	7y 77y 7)  ]
#) #E E	Ay 	Ar   