
    yIf                       d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 dd	lm
Z
 dd
lZddlmZ ddlmZ ddlmZ ddlmZ e
e	ed
ee         d
f         ef         ed
eef         f         Zd&dZd'dZd(d%Zd
S ))z
Call loop machinery
    )annotations)cast)	Generator)Mapping)NoReturn)Sequence)Tuple)UnionN   )HookImpl)HookCallError)Result)PluggyTeardownRaisedWarningwrap_controllerGGenerator[None, Result[object], None] | Generator[None, object, object]msgstrreturnr   c                Z    | j         }t          d|j        |j        |j        |fz            )Nzwrap_controller at %r %s:%d %s)gi_codeRuntimeErrorco_nameco_filenameco_firstlineno)r   r   cos      C/var/www/piapp/venv/lib/python3.11/site-packages/pluggy/_callers.py_raise_wrapfailr      s9     
	 B
(:r~r'8#
>	?      	hook_name	hook_implr   eBaseExceptionNonec                    d}|d|j          d|  dz  }|t          |          j         d| dz  }|dz  }t          j        t          |          d           d S )	NzGA plugin raised an exception during an old-style hookwrapper teardown.
zPlugin: z, Hook: 
z: zvFor more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning   )
stacklevel)plugin_nametype__name__warningswarnr   )r   r    r!   r   s       r   _warn_teardown_exceptionr-   +   s     UCBi+BBYBBBBCd1gg''!''''C  D  DCM-c22qAAAAAAr   
hook_implsSequence[HookImpl]caller_kwargsMapping[str, object]firstresultboolobject | list[object]c           	        d}g }d}d}	 g }	 t          |          D ]w}		 fd|	j        D             }
n0# t          $ r# |	j        D ]}|vrt          d|          Y nw xY w|	j        rd}	  |	j        |
 }t          t          dt          t                   df         |          }t          |           |                    ||	f           # t          $ r t          |d           Y w xY w|	j        rz	  |	j        |
 }t          t          dt          t          f         |          }t          |           |                    |           1# t          $ r t          |d           Y Nw xY w |	j        |
 }||                    |           |r nyn# t          $ r}|}Y d}~nd}~ww xY w|r|r|r|d         nd}n|}t          |          D ]}	 ||                    |           n|                    |           |                                 n4# t          $ r}|j        }d}Y d}~]d}~wt          $ r}|}Y d}~qd}~ww xY wt          |d           ||                    |j                  |S |rt          |r|d         nd|          }nt          ||          }t          |          D ];}t-          |t.                    rh	 |d                             |           t          |d         d           K# t          $ r Y Wt          $ r}t1          | |d	         |            d}~ww xY w	 |j        |                    |j                   n|                    |j                   |                                 nY# t          $ r$}|                    |j                   Y d}~d}~wt          $ r }|                    |           Y d}~#d}~ww xY wt          |d           =|                                S # |r|r|r|d         nd}n|}t          |          D ]}	 ||                    |           n|                    |           |                                 n4# t          $ r}|j        }d}Y d}~]d}~wt          $ r}|}Y d}~qd}~ww xY wt          |d           ||                    |j                  |c cY S |rt          |r|d         nd|          }nt          ||          }t          |          D ];}t-          |t.                    rh	 |d                             |           t          |d         d           K# t          $ r Y Wt          $ r}t1          | |d	         |            d}~ww xY w	 |j        |                    |j                   n|                    |j                   |                                 nY# t          $ r$}|                    |j                   Y d}~d}~wt          $ r }|                    |           Y d}~#d}~ww xY wt          |d           =|                                c cY S xY w)
zExecute a call into multiple python functions/methods and return the
    result(s).

    ``caller_kwargs`` comes from HookCaller.__call__().
    TNc                     g | ]
}|         S  r7   ).0argnamer0   s     r   
<listcomp>z_multicall.<locals>.<listcomp>I   s    UUUwM'2UUUr   z hook call must provide argument Fzdid not yieldr   zhas second yieldr   )reversedargnamesKeyErrorr   hookwrapperfunctionr   r   r   objectnextappendStopIterationr   wrapperr"   throwsendclosevaluewith_traceback__traceback__
isinstancetupler-   
_exception_resultforce_resultforce_exception
get_result)r   r.   r0   r2   __tracebackhide__results	exceptiononly_new_style_wrappers	teardownsr    argsr9   reswrapper_genfunction_genexcresultteardownsir!   outcomes     `                  r   
_multicallr`   5   s    GI"r($&	'	%j11 $" $"	UUUU)BTUUUDD   #,#5  "-77"/ N7 N N# #  8  ( ".3+F 1i0$7&*9T6&>45O+PRU&V&V[)))!((+y)ABBBB( F F F'_EEEEEF& "G 1i0$7'+IdFF6J,KS'Q'Q\***!((6666( G G G'oFFFFFG -),d3Cs+++& "!E 	 	 	IIIIII	 # F	( !'.8D  %Y// > > , y1111 f--- NN$$$$$   XF $IHHHH$    !IHHHH  *<====$..y/FGGG  59?")3GAJJtY: : !)44 %Y// B Bh.. BI ((111 (5GHHHH )   (   0HQKKKK!"-9$NN7+=>>>>$MM'/::: !((((( ! ! !,,RX666 ( ! ! !//222 ! $H.@AAAA%%'''M # F	( !'.8D  %Y// > > , y1111 f--- NN$$$$$   XF $IHHHH$    !IHHHH  *<====$..y/FGGG  59?")3GAJJtY: : !)44 %Y// B Bh.. BI ((111 (5GHHHH )   (   0HQKKKK!"-9$NN7+=>>>>$MM'/::: !((((( ! ! !,,RX666 ( ! ! !//222 ! $H.@AAAA%%''''''''''s  P F 5F *A"F !A""F /ACF C+(F *C++
F 6AEF E,(F +E,,*F P 
F-!F(#P (F--P AH
I!	H//I<IIL
L3	L3L..L37AN
ON11O>OO%Y'-AQ/.Y'/
R 	9	R	Y'R 	R	Y'R 	 4Y'AY'+UY'
V	'Y')	V	2V
	
V	Y'AW$#Y'$
X:	.X	Y'X:	X5	/Y'5X:	:+Y')r   r   r   r   r   r   )r   r   r    r   r!   r"   r   r#   )
r   r   r.   r/   r0   r1   r2   r3   r   r4   )__doc__
__future__r   typingr   r   r   r   r   r	   r
   r+   _hooksr   rN   r   r   	_warningsr   r@   Teardownr   r-   r`   r7   r   r   <module>rg      s    # " " " " "                                                  " " " " " "       2 2 2 2 2 2
 	)D&.$.
/
9:dFF"#%
 
 
 
B B B BA( A( A( A( A( A(r   