AlkantarClanX12

Your IP : 18.117.103.185


Current Path : /opt/alt/python37/lib/python3.7/site-packages/raven/transport/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/raven/transport/__pycache__/twisted.cpython-37.pyc

B

��Y	�@s�dZddlmZddlmZddlmZddlmZy0ddl	m
Z
mZmZm
Z
mZddlmZdZWnek
r|d	ZYnXGd
d�dee�ZdS)
z�
raven.transport.twisted
~~~~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
�)�absolute_import)�BytesIO)�AsyncTransport)�
HTTPTransport)�Agent�FileBodyProducer�HTTPConnectionPool�ResponseNeverReceived�readBody)�HeadersTFcs,eZdZddgZ�fdd�Zdd�Z�ZS)�TwistedHTTPTransportztwisted+httpz
twisted+httpscs@tstd��tt|�j||�ddlm}t|t|�d�|_	dS)Nz*TwistedHTTPTransport requires twisted.web.r)�reactor)�pool)
�has_twisted�ImportError�superr�__init__Ztwisted.internetr
rr�_agent)�self�args�kwargsr
)�	__class__��H/opt/alt/python37/lib/python3.7/site-packages/raven/transport/twisted.pyrs
zTwistedHTTPTransport.__init__c		s`|jjd|tt|��ttdd�|��D���d�}�fdd�}��fdd�}|�|��|�dS)	NsPOSTcss|]\}}||gfVqdS)Nr)�.0�k�vrrr�	<genexpr>-sz2TwistedHTTPTransport.async_send.<locals>.<genexpr>)ZbodyProducer�headerscs4|�t�}|r&�dd�|jjD��n
�|j�dS)NcSsg|]
}|j�qSr)�value)r�frrr�
<listcomp>4szGTwistedHTTPTransport.async_send.<locals>.on_failure.<locals>.<listcomp>)�checkr	rZreasons)Zfailure�ex)�
failure_cbrr�
on_failure0s
z3TwistedHTTPTransport.async_send.<locals>.on_failurecs2�jdkr��n��fdd�}t���|�SdS)z�
            Success only means that the request succeeded, *not* that the
            actual submission was successful.
            ��cs�t�j�j|��dS)N)�	Exception�code�phrase)�body)r$�responserr�
on_error_body@szJTwistedHTTPTransport.async_send.<locals>.on_success.<locals>.on_error_bodyN)r(r
�addCallback)r+r,)r$�
success_cb)r+r�
on_success8s

z3TwistedHTTPTransport.async_send.<locals>.on_success)	rZrequestrrr�dict�itemsr-Z
addErrback)	r�url�datarr.r$�dr%r/r)r$r.r�
async_send)s
zTwistedHTTPTransport.async_send)�__name__�
__module__�__qualname__�schemerr5�
__classcell__rr)rrrsrN)�__doc__�
__future__rZraven.utils.compatrZraven.transport.baserZraven.transport.httprZtwisted.web.clientrrrr	r
Ztwisted.web.http_headersrrrrrrrr�<module>s