diff options
author | Andrey Petrov <andrey.petrov@shazow.net> | 2014-07-01 14:59:30 -0700 |
---|---|---|
committer | Andrey Petrov <andrey.petrov@shazow.net> | 2014-07-01 14:59:30 -0700 |
commit | 22d289cf94bde491909091bec1ec5da80efde741 (patch) | |
tree | c7b2f58c68ff6a704a2cb11c3cca3304849c0714 | |
parent | 5266d0086bb8cfc31875de781fd88eae3b76a6c2 (diff) | |
download | urllib3-22d289cf94bde491909091bec1ec5da80efde741.tar.gz |
: :: -> ::
-rw-r--r-- | README.rst | 4 | ||||
-rw-r--r-- | urllib3/connectionpool.py | 2 | ||||
-rw-r--r-- | urllib3/fields.py | 2 | ||||
-rw-r--r-- | urllib3/poolmanager.py | 2 | ||||
-rw-r--r-- | urllib3/request.py | 2 | ||||
-rw-r--r-- | urllib3/util/request.py | 2 | ||||
-rw-r--r-- | urllib3/util/retry.py | 6 | ||||
-rw-r--r-- | urllib3/util/timeout.py | 6 | ||||
-rw-r--r-- | urllib3/util/url.py | 4 |
9 files changed, 15 insertions, 15 deletions
@@ -95,7 +95,7 @@ Run the tests We use some external dependencies, multiple interpreters and code coverage analysis while running test suite. Our ``Makefile`` handles much of this for you as long as you're running it `inside of a virtualenv -<http://docs.python-guide.org/en/latest/dev/virtualenvs/>`_: :: +<http://docs.python-guide.org/en/latest/dev/virtualenvs/>`_:: $ make test [... magically installs dependencies and runs tests on your virtualenv] @@ -106,7 +106,7 @@ you as long as you're running it `inside of a virtualenv Note that code coverage less than 100% is regarded as a failing run. Some platform-specific tests are skipped unless run in that platform. To make sure the code works in all of urllib3's supported platforms, you can run our ``tox`` -suite: :: +suite:: $ make test-all [... tox creates a virtualenv for every platform and runs tests inside of each] diff --git a/urllib3/connectionpool.py b/urllib3/connectionpool.py index 9d046ffb..9b2378f7 100644 --- a/urllib3/connectionpool.py +++ b/urllib3/connectionpool.py @@ -722,7 +722,7 @@ def connection_from_url(url, **kw): :class:`.ConnectionPool`. Useful for specifying things like timeout, maxsize, headers, etc. - Example: :: + Example:: >>> conn = connection_from_url('http://google.com/') >>> r = conn.request('GET', '/') diff --git a/urllib3/fields.py b/urllib3/fields.py index dceafb4d..7826547e 100644 --- a/urllib3/fields.py +++ b/urllib3/fields.py @@ -81,7 +81,7 @@ class RequestField(object): Supports constructing :class:`~urllib3.fields.RequestField` from parameter of key/value strings AND key/filetuple. A filetuple is a (filename, data, MIME type) tuple where the MIME type is optional. - For example: :: + For example:: 'foo': 'bar', 'fakefile': ('foofile.txt', 'contents of foofile'), diff --git a/urllib3/poolmanager.py b/urllib3/poolmanager.py index 00028e71..0f174c02 100644 --- a/urllib3/poolmanager.py +++ b/urllib3/poolmanager.py @@ -51,7 +51,7 @@ class PoolManager(RequestMethods): Additional parameters are used to create fresh :class:`urllib3.connectionpool.ConnectionPool` instances. - Example: :: + Example:: >>> manager = PoolManager(num_pools=2) >>> r = manager.request('GET', 'http://google.com/') diff --git a/urllib3/request.py b/urllib3/request.py index 7a46f1bb..048f9121 100644 --- a/urllib3/request.py +++ b/urllib3/request.py @@ -105,7 +105,7 @@ class RequestMethods(object): Supports an optional ``fields`` parameter of key/value strings AND key/filetuple. A filetuple is a (filename, data, MIME type) tuple where - the MIME type is optional. For example: :: + the MIME type is optional. For example:: fields = { 'foo': 'bar', diff --git a/urllib3/util/request.py b/urllib3/util/request.py index 7211669d..cfcf7c96 100644 --- a/urllib3/util/request.py +++ b/urllib3/util/request.py @@ -40,7 +40,7 @@ def make_headers(keep_alive=None, accept_encoding=None, user_agent=None, :param disable_cache: If ``True``, adds 'cache-control: no-cache' header. - Example: :: + Example:: >>> make_headers(keep_alive=True, user_agent="Batman/1.0") {'connection': 'keep-alive', 'user-agent': 'Batman/1.0'} diff --git a/urllib3/util/retry.py b/urllib3/util/retry.py index 379c086a..90131977 100644 --- a/urllib3/util/retry.py +++ b/urllib3/util/retry.py @@ -19,17 +19,17 @@ class Retry(object): Each retry attempt will create a new Retry object with updated values, so they can be safely reused. - Retries can be defined as a default for a pool: :: + Retries can be defined as a default for a pool:: retries = Retry(connect=5, read=2, redirect=5) http = PoolManager(retries=retries) response = http.request('GET', 'http://example.com/') - Or per-request (which overrides the default for the pool): :: + Or per-request (which overrides the default for the pool):: response = http.request('GET', 'http://example.com/', retries=Retry(10)) - Retries can be disabled by passing ``False``: :: + Retries can be disabled by passing ``False``:: response = http.request('GET', 'http://example.com/', retries=False) diff --git a/urllib3/util/timeout.py b/urllib3/util/timeout.py index f411b904..ea7027f3 100644 --- a/urllib3/util/timeout.py +++ b/urllib3/util/timeout.py @@ -19,17 +19,17 @@ def current_time(): class Timeout(object): """ Timeout configuration. - Timeouts can be defined as a default for a pool: :: + Timeouts can be defined as a default for a pool:: timeout = Timeout(connect=2.0, read=7.0) http = PoolManager(timeout=timeout) response = http.request('GET', 'http://example.com/') - Or per-request (which overrides the default for the pool): :: + Or per-request (which overrides the default for the pool):: response = http.request('GET', 'http://example.com/', timeout=Timeout(10)) - Timeouts can be disabled by setting all the parameters to ``None``: :: + Timeouts can be disabled by setting all the parameters to ``None``:: no_timeout = Timeout(connect=None, read=None) response = http.request('GET', 'http://example.com/, timeout=no_timeout) diff --git a/urllib3/util/url.py b/urllib3/util/url.py index c9c52e4d..487d456c 100644 --- a/urllib3/util/url.py +++ b/urllib3/util/url.py @@ -48,7 +48,7 @@ def split_first(s, delims): If not found, then the first part is the full input string. - Example: :: + Example:: >>> split_first('foo/bar?baz', '?/=') ('foo', 'bar?baz', '/') @@ -81,7 +81,7 @@ def parse_url(url): Partly backwards-compatible with :mod:`urlparse`. - Example: :: + Example:: >>> parse_url('http://google.com/mail/') Url(scheme='http', host='google.com', port=None, path='/', ...) |