o
    †4]  ã                   @   s>   zd dl mZ W n ey   d dlmZ Y nw ddd„ZdS )é    )ÚquoteFTc                 C   sÖ   dd| j fg}t| j ¡ ƒD ]\}}|dd ||¡fg7 }q| jr5| j}t|tƒr.| d¡}|d|fg7 }|r<|dg7 }|sC|dg7 }|d	| j	fg7 }g }|D ]\}}|r\| 
t|ƒ¡ |re| 
t|ƒ¡ qOd
 |¡S )zÁ
    Returns string with curl command by provided request object

    Parameters
    ----------
    compressed : bool
        If `True` then `--compressed` argument will be added to result
    )ÚcurlNz-Xz-Hz{0}: {1}zutf-8z-d)z--compressedN)z
--insecureNNú )ÚmethodÚsortedÚheadersÚitemsÚformatÚbodyÚ
isinstanceÚbytesÚdecodeÚurlÚappendr   Újoin)ÚrequestÚ
compressedÚverifyÚpartsÚkÚvr
   Ú
flat_parts© r   úE/home/ubuntu/transcripts/venv/lib/python3.10/site-packages/curlify.pyÚto_curl   s.   
þ



€
r   N)FT)Úshlexr   ÚImportErrorÚpipesr   r   r   r   r   Ú<module>   s   ÿ