[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.224.70.239: ~ $


���Z��@s�dZddlZddlmZmZd
ZGdd�d�ZGdd�d�Zee�Gd	d
�d
e��Zee�Gdd�de��Z	dS)al Payload implemenation for coroutines as data provider.

As a simple case, you can upload data from file::

   @aiohttp.streamer
   async def file_sender(writer, file_name=None):
      with open(file_name, 'rb') as f:
          chunk = f.read(2**16)
          while chunk:
              await writer.write(chunk)

              chunk = f.read(2**16)

Then you can use `file_sender` like this:

    async with session.post('http://httpbin.org/post',
                            data=file_sender(file_name='huge_file')) as resp:
        print(await resp.text())

..note:: Coroutine must accept `writer` as first argument

�N�)�Payload�payload_type�streamerc@s(eZdZdd�Zdd�ZdS)�_stream_wrappercCs(tj|�|_||_||_dS)N)�asyncio�	coroutine�coro�args�kwargs)�selfr	r
r�r
�/payload_streamer.py�__init__"s	z_stream_wrapper.__init__c�s"|j||j|j�IdHdS)N)r	r
r)r�writerr
r
r�__call__'sz_stream_wrapper.__call__N)�__name__�
__module__�__qualname__rrr
r
r
rr src@s(eZdZdd�Zdd�ZdS)rcCs
||_dS)N)r	)rr	r
r
rr-szstreamer.__init__cOst|j||�S)N)rr	)rr
rr
r
rr0szstreamer.__call__N)rrrrrr
r
r
rr+sc@seZdZdd�ZdS)�StreamWrapperPayloadc�s|j|�IdHdS)N)�_value)rrr
r
r�write7szStreamWrapperPayload.writeN)rrrrr
r
r
rr4srcs.eZdZ�fdd�Zdd�Z�S)�
StreamPayloadcst�j|�||�dS)N)�superr)r�valuer
r)�	__class__r
rr>szStreamPayload.__init__c�s|j|�IdHdS)N)r)rrr
r
rrAszStreamPayload.write)rrrrrr
r
)rrr;sr)r)
�__doc__rZpayloadrr�__all__rrrrr
r
r
r�<module>s	

Filemanager

Name Type Size Permission Actions
__init__.cpython-35.opt-1.pyc File 947 B 0644
__init__.cpython-35.pyc File 947 B 0644
abc.cpython-35.opt-1.pyc File 6.08 KB 0644
abc.cpython-35.pyc File 6.08 KB 0644
client.cpython-35.opt-1.pyc File 22.11 KB 0644
client.cpython-35.pyc File 22.11 KB 0644
client_exceptions.cpython-35.opt-1.pyc File 8.04 KB 0644
client_exceptions.cpython-35.pyc File 8.04 KB 0644
client_proto.cpython-35.opt-1.pyc File 5.01 KB 0644
client_proto.cpython-35.pyc File 5.01 KB 0644
client_reqrep.cpython-35.opt-1.pyc File 23.56 KB 0644
client_reqrep.cpython-35.pyc File 23.69 KB 0644
client_ws.cpython-35.opt-1.pyc File 8.09 KB 0644
client_ws.cpython-35.pyc File 8.09 KB 0644
connector.cpython-35.opt-1.pyc File 24.95 KB 0644
connector.cpython-35.pyc File 24.95 KB 0644
cookiejar.cpython-35.opt-1.pyc File 8.4 KB 0644
cookiejar.cpython-35.pyc File 8.4 KB 0644
formdata.cpython-35.opt-1.pyc File 4.19 KB 0644
formdata.cpython-35.pyc File 4.19 KB 0644
frozenlist.cpython-35.opt-1.pyc File 2.73 KB 0644
frozenlist.cpython-35.pyc File 2.73 KB 0644
hdrs.cpython-35.opt-1.pyc File 3.72 KB 0644
hdrs.cpython-35.pyc File 3.72 KB 0644
helpers.cpython-35.opt-1.pyc File 24.01 KB 0644
helpers.cpython-35.pyc File 24.01 KB 0644
http.cpython-35.opt-1.pyc File 1.26 KB 0644
http.cpython-35.pyc File 1.26 KB 0644
http_exceptions.cpython-35.opt-1.pyc File 3.55 KB 0644
http_exceptions.cpython-35.pyc File 3.55 KB 0644
http_parser.cpython-35.opt-1.pyc File 14.1 KB 0644
http_parser.cpython-35.pyc File 14.16 KB 0644
http_websocket.cpython-35.opt-1.pyc File 13.92 KB 0644
http_websocket.cpython-35.pyc File 14.01 KB 0644
http_writer.cpython-35.opt-1.pyc File 4.06 KB 0644
http_writer.cpython-35.pyc File 4.06 KB 0644
locks.cpython-35.opt-1.pyc File 1.39 KB 0644
locks.cpython-35.pyc File 1.39 KB 0644
log.cpython-35.opt-1.pyc File 409 B 0644
log.cpython-35.pyc File 409 B 0644
multipart.cpython-35.opt-1.pyc File 25.14 KB 0644
multipart.cpython-35.pyc File 25.59 KB 0644
payload.cpython-35.opt-1.pyc File 9.29 KB 0644
payload.cpython-35.pyc File 9.42 KB 0644
payload_streamer.cpython-35.opt-1.pyc File 2.58 KB 0644
payload_streamer.cpython-35.pyc File 2.58 KB 0644
pytest_plugin.cpython-35.opt-1.pyc File 9.22 KB 0644
pytest_plugin.cpython-35.pyc File 9.28 KB 0644
resolver.cpython-35.opt-1.pyc File 3.33 KB 0644
resolver.cpython-35.pyc File 3.33 KB 0644
signals.cpython-35.opt-1.pyc File 1.23 KB 0644
signals.cpython-35.pyc File 1.23 KB 0644
streams.cpython-35.opt-1.pyc File 16.41 KB 0644
streams.cpython-35.pyc File 16.74 KB 0644
tcp_helpers.cpython-35.opt-1.pyc File 1.37 KB 0644
tcp_helpers.cpython-35.pyc File 1.37 KB 0644
test_utils.cpython-35.opt-1.pyc File 17.71 KB 0644
test_utils.cpython-35.pyc File 17.76 KB 0644
tracing.cpython-35.opt-1.pyc File 11.2 KB 0644
tracing.cpython-35.pyc File 11.2 KB 0644
web.cpython-35.opt-1.pyc File 4.65 KB 0644
web.cpython-35.pyc File 4.65 KB 0644
web_app.cpython-35.opt-1.pyc File 9.78 KB 0644
web_app.cpython-35.pyc File 10.24 KB 0644
web_exceptions.cpython-35.opt-1.pyc File 11.98 KB 0644
web_exceptions.cpython-35.pyc File 11.98 KB 0644
web_fileresponse.cpython-35.opt-1.pyc File 5.44 KB 0644
web_fileresponse.cpython-35.pyc File 5.44 KB 0644
web_middlewares.cpython-35.opt-1.pyc File 2.63 KB 0644
web_middlewares.cpython-35.pyc File 2.63 KB 0644
web_protocol.cpython-35.opt-1.pyc File 13.36 KB 0644
web_protocol.cpython-35.pyc File 13.39 KB 0644
web_request.cpython-35.opt-1.pyc File 19.16 KB 0644
web_request.cpython-35.pyc File 19.16 KB 0644
web_response.cpython-35.opt-1.pyc File 17.11 KB 0644
web_response.cpython-35.pyc File 17.84 KB 0644
web_runner.cpython-35.opt-1.pyc File 9.55 KB 0644
web_runner.cpython-35.pyc File 9.55 KB 0644
web_server.cpython-35.opt-1.pyc File 2.04 KB 0644
web_server.cpython-35.pyc File 2.04 KB 0644
web_urldispatcher.cpython-35.opt-1.pyc File 37.12 KB 0644
web_urldispatcher.cpython-35.pyc File 38.15 KB 0644
web_ws.cpython-35.opt-1.pyc File 12.52 KB 0644
web_ws.cpython-35.pyc File 12.52 KB 0644
worker.cpython-35.opt-1.pyc File 6.4 KB 0644
worker.cpython-35.pyc File 6.4 KB 0644