
    2iu                        d Z ddlmZ ddlZddlmZ ddlmZmZ ddl	m
Z ddlmZ dd	lmZ erdd
lmZ  ej$                  d      Z G d d      Z G d de      Zy)z)
Psycopg Pipeline object implementation.
    )annotationsN)TracebackType)TYPE_CHECKINGAny   )errors)Self)BasePipeline)
Connectionpsycopgc                  ,    e Zd ZddZ	 	 	 	 	 	 	 	 ddZy)
_DummyLockc                     y N selfs    P/var/www/html/secretsanta/venv/lib/python3.12/site-packages/psycopg/_pipeline.py	__enter__z_DummyLock.__enter__   s        c                     y r   r   )r   exc_typeexc_valexc_tbs       r   __exit__z_DummyLock.__exit__   s     	r   NreturnNoner   ztype[BaseException] | Noner   zBaseException | Noner   zTracebackType | Noner   r   )__name__
__module____qualname__r   r   r   r   r   r   r      s2    , & %	
 
r   r   c                  ^     e Zd ZU dZdZded<   d	d
 fdZddZddZ	 	 	 	 	 	 	 	 ddZ xZ	S )Pipelinez/Handler for (sync) connection in pipeline mode.r   Connection[Any]_connc                j    t         |   |       |rt               | _        y |j                  | _        y r   )super__init__r   lock_lock)r   conn_no_lock	__class__s      r   r)   zPipeline.__init__.   s%    %-Z\
499
r   c                    	 | j                   5  | j                  j                  | j                                ddd       y# 1 sw Y   yxY w# t        j
                  $ r}|j                  d      d}~ww xY w)zkSync the pipeline, send any pending command and receive and process
        all available results.
        N)r+   r&   wait	_sync_gene_NO_TRACEBACKwith_traceback)r   exs     r   synczPipeline.sync2   s^    	* 2

 012 2 2 	*##D))	*s3   A *AA A
A 
A A6 A11A6c                    | j                   5  | j                  j                  | j                                d d d        | S # 1 sw Y   | S xY wr   )r+   r&   r0   
_enter_genr   s    r   r   zPipeline.__enter__<   s:    ZZ 	/JJOODOO-.	/	/s   *AAc                j   	 | j                   5  | j                  j                  | j                                d d d        | j                  |       y # 1 sw Y   xY w# t        $ r5}|rt
        j                  d| |       n|j                  d       Y d }~Wd }~ww xY w# | j                  |       w xY w)Nz error ignored terminating %r: %s)	r+   r&   r0   	_exit_gen	Exceptionloggerwarningr4   _exit)r   r   r   r   exc2s        r   r   zPipeline.__exit__A   s    
	  2

 012 JJw2 2 	0A4N))$// O	0 JJws?   A *AA AA 	B'+BB BB B2)F)r,   r%   r-   boolr   r   r   )r   r	   r   )
r    r!   r"   __doc____annotations__r)   r6   r   r   __classcell__)r.   s   @r   r$   r$   (   sK    9J=*
 ,  &  %	 
 
 r   r$   )rA   
__future__r   loggingtypesr   typingr   r    r   r2   _compatr	   _pipeline_baser
   
connectionr   	getLoggerr<   r   r$   r   r   r   <module>rM      sO    #   %   (&			9	% ) | ) r   