
    <"ri                         d dl mZmZmZ erd dlmZ d dlmZ 	 d dlZdZ	 ed      Zd Z G d	 d
      Zededefd       Zededefd       ZdedefdZdedefdZy# e
$ r dZ	Y Iw xY w)    )TYPE_CHECKINGTypeVaroverloadRedis)PipelineNTF_Tc                 4    ddl m}  |j                  | fi |S )z
    Returns an active Redis client generated from the given database URL.

    Will attempt to extract the database id from the path url fragment, if
    none is provided.
    r   r   )aioredis.clientr   from_url)urlkwargsr   s      V/var/www/fortnox.pascalinesoft.com/venv/lib/python3.12/site-packages/aioredis/utils.pyr   r      s     &5>>#(((    c                   "    e Zd ZddZddZd Zy)pipelinec                 .    |j                         | _        y N)r   p)self	redis_objs     r   __init__zpipeline.__init__    s    &//1r   c                 "   K   | j                   S wr   )r   )r   s    r   
__aenter__zpipeline.__aenter__#   s     vvs   c                 X   K   | j                   j                          d {    | ` y 7 wr   )r   execute)r   exc_typeexc_valexc_tbs       r   	__aexit__zpipeline.__aexit__&   s$     ffnnF 	s   *(*N)r   r   )returnr   )__name__
__module____qualname__r   r   r     r   r   r   r      s    2r   r   valuer!   c                      y r   r%   r&   s    r   str_if_bytesr)   ,       r   c                      y r   r%   r(   s    r   r)   r)   1   r*   r   c                 L    t        | t              r| j                  dd      S | S )Nzutf-8replace)errors)
isinstancebytesdecoder(   s    r   r)   r)   6   s(    3=eU3KWY/QVr   c                 *    t        t        |             S r   )strr)   r(   s    r   safe_strr4   <   s    |E"##r   )typingr   r   r   aioredisr   r   r   hiredisHIREDIS_AVAILABLEImportErrorr	   r   r   r0   r3   r)   objectr4   r%   r   r   <module>r;      s    3 3(
 T]	)	 	 
 #  
 
 r  
 6 $F $s $a  s   A   A*)A*