Skip to content

Commit deb8d17

Browse files
committed
Merge branch 'master' of github.com:KeepSafe/aiohttp
2 parents beddeb6 + 06afe9f commit deb8d17

14 files changed

+118
-65
lines changed

.bumpversion.cfg

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[bumpversion]
2-
current_version = 0.14.2a0
2+
current_version = 0.15.0a0
33
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)((?P<release>[a-z]+\d+))?
4-
serialize =
5-
{major}.{minor}.{patch}{release}
6-
{major}.{minor}.{patch}
7-
4+
serialize =
5+
{major}.{minor}.{patch}{release}
6+
{major}.{minor}.{patch}
87
commit = True
98
tag = True
109

1110
[bumpversion:file:aiohttp/__init__.py]
1211

1312
[bumpversion:part:release]
1413
optional_value = final
15-
values =
16-
a0
17-
final
14+
values =
15+
a0
16+
final
17+

aiohttp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This relies on each of the submodules having an __all__ variable.
22

3-
__version__ = '0.14.2a0'
3+
__version__ = '0.15.0a0'
44

55

66
from . import hdrs # noqa

aiohttp/connector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class BaseConnector(object):
5959
:param conn_timeout: (optional) Connect timeout.
6060
:param keepalive_timeout: (optional) Keep-alive timeout.
6161
:param bool share_cookies: Set to True to keep cookies between requests.
62-
:param bool force_close: Set to True to froce close and do reconnect
62+
:param bool force_close: Set to True to force close and do reconnect
6363
after each request (and between redirects).
6464
:param loop: Optional event loop.
6565
"""
@@ -223,7 +223,7 @@ class TCPConnector(BaseConnector):
223223
224224
:param bool verify_ssl: Set to True to check ssl certifications.
225225
:param bool resolve: Set to True to do DNS lookup for host name.
226-
:param familiy: socket address family
226+
:param family: socket address family
227227
:param args: see :class:`BaseConnector`
228228
:param kwargs: see :class:`BaseConnector`
229229
"""

aiohttp/web.py

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import json
1010
import re
1111
import os
12+
import warnings
1213

1314
from urllib.parse import urlsplit, parse_qsl, urlencode, unquote
1415
from types import MappingProxyType
@@ -172,6 +173,8 @@ def __init__(self, app, message, payload, transport, reader, writer, *,
172173
self._payload = payload
173174
self._cookies = None
174175

176+
self._read_bytes = None
177+
175178
@property
176179
def method(self):
177180
"""Read only property for getting HTTP method.
@@ -281,7 +284,13 @@ def cookies(self):
281284

282285
@property
283286
def payload(self):
284-
"""Return raw paiload stream."""
287+
"""Return raw payload stream."""
288+
warnings.warn('use Request.content instead', DeprecationWarning)
289+
return self._payload
290+
291+
@property
292+
def content(self):
293+
"""Return raw payload stream."""
285294
return self._payload
286295

287296
@asyncio.coroutine
@@ -300,13 +309,15 @@ def read(self):
300309
301310
Returns bytes object with full request content.
302311
"""
303-
body = bytearray()
304-
while True:
305-
chunk = yield from self._payload.readany()
306-
body.extend(chunk)
307-
if chunk is EOF_MARKER:
308-
break
309-
return bytes(body)
312+
if self._read_bytes is None:
313+
body = bytearray()
314+
while True:
315+
chunk = yield from self._payload.readany()
316+
body.extend(chunk)
317+
if chunk is EOF_MARKER:
318+
break
319+
self._read_bytes = bytes(body)
320+
return self._read_bytes
310321

311322
@asyncio.coroutine
312323
def text(self):
@@ -350,7 +361,7 @@ def post(self):
350361
keep_blank_values=True,
351362
encoding=content_charset)
352363

353-
supported_tranfer_encoding = {
364+
supported_transfer_encoding = {
354365
'base64': binascii.a2b_base64,
355366
'quoted-printable': binascii.a2b_qp
356367
}
@@ -370,10 +381,10 @@ def post(self):
370381
out.add(field.name, ff)
371382
else:
372383
value = field.value
373-
if transfer_encoding in supported_tranfer_encoding:
384+
if transfer_encoding in supported_transfer_encoding:
374385
# binascii accepts bytes
375386
value = value.encode('utf-8')
376-
value = supported_tranfer_encoding[
387+
value = supported_transfer_encoding[
377388
transfer_encoding](value)
378389
out.add(field.name, value)
379390

@@ -1171,7 +1182,7 @@ def __init__(self, method, handler, name, path):
11711182
self._path = path
11721183

11731184
def match(self, path):
1174-
# string comparsion is about 10 times faster than regexp matching
1185+
# string comparison is about 10 times faster than regexp matching
11751186
if self._path == path:
11761187
return {}
11771188
else:

aiohttp/worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Async gunicorn worker for auihttp.wen.Application."""
1+
"""Async gunicorn worker for aiohttp.web"""
22
__all__ = ['GunicornWebWorker']
33

44
import asyncio

docs/client.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ information.
261261

262262

263263
Streaming uploads
264-
------------------
264+
-----------------
265265

266266
aiohttp support multiple types of streaming uploads, which allows you to
267267
send large files without reading them into memory.

docs/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Any extra texts (print statements and so on) should be removed.
7474
Tests coverage
7575
--------------
7676

77-
We are stronly keeping our test coverage, please don't make it worse.
77+
We are strongly keeping our test coverage, please don't make it worse.
7878

7979
Use::
8080

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Server example::
8080
loop.run_until_complete(init(loop))
8181
try:
8282
loop.run_forever()
83-
except KeyboardInterrrupt:
83+
except KeyboardInterrupt:
8484
pass
8585

8686

@@ -94,7 +94,7 @@ Please feel free to file an issue on `bug tracker
9494
or have some suggestion for library improvement.
9595

9696
The library uses `Travis <https://travis-ci.org/KeepSafe/aiohttp>`_ for
97-
Continious Integration.
97+
Continuous Integration.
9898

9999

100100
Dependencies

docs/multidict.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _aiohttp-multidic:
1+
.. _aiohttp-multidict:
22

33
Multidicts
44
==========
@@ -21,7 +21,7 @@ Immutable proxies (:class:`MultiDictProxy` and
2121
proxied multidict, the view reflects the multidict changes. They are
2222
implement :class:`~collections.abc.Mapping` interface.
2323

24-
Regular mutable (:class:`MultiDict` and :class:`CIMultiDict`) clases
24+
Regular mutable (:class:`MultiDict` and :class:`CIMultiDict`) classes
2525
implement :class:`~collections.abc.MutableMapping` and allow to change
2626
own content.
2727

@@ -40,7 +40,7 @@ insensitive, e.g.::
4040

4141

4242
MultiDict
43-
----------------
43+
---------
4444

4545
.. class:: MultiDict(**kwargs)
4646
MultiDict(mapping, **kwargs)
@@ -93,7 +93,7 @@ MultiDict
9393

9494
.. method:: add(key, value)
9595

96-
Append ``(key, value)`` pair to the dictiaonary.
96+
Append ``(key, value)`` pair to the dictionary.
9797

9898
.. method:: clear()
9999

@@ -173,7 +173,7 @@ MultiDict
173173

174174
.. method:: popitem()
175175

176-
Remove and retun an arbitrary ``(key, value)`` pair from the dictionary.
176+
Remove and return an arbitrary ``(key, value)`` pair from the dictionary.
177177

178178
:meth:`popitem` is useful to destructively iterate over a
179179
dictionary, as often used in set algorithms.
@@ -217,7 +217,7 @@ CIMultiDict
217217
Create a case insensitive multidict instance.
218218

219219
The behavior is the same as of :class:`MultiDict` but key
220-
comparsions are case insensitive, e.g.::
220+
comparisons are case insensitive, e.g.::
221221

222222
>>> dct = CIMultiDict(a='val')
223223
>>> 'A' in dct
@@ -343,7 +343,7 @@ upstr
343343
:class:`CIMultiDict` accepts :class:`str` as *key* argument for dict
344344
lookups but converts it to upper case internally.
345345

346-
For more effective processing it shoult to know if *key* is already upper cased.
346+
For more effective processing it should to know if *key* is already upper cased.
347347

348348
To skip :meth:`~str.upper()` call you may create upper cased string by
349349
hands, e.g::

docs/server.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ of ``GET``, ``POST``, ``PUT`` or ``DELETE`` strings.
7272
Handling GET params
7373
-------------------
7474

75-
Currently aiohttp does not provide automatical parsing of incoming GET
75+
Currently aiohttp does not provide automatic parsing of incoming GET
7676
params. However aiohttp does provide a nice MulitiDict wrapper for
7777
already parsed params.
7878

@@ -119,7 +119,7 @@ GET params.
119119
print("Passed in POST", post_params)
120120
121121
SSL
122-
---------
122+
---
123123

124124
To use asyncio's SSL support, just pass an SSLContext object to the
125125
``create_server`` method of the loop.

0 commit comments

Comments
 (0)