rigid 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/rigid +4 -0
- data/rigid +16 -0
- data/vendor/PyYAML-3.12.dist-info/DESCRIPTION.rst +12 -0
- data/vendor/PyYAML-3.12.dist-info/INSTALLER +1 -0
- data/vendor/PyYAML-3.12.dist-info/METADATA +35 -0
- data/vendor/PyYAML-3.12.dist-info/RECORD +42 -0
- data/vendor/PyYAML-3.12.dist-info/WHEEL +5 -0
- data/vendor/PyYAML-3.12.dist-info/metadata.json +1 -0
- data/vendor/PyYAML-3.12.dist-info/top_level.txt +2 -0
- data/vendor/_yaml.so +0 -0
- data/vendor/click/__init__.py +98 -0
- data/vendor/click/__init__.pyc +0 -0
- data/vendor/click/_bashcomplete.py +83 -0
- data/vendor/click/_bashcomplete.pyc +0 -0
- data/vendor/click/_compat.py +642 -0
- data/vendor/click/_compat.pyc +0 -0
- data/vendor/click/_termui_impl.py +547 -0
- data/vendor/click/_termui_impl.pyc +0 -0
- data/vendor/click/_textwrap.py +38 -0
- data/vendor/click/_textwrap.pyc +0 -0
- data/vendor/click/_unicodefun.py +119 -0
- data/vendor/click/_unicodefun.pyc +0 -0
- data/vendor/click/_winconsole.py +273 -0
- data/vendor/click/_winconsole.pyc +0 -0
- data/vendor/click/core.py +1738 -0
- data/vendor/click/core.pyc +0 -0
- data/vendor/click/decorators.py +304 -0
- data/vendor/click/decorators.pyc +0 -0
- data/vendor/click/exceptions.py +201 -0
- data/vendor/click/exceptions.pyc +0 -0
- data/vendor/click/formatting.py +256 -0
- data/vendor/click/formatting.pyc +0 -0
- data/vendor/click/globals.py +48 -0
- data/vendor/click/globals.pyc +0 -0
- data/vendor/click/parser.py +426 -0
- data/vendor/click/parser.pyc +0 -0
- data/vendor/click/termui.py +539 -0
- data/vendor/click/termui.pyc +0 -0
- data/vendor/click/testing.py +322 -0
- data/vendor/click/testing.pyc +0 -0
- data/vendor/click/types.py +550 -0
- data/vendor/click/types.pyc +0 -0
- data/vendor/click/utils.py +415 -0
- data/vendor/click/utils.pyc +0 -0
- data/vendor/click-6.6.dist-info/DESCRIPTION.rst +3 -0
- data/vendor/click-6.6.dist-info/INSTALLER +1 -0
- data/vendor/click-6.6.dist-info/METADATA +16 -0
- data/vendor/click-6.6.dist-info/RECORD +41 -0
- data/vendor/click-6.6.dist-info/WHEEL +6 -0
- data/vendor/click-6.6.dist-info/metadata.json +1 -0
- data/vendor/click-6.6.dist-info/top_level.txt +1 -0
- data/vendor/easy_install.py +5 -0
- data/vendor/easy_install.pyc +0 -0
- data/vendor/pip-9.0.1.dist-info/DESCRIPTION.rst +39 -0
- data/vendor/pip-9.0.1.dist-info/INSTALLER +1 -0
- data/vendor/pip-9.0.1.dist-info/METADATA +69 -0
- data/vendor/pip-9.0.1.dist-info/RECORD +501 -0
- data/vendor/pip-9.0.1.dist-info/WHEEL +6 -0
- data/vendor/pip-9.0.1.dist-info/entry_points.txt +5 -0
- data/vendor/pip-9.0.1.dist-info/metadata.json +1 -0
- data/vendor/pip-9.0.1.dist-info/top_level.txt +1 -0
- data/vendor/pkg_resources/__init__.py +3051 -0
- data/vendor/pkg_resources/__init__.pyc +0 -0
- data/vendor/pkg_resources/_vendor/__init__.py +0 -0
- data/vendor/pkg_resources/_vendor/__init__.pyc +0 -0
- data/vendor/pkg_resources/_vendor/appdirs.py +552 -0
- data/vendor/pkg_resources/_vendor/appdirs.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/__about__.py +21 -0
- data/vendor/pkg_resources/_vendor/packaging/__about__.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/__init__.py +14 -0
- data/vendor/pkg_resources/_vendor/packaging/__init__.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/_compat.py +30 -0
- data/vendor/pkg_resources/_vendor/packaging/_compat.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/_structures.py +68 -0
- data/vendor/pkg_resources/_vendor/packaging/_structures.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/markers.py +287 -0
- data/vendor/pkg_resources/_vendor/packaging/markers.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/requirements.py +127 -0
- data/vendor/pkg_resources/_vendor/packaging/requirements.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/specifiers.py +774 -0
- data/vendor/pkg_resources/_vendor/packaging/specifiers.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/utils.py +14 -0
- data/vendor/pkg_resources/_vendor/packaging/utils.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/version.py +393 -0
- data/vendor/pkg_resources/_vendor/packaging/version.pyc +0 -0
- data/vendor/pkg_resources/_vendor/pyparsing.py +5696 -0
- data/vendor/pkg_resources/_vendor/pyparsing.pyc +0 -0
- data/vendor/pkg_resources/_vendor/six.py +868 -0
- data/vendor/pkg_resources/_vendor/six.pyc +0 -0
- data/vendor/pkg_resources/extern/__init__.py +73 -0
- data/vendor/pkg_resources/extern/__init__.pyc +0 -0
- data/vendor/requests/__init__.py +86 -0
- data/vendor/requests/__init__.pyc +0 -0
- data/vendor/requests/adapters.py +503 -0
- data/vendor/requests/adapters.pyc +0 -0
- data/vendor/requests/api.py +148 -0
- data/vendor/requests/api.pyc +0 -0
- data/vendor/requests/auth.py +252 -0
- data/vendor/requests/auth.pyc +0 -0
- data/vendor/requests/cacert.pem +5616 -0
- data/vendor/requests/certs.py +25 -0
- data/vendor/requests/certs.pyc +0 -0
- data/vendor/requests/compat.py +66 -0
- data/vendor/requests/compat.pyc +0 -0
- data/vendor/requests/cookies.py +540 -0
- data/vendor/requests/cookies.pyc +0 -0
- data/vendor/requests/exceptions.py +114 -0
- data/vendor/requests/exceptions.pyc +0 -0
- data/vendor/requests/hooks.py +34 -0
- data/vendor/requests/hooks.pyc +0 -0
- data/vendor/requests/models.py +873 -0
- data/vendor/requests/models.pyc +0 -0
- data/vendor/requests/packages/__init__.py +36 -0
- data/vendor/requests/packages/__init__.pyc +0 -0
- data/vendor/requests/packages/chardet/__init__.py +32 -0
- data/vendor/requests/packages/chardet/__init__.pyc +0 -0
- data/vendor/requests/packages/chardet/big5freq.py +925 -0
- data/vendor/requests/packages/chardet/big5freq.pyc +0 -0
- data/vendor/requests/packages/chardet/big5prober.py +42 -0
- data/vendor/requests/packages/chardet/big5prober.pyc +0 -0
- data/vendor/requests/packages/chardet/chardetect.py +80 -0
- data/vendor/requests/packages/chardet/chardetect.pyc +0 -0
- data/vendor/requests/packages/chardet/chardistribution.py +231 -0
- data/vendor/requests/packages/chardet/chardistribution.pyc +0 -0
- data/vendor/requests/packages/chardet/charsetgroupprober.py +106 -0
- data/vendor/requests/packages/chardet/charsetgroupprober.pyc +0 -0
- data/vendor/requests/packages/chardet/charsetprober.py +62 -0
- data/vendor/requests/packages/chardet/charsetprober.pyc +0 -0
- data/vendor/requests/packages/chardet/codingstatemachine.py +61 -0
- data/vendor/requests/packages/chardet/codingstatemachine.pyc +0 -0
- data/vendor/requests/packages/chardet/compat.py +34 -0
- data/vendor/requests/packages/chardet/compat.pyc +0 -0
- data/vendor/requests/packages/chardet/constants.py +39 -0
- data/vendor/requests/packages/chardet/constants.pyc +0 -0
- data/vendor/requests/packages/chardet/cp949prober.py +44 -0
- data/vendor/requests/packages/chardet/cp949prober.pyc +0 -0
- data/vendor/requests/packages/chardet/escprober.py +86 -0
- data/vendor/requests/packages/chardet/escprober.pyc +0 -0
- data/vendor/requests/packages/chardet/escsm.py +242 -0
- data/vendor/requests/packages/chardet/escsm.pyc +0 -0
- data/vendor/requests/packages/chardet/eucjpprober.py +90 -0
- data/vendor/requests/packages/chardet/eucjpprober.pyc +0 -0
- data/vendor/requests/packages/chardet/euckrfreq.py +596 -0
- data/vendor/requests/packages/chardet/euckrfreq.pyc +0 -0
- data/vendor/requests/packages/chardet/euckrprober.py +42 -0
- data/vendor/requests/packages/chardet/euckrprober.pyc +0 -0
- data/vendor/requests/packages/chardet/euctwfreq.py +428 -0
- data/vendor/requests/packages/chardet/euctwfreq.pyc +0 -0
- data/vendor/requests/packages/chardet/euctwprober.py +41 -0
- data/vendor/requests/packages/chardet/euctwprober.pyc +0 -0
- data/vendor/requests/packages/chardet/gb2312freq.py +472 -0
- data/vendor/requests/packages/chardet/gb2312freq.pyc +0 -0
- data/vendor/requests/packages/chardet/gb2312prober.py +41 -0
- data/vendor/requests/packages/chardet/gb2312prober.pyc +0 -0
- data/vendor/requests/packages/chardet/hebrewprober.py +283 -0
- data/vendor/requests/packages/chardet/hebrewprober.pyc +0 -0
- data/vendor/requests/packages/chardet/jisfreq.py +569 -0
- data/vendor/requests/packages/chardet/jisfreq.pyc +0 -0
- data/vendor/requests/packages/chardet/jpcntx.py +227 -0
- data/vendor/requests/packages/chardet/jpcntx.pyc +0 -0
- data/vendor/requests/packages/chardet/langbulgarianmodel.py +229 -0
- data/vendor/requests/packages/chardet/langbulgarianmodel.pyc +0 -0
- data/vendor/requests/packages/chardet/langcyrillicmodel.py +329 -0
- data/vendor/requests/packages/chardet/langcyrillicmodel.pyc +0 -0
- data/vendor/requests/packages/chardet/langgreekmodel.py +225 -0
- data/vendor/requests/packages/chardet/langgreekmodel.pyc +0 -0
- data/vendor/requests/packages/chardet/langhebrewmodel.py +201 -0
- data/vendor/requests/packages/chardet/langhebrewmodel.pyc +0 -0
- data/vendor/requests/packages/chardet/langhungarianmodel.py +225 -0
- data/vendor/requests/packages/chardet/langhungarianmodel.pyc +0 -0
- data/vendor/requests/packages/chardet/langthaimodel.py +200 -0
- data/vendor/requests/packages/chardet/langthaimodel.pyc +0 -0
- data/vendor/requests/packages/chardet/latin1prober.py +139 -0
- data/vendor/requests/packages/chardet/latin1prober.pyc +0 -0
- data/vendor/requests/packages/chardet/mbcharsetprober.py +86 -0
- data/vendor/requests/packages/chardet/mbcharsetprober.pyc +0 -0
- data/vendor/requests/packages/chardet/mbcsgroupprober.py +54 -0
- data/vendor/requests/packages/chardet/mbcsgroupprober.pyc +0 -0
- data/vendor/requests/packages/chardet/mbcssm.py +572 -0
- data/vendor/requests/packages/chardet/mbcssm.pyc +0 -0
- data/vendor/requests/packages/chardet/sbcharsetprober.py +120 -0
- data/vendor/requests/packages/chardet/sbcharsetprober.pyc +0 -0
- data/vendor/requests/packages/chardet/sbcsgroupprober.py +69 -0
- data/vendor/requests/packages/chardet/sbcsgroupprober.pyc +0 -0
- data/vendor/requests/packages/chardet/sjisprober.py +91 -0
- data/vendor/requests/packages/chardet/sjisprober.pyc +0 -0
- data/vendor/requests/packages/chardet/universaldetector.py +170 -0
- data/vendor/requests/packages/chardet/universaldetector.pyc +0 -0
- data/vendor/requests/packages/chardet/utf8prober.py +76 -0
- data/vendor/requests/packages/chardet/utf8prober.pyc +0 -0
- data/vendor/requests/packages/urllib3/__init__.py +96 -0
- data/vendor/requests/packages/urllib3/__init__.pyc +0 -0
- data/vendor/requests/packages/urllib3/_collections.py +324 -0
- data/vendor/requests/packages/urllib3/_collections.pyc +0 -0
- data/vendor/requests/packages/urllib3/connection.py +330 -0
- data/vendor/requests/packages/urllib3/connection.pyc +0 -0
- data/vendor/requests/packages/urllib3/connectionpool.py +866 -0
- data/vendor/requests/packages/urllib3/connectionpool.pyc +0 -0
- data/vendor/requests/packages/urllib3/contrib/__init__.py +0 -0
- data/vendor/requests/packages/urllib3/contrib/__init__.pyc +0 -0
- data/vendor/requests/packages/urllib3/contrib/appengine.py +231 -0
- data/vendor/requests/packages/urllib3/contrib/appengine.pyc +0 -0
- data/vendor/requests/packages/urllib3/contrib/ntlmpool.py +115 -0
- data/vendor/requests/packages/urllib3/contrib/ntlmpool.pyc +0 -0
- data/vendor/requests/packages/urllib3/contrib/pyopenssl.py +358 -0
- data/vendor/requests/packages/urllib3/contrib/pyopenssl.pyc +0 -0
- data/vendor/requests/packages/urllib3/contrib/socks.py +172 -0
- data/vendor/requests/packages/urllib3/contrib/socks.pyc +0 -0
- data/vendor/requests/packages/urllib3/exceptions.py +209 -0
- data/vendor/requests/packages/urllib3/exceptions.pyc +0 -0
- data/vendor/requests/packages/urllib3/fields.py +178 -0
- data/vendor/requests/packages/urllib3/fields.pyc +0 -0
- data/vendor/requests/packages/urllib3/filepost.py +94 -0
- data/vendor/requests/packages/urllib3/filepost.pyc +0 -0
- data/vendor/requests/packages/urllib3/packages/__init__.py +5 -0
- data/vendor/requests/packages/urllib3/packages/__init__.pyc +0 -0
- data/vendor/requests/packages/urllib3/packages/ordered_dict.py +259 -0
- data/vendor/requests/packages/urllib3/packages/ordered_dict.pyc +0 -0
- data/vendor/requests/packages/urllib3/packages/six.py +868 -0
- data/vendor/requests/packages/urllib3/packages/six.pyc +0 -0
- data/vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py +13 -0
- data/vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyc +0 -0
- data/vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py +105 -0
- data/vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyc +0 -0
- data/vendor/requests/packages/urllib3/poolmanager.py +367 -0
- data/vendor/requests/packages/urllib3/poolmanager.pyc +0 -0
- data/vendor/requests/packages/urllib3/request.py +151 -0
- data/vendor/requests/packages/urllib3/request.pyc +0 -0
- data/vendor/requests/packages/urllib3/response.py +530 -0
- data/vendor/requests/packages/urllib3/response.pyc +0 -0
- data/vendor/requests/packages/urllib3/util/__init__.py +46 -0
- data/vendor/requests/packages/urllib3/util/__init__.pyc +0 -0
- data/vendor/requests/packages/urllib3/util/connection.py +144 -0
- data/vendor/requests/packages/urllib3/util/connection.pyc +0 -0
- data/vendor/requests/packages/urllib3/util/request.py +72 -0
- data/vendor/requests/packages/urllib3/util/request.pyc +0 -0
- data/vendor/requests/packages/urllib3/util/response.py +74 -0
- data/vendor/requests/packages/urllib3/util/response.pyc +0 -0
- data/vendor/requests/packages/urllib3/util/retry.py +300 -0
- data/vendor/requests/packages/urllib3/util/retry.pyc +0 -0
- data/vendor/requests/packages/urllib3/util/ssl_.py +320 -0
- data/vendor/requests/packages/urllib3/util/ssl_.pyc +0 -0
- data/vendor/requests/packages/urllib3/util/timeout.py +242 -0
- data/vendor/requests/packages/urllib3/util/timeout.pyc +0 -0
- data/vendor/requests/packages/urllib3/util/url.py +217 -0
- data/vendor/requests/packages/urllib3/util/url.pyc +0 -0
- data/vendor/requests/sessions.py +712 -0
- data/vendor/requests/sessions.pyc +0 -0
- data/vendor/requests/status_codes.py +91 -0
- data/vendor/requests/status_codes.pyc +0 -0
- data/vendor/requests/structures.py +105 -0
- data/vendor/requests/structures.pyc +0 -0
- data/vendor/requests/utils.py +817 -0
- data/vendor/requests/utils.pyc +0 -0
- data/vendor/requests-2.11.1.dist-info/DESCRIPTION.rst +1294 -0
- data/vendor/requests-2.11.1.dist-info/INSTALLER +1 -0
- data/vendor/requests-2.11.1.dist-info/METADATA +1323 -0
- data/vendor/requests-2.11.1.dist-info/RECORD +170 -0
- data/vendor/requests-2.11.1.dist-info/WHEEL +6 -0
- data/vendor/requests-2.11.1.dist-info/metadata.json +1 -0
- data/vendor/requests-2.11.1.dist-info/top_level.txt +1 -0
- data/vendor/rigid/__init__.py +1 -0
- data/vendor/rigid/__init__.pyc +0 -0
- data/vendor/rigid/api.py +129 -0
- data/vendor/rigid/api.pyc +0 -0
- data/vendor/rigid/commands/__init__.py +260 -0
- data/vendor/rigid/commands/__init__.pyc +0 -0
- data/vendor/rigid/commands/deploy.py +0 -0
- data/vendor/rigid/commands/deploy.pyc +0 -0
- data/vendor/rigid/deploy.py +70 -0
- data/vendor/rigid/deploy.pyc +0 -0
- data/vendor/rigid/file_scanner.py +63 -0
- data/vendor/rigid/file_scanner.pyc +0 -0
- data/vendor/rigid/utils.py +17 -0
- data/vendor/rigid/utils.pyc +0 -0
- data/vendor/rigid-0.2.0.dist-info/DESCRIPTION.rst +3 -0
- data/vendor/rigid-0.2.0.dist-info/INSTALLER +1 -0
- data/vendor/rigid-0.2.0.dist-info/METADATA +23 -0
- data/vendor/rigid-0.2.0.dist-info/RECORD +49 -0
- data/vendor/rigid-0.2.0.dist-info/WHEEL +5 -0
- data/vendor/rigid-0.2.0.dist-info/entry_points.txt +3 -0
- data/vendor/rigid-0.2.0.dist-info/metadata.json +1 -0
- data/vendor/rigid-0.2.0.dist-info/top_level.txt +2 -0
- data/vendor/setuptools-28.8.0.dist-info/DESCRIPTION.rst +243 -0
- data/vendor/setuptools-28.8.0.dist-info/INSTALLER +1 -0
- data/vendor/setuptools-28.8.0.dist-info/METADATA +272 -0
- data/vendor/setuptools-28.8.0.dist-info/RECORD +143 -0
- data/vendor/setuptools-28.8.0.dist-info/WHEEL +6 -0
- data/vendor/setuptools-28.8.0.dist-info/dependency_links.txt +2 -0
- data/vendor/setuptools-28.8.0.dist-info/entry_points.txt +63 -0
- data/vendor/setuptools-28.8.0.dist-info/metadata.json +1 -0
- data/vendor/setuptools-28.8.0.dist-info/top_level.txt +3 -0
- data/vendor/setuptools-28.8.0.dist-info/zip-safe +1 -0
- data/vendor/tests/__init__.py +0 -0
- data/vendor/tests/__init__.pyc +0 -0
- data/vendor/tests/integration/__init__.py +0 -0
- data/vendor/tests/integration/__init__.pyc +0 -0
- data/vendor/tests/integration/test_app.py +63 -0
- data/vendor/tests/integration/test_app.pyc +0 -0
- data/vendor/tests/integration/test_apps.py +27 -0
- data/vendor/tests/integration/test_apps.pyc +0 -0
- data/vendor/tests/integration/test_deploy.py +128 -0
- data/vendor/tests/integration/test_deploy.pyc +0 -0
- data/vendor/tests/integration/test_domains.py +35 -0
- data/vendor/tests/integration/test_domains.pyc +0 -0
- data/vendor/tests/integration/test_login.py +37 -0
- data/vendor/tests/integration/test_login.pyc +0 -0
- data/vendor/tests/integration/test_promote.py +24 -0
- data/vendor/tests/integration/test_promote.pyc +0 -0
- data/vendor/tests/integration/test_token.py +33 -0
- data/vendor/tests/integration/test_token.pyc +0 -0
- data/vendor/tests/integration/test_whoami.py +24 -0
- data/vendor/tests/integration/test_whoami.pyc +0 -0
- data/vendor/tests/test_deploy.py +33 -0
- data/vendor/tests/test_deploy.pyc +0 -0
- data/vendor/tests/test_file_scanner.py +89 -0
- data/vendor/tests/test_file_scanner.pyc +0 -0
- data/vendor/tests/utils.py +78 -0
- data/vendor/tests/utils.pyc +0 -0
- data/vendor/wheel-0.30.0a0.dist-info/DESCRIPTION.rst +325 -0
- data/vendor/wheel-0.30.0a0.dist-info/INSTALLER +1 -0
- data/vendor/wheel-0.30.0a0.dist-info/LICENSE.txt +22 -0
- data/vendor/wheel-0.30.0a0.dist-info/METADATA +357 -0
- data/vendor/wheel-0.30.0a0.dist-info/RECORD +86 -0
- data/vendor/wheel-0.30.0a0.dist-info/WHEEL +6 -0
- data/vendor/wheel-0.30.0a0.dist-info/entry_points.txt +6 -0
- data/vendor/wheel-0.30.0a0.dist-info/metadata.json +1 -0
- data/vendor/wheel-0.30.0a0.dist-info/top_level.txt +1 -0
- data/vendor/yaml/__init__.py +315 -0
- data/vendor/yaml/__init__.pyc +0 -0
- data/vendor/yaml/composer.py +139 -0
- data/vendor/yaml/composer.pyc +0 -0
- data/vendor/yaml/constructor.py +675 -0
- data/vendor/yaml/constructor.pyc +0 -0
- data/vendor/yaml/cyaml.py +85 -0
- data/vendor/yaml/cyaml.pyc +0 -0
- data/vendor/yaml/dumper.py +62 -0
- data/vendor/yaml/dumper.pyc +0 -0
- data/vendor/yaml/emitter.py +1140 -0
- data/vendor/yaml/emitter.pyc +0 -0
- data/vendor/yaml/error.py +75 -0
- data/vendor/yaml/error.pyc +0 -0
- data/vendor/yaml/events.py +86 -0
- data/vendor/yaml/events.pyc +0 -0
- data/vendor/yaml/loader.py +40 -0
- data/vendor/yaml/loader.pyc +0 -0
- data/vendor/yaml/nodes.py +49 -0
- data/vendor/yaml/nodes.pyc +0 -0
- data/vendor/yaml/parser.py +589 -0
- data/vendor/yaml/parser.pyc +0 -0
- data/vendor/yaml/reader.py +190 -0
- data/vendor/yaml/reader.pyc +0 -0
- data/vendor/yaml/representer.py +486 -0
- data/vendor/yaml/representer.pyc +0 -0
- data/vendor/yaml/resolver.py +227 -0
- data/vendor/yaml/resolver.pyc +0 -0
- data/vendor/yaml/scanner.py +1453 -0
- data/vendor/yaml/scanner.pyc +0 -0
- data/vendor/yaml/serializer.py +111 -0
- data/vendor/yaml/serializer.pyc +0 -0
- data/vendor/yaml/tokens.py +104 -0
- data/vendor/yaml/tokens.pyc +0 -0
- metadata +407 -0
@@ -0,0 +1,144 @@
|
|
1
|
+
from __future__ import absolute_import
|
2
|
+
import socket
|
3
|
+
try:
|
4
|
+
from select import poll, POLLIN
|
5
|
+
except ImportError: # `poll` doesn't exist on OSX and other platforms
|
6
|
+
poll = False
|
7
|
+
try:
|
8
|
+
from select import select
|
9
|
+
except ImportError: # `select` doesn't exist on AppEngine.
|
10
|
+
select = False
|
11
|
+
|
12
|
+
|
13
|
+
def is_connection_dropped(conn): # Platform-specific
|
14
|
+
"""
|
15
|
+
Returns True if the connection is dropped and should be closed.
|
16
|
+
|
17
|
+
:param conn:
|
18
|
+
:class:`httplib.HTTPConnection` object.
|
19
|
+
|
20
|
+
Note: For platforms like AppEngine, this will always return ``False`` to
|
21
|
+
let the platform handle connection recycling transparently for us.
|
22
|
+
"""
|
23
|
+
sock = getattr(conn, 'sock', False)
|
24
|
+
if sock is False: # Platform-specific: AppEngine
|
25
|
+
return False
|
26
|
+
if sock is None: # Connection already closed (such as by httplib).
|
27
|
+
return True
|
28
|
+
|
29
|
+
if not poll:
|
30
|
+
if not select: # Platform-specific: AppEngine
|
31
|
+
return False
|
32
|
+
|
33
|
+
try:
|
34
|
+
return select([sock], [], [], 0.0)[0]
|
35
|
+
except socket.error:
|
36
|
+
return True
|
37
|
+
|
38
|
+
# This version is better on platforms that support it.
|
39
|
+
p = poll()
|
40
|
+
p.register(sock, POLLIN)
|
41
|
+
for (fno, ev) in p.poll(0.0):
|
42
|
+
if fno == sock.fileno():
|
43
|
+
# Either data is buffered (bad), or the connection is dropped.
|
44
|
+
return True
|
45
|
+
|
46
|
+
|
47
|
+
# This function is copied from socket.py in the Python 2.7 standard
|
48
|
+
# library test suite. Added to its signature is only `socket_options`.
|
49
|
+
# One additional modification is that we avoid binding to IPv6 servers
|
50
|
+
# discovered in DNS if the system doesn't have IPv6 functionality.
|
51
|
+
def create_connection(address, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
|
52
|
+
source_address=None, socket_options=None):
|
53
|
+
"""Connect to *address* and return the socket object.
|
54
|
+
|
55
|
+
Convenience function. Connect to *address* (a 2-tuple ``(host,
|
56
|
+
port)``) and return the socket object. Passing the optional
|
57
|
+
*timeout* parameter will set the timeout on the socket instance
|
58
|
+
before attempting to connect. If no *timeout* is supplied, the
|
59
|
+
global default timeout setting returned by :func:`getdefaulttimeout`
|
60
|
+
is used. If *source_address* is set it must be a tuple of (host, port)
|
61
|
+
for the socket to bind as a source address before making the connection.
|
62
|
+
An host of '' or port 0 tells the OS to use the default.
|
63
|
+
"""
|
64
|
+
|
65
|
+
host, port = address
|
66
|
+
if host.startswith('['):
|
67
|
+
host = host.strip('[]')
|
68
|
+
err = None
|
69
|
+
|
70
|
+
# Using the value from allowed_gai_family() in the context of getaddrinfo lets
|
71
|
+
# us select whether to work with IPv4 DNS records, IPv6 records, or both.
|
72
|
+
# The original create_connection function always returns all records.
|
73
|
+
family = allowed_gai_family()
|
74
|
+
|
75
|
+
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
|
76
|
+
af, socktype, proto, canonname, sa = res
|
77
|
+
sock = None
|
78
|
+
try:
|
79
|
+
sock = socket.socket(af, socktype, proto)
|
80
|
+
|
81
|
+
# If provided, set socket level options before connecting.
|
82
|
+
_set_socket_options(sock, socket_options)
|
83
|
+
|
84
|
+
if timeout is not socket._GLOBAL_DEFAULT_TIMEOUT:
|
85
|
+
sock.settimeout(timeout)
|
86
|
+
if source_address:
|
87
|
+
sock.bind(source_address)
|
88
|
+
sock.connect(sa)
|
89
|
+
return sock
|
90
|
+
|
91
|
+
except socket.error as e:
|
92
|
+
err = e
|
93
|
+
if sock is not None:
|
94
|
+
sock.close()
|
95
|
+
sock = None
|
96
|
+
|
97
|
+
if err is not None:
|
98
|
+
raise err
|
99
|
+
|
100
|
+
raise socket.error("getaddrinfo returns an empty list")
|
101
|
+
|
102
|
+
|
103
|
+
def _set_socket_options(sock, options):
|
104
|
+
if options is None:
|
105
|
+
return
|
106
|
+
|
107
|
+
for opt in options:
|
108
|
+
sock.setsockopt(*opt)
|
109
|
+
|
110
|
+
|
111
|
+
def allowed_gai_family():
|
112
|
+
"""This function is designed to work in the context of
|
113
|
+
getaddrinfo, where family=socket.AF_UNSPEC is the default and
|
114
|
+
will perform a DNS search for both IPv6 and IPv4 records."""
|
115
|
+
|
116
|
+
family = socket.AF_INET
|
117
|
+
if HAS_IPV6:
|
118
|
+
family = socket.AF_UNSPEC
|
119
|
+
return family
|
120
|
+
|
121
|
+
|
122
|
+
def _has_ipv6(host):
|
123
|
+
""" Returns True if the system can bind an IPv6 address. """
|
124
|
+
sock = None
|
125
|
+
has_ipv6 = False
|
126
|
+
|
127
|
+
if socket.has_ipv6:
|
128
|
+
# has_ipv6 returns true if cPython was compiled with IPv6 support.
|
129
|
+
# It does not tell us if the system has IPv6 support enabled. To
|
130
|
+
# determine that we must bind to an IPv6 address.
|
131
|
+
# https://github.com/shazow/urllib3/pull/611
|
132
|
+
# https://bugs.python.org/issue658327
|
133
|
+
try:
|
134
|
+
sock = socket.socket(socket.AF_INET6)
|
135
|
+
sock.bind((host, 0))
|
136
|
+
has_ipv6 = True
|
137
|
+
except Exception:
|
138
|
+
pass
|
139
|
+
|
140
|
+
if sock:
|
141
|
+
sock.close()
|
142
|
+
return has_ipv6
|
143
|
+
|
144
|
+
HAS_IPV6 = _has_ipv6('::1')
|
Binary file
|
@@ -0,0 +1,72 @@
|
|
1
|
+
from __future__ import absolute_import
|
2
|
+
from base64 import b64encode
|
3
|
+
|
4
|
+
from ..packages.six import b
|
5
|
+
|
6
|
+
ACCEPT_ENCODING = 'gzip,deflate'
|
7
|
+
|
8
|
+
|
9
|
+
def make_headers(keep_alive=None, accept_encoding=None, user_agent=None,
|
10
|
+
basic_auth=None, proxy_basic_auth=None, disable_cache=None):
|
11
|
+
"""
|
12
|
+
Shortcuts for generating request headers.
|
13
|
+
|
14
|
+
:param keep_alive:
|
15
|
+
If ``True``, adds 'connection: keep-alive' header.
|
16
|
+
|
17
|
+
:param accept_encoding:
|
18
|
+
Can be a boolean, list, or string.
|
19
|
+
``True`` translates to 'gzip,deflate'.
|
20
|
+
List will get joined by comma.
|
21
|
+
String will be used as provided.
|
22
|
+
|
23
|
+
:param user_agent:
|
24
|
+
String representing the user-agent you want, such as
|
25
|
+
"python-urllib3/0.6"
|
26
|
+
|
27
|
+
:param basic_auth:
|
28
|
+
Colon-separated username:password string for 'authorization: basic ...'
|
29
|
+
auth header.
|
30
|
+
|
31
|
+
:param proxy_basic_auth:
|
32
|
+
Colon-separated username:password string for 'proxy-authorization: basic ...'
|
33
|
+
auth header.
|
34
|
+
|
35
|
+
:param disable_cache:
|
36
|
+
If ``True``, adds 'cache-control: no-cache' header.
|
37
|
+
|
38
|
+
Example::
|
39
|
+
|
40
|
+
>>> make_headers(keep_alive=True, user_agent="Batman/1.0")
|
41
|
+
{'connection': 'keep-alive', 'user-agent': 'Batman/1.0'}
|
42
|
+
>>> make_headers(accept_encoding=True)
|
43
|
+
{'accept-encoding': 'gzip,deflate'}
|
44
|
+
"""
|
45
|
+
headers = {}
|
46
|
+
if accept_encoding:
|
47
|
+
if isinstance(accept_encoding, str):
|
48
|
+
pass
|
49
|
+
elif isinstance(accept_encoding, list):
|
50
|
+
accept_encoding = ','.join(accept_encoding)
|
51
|
+
else:
|
52
|
+
accept_encoding = ACCEPT_ENCODING
|
53
|
+
headers['accept-encoding'] = accept_encoding
|
54
|
+
|
55
|
+
if user_agent:
|
56
|
+
headers['user-agent'] = user_agent
|
57
|
+
|
58
|
+
if keep_alive:
|
59
|
+
headers['connection'] = 'keep-alive'
|
60
|
+
|
61
|
+
if basic_auth:
|
62
|
+
headers['authorization'] = 'Basic ' + \
|
63
|
+
b64encode(b(basic_auth)).decode('utf-8')
|
64
|
+
|
65
|
+
if proxy_basic_auth:
|
66
|
+
headers['proxy-authorization'] = 'Basic ' + \
|
67
|
+
b64encode(b(proxy_basic_auth)).decode('utf-8')
|
68
|
+
|
69
|
+
if disable_cache:
|
70
|
+
headers['cache-control'] = 'no-cache'
|
71
|
+
|
72
|
+
return headers
|
Binary file
|
@@ -0,0 +1,74 @@
|
|
1
|
+
from __future__ import absolute_import
|
2
|
+
from ..packages.six.moves import http_client as httplib
|
3
|
+
|
4
|
+
from ..exceptions import HeaderParsingError
|
5
|
+
|
6
|
+
|
7
|
+
def is_fp_closed(obj):
|
8
|
+
"""
|
9
|
+
Checks whether a given file-like object is closed.
|
10
|
+
|
11
|
+
:param obj:
|
12
|
+
The file-like object to check.
|
13
|
+
"""
|
14
|
+
|
15
|
+
try:
|
16
|
+
# Check via the official file-like-object way.
|
17
|
+
return obj.closed
|
18
|
+
except AttributeError:
|
19
|
+
pass
|
20
|
+
|
21
|
+
try:
|
22
|
+
# Check if the object is a container for another file-like object that
|
23
|
+
# gets released on exhaustion (e.g. HTTPResponse).
|
24
|
+
return obj.fp is None
|
25
|
+
except AttributeError:
|
26
|
+
pass
|
27
|
+
|
28
|
+
raise ValueError("Unable to determine whether fp is closed.")
|
29
|
+
|
30
|
+
|
31
|
+
def assert_header_parsing(headers):
|
32
|
+
"""
|
33
|
+
Asserts whether all headers have been successfully parsed.
|
34
|
+
Extracts encountered errors from the result of parsing headers.
|
35
|
+
|
36
|
+
Only works on Python 3.
|
37
|
+
|
38
|
+
:param headers: Headers to verify.
|
39
|
+
:type headers: `httplib.HTTPMessage`.
|
40
|
+
|
41
|
+
:raises urllib3.exceptions.HeaderParsingError:
|
42
|
+
If parsing errors are found.
|
43
|
+
"""
|
44
|
+
|
45
|
+
# This will fail silently if we pass in the wrong kind of parameter.
|
46
|
+
# To make debugging easier add an explicit check.
|
47
|
+
if not isinstance(headers, httplib.HTTPMessage):
|
48
|
+
raise TypeError('expected httplib.Message, got {0}.'.format(
|
49
|
+
type(headers)))
|
50
|
+
|
51
|
+
defects = getattr(headers, 'defects', None)
|
52
|
+
get_payload = getattr(headers, 'get_payload', None)
|
53
|
+
|
54
|
+
unparsed_data = None
|
55
|
+
if get_payload: # Platform-specific: Python 3.
|
56
|
+
unparsed_data = get_payload()
|
57
|
+
|
58
|
+
if defects or unparsed_data:
|
59
|
+
raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data)
|
60
|
+
|
61
|
+
|
62
|
+
def is_response_to_head(response):
|
63
|
+
"""
|
64
|
+
Checks whether the request of a response has been a HEAD-request.
|
65
|
+
Handles the quirks of AppEngine.
|
66
|
+
|
67
|
+
:param conn:
|
68
|
+
:type conn: :class:`httplib.HTTPResponse`
|
69
|
+
"""
|
70
|
+
# FIXME: Can we do this somehow without accessing private httplib _method?
|
71
|
+
method = response._method
|
72
|
+
if isinstance(method, int): # Platform-specific: Appengine
|
73
|
+
return method == 3
|
74
|
+
return method.upper() == 'HEAD'
|
Binary file
|
@@ -0,0 +1,300 @@
|
|
1
|
+
from __future__ import absolute_import
|
2
|
+
import time
|
3
|
+
import logging
|
4
|
+
|
5
|
+
from ..exceptions import (
|
6
|
+
ConnectTimeoutError,
|
7
|
+
MaxRetryError,
|
8
|
+
ProtocolError,
|
9
|
+
ReadTimeoutError,
|
10
|
+
ResponseError,
|
11
|
+
)
|
12
|
+
from ..packages import six
|
13
|
+
|
14
|
+
|
15
|
+
log = logging.getLogger(__name__)
|
16
|
+
|
17
|
+
|
18
|
+
class Retry(object):
|
19
|
+
""" Retry configuration.
|
20
|
+
|
21
|
+
Each retry attempt will create a new Retry object with updated values, so
|
22
|
+
they can be safely reused.
|
23
|
+
|
24
|
+
Retries can be defined as a default for a pool::
|
25
|
+
|
26
|
+
retries = Retry(connect=5, read=2, redirect=5)
|
27
|
+
http = PoolManager(retries=retries)
|
28
|
+
response = http.request('GET', 'http://example.com/')
|
29
|
+
|
30
|
+
Or per-request (which overrides the default for the pool)::
|
31
|
+
|
32
|
+
response = http.request('GET', 'http://example.com/', retries=Retry(10))
|
33
|
+
|
34
|
+
Retries can be disabled by passing ``False``::
|
35
|
+
|
36
|
+
response = http.request('GET', 'http://example.com/', retries=False)
|
37
|
+
|
38
|
+
Errors will be wrapped in :class:`~urllib3.exceptions.MaxRetryError` unless
|
39
|
+
retries are disabled, in which case the causing exception will be raised.
|
40
|
+
|
41
|
+
:param int total:
|
42
|
+
Total number of retries to allow. Takes precedence over other counts.
|
43
|
+
|
44
|
+
Set to ``None`` to remove this constraint and fall back on other
|
45
|
+
counts. It's a good idea to set this to some sensibly-high value to
|
46
|
+
account for unexpected edge cases and avoid infinite retry loops.
|
47
|
+
|
48
|
+
Set to ``0`` to fail on the first retry.
|
49
|
+
|
50
|
+
Set to ``False`` to disable and imply ``raise_on_redirect=False``.
|
51
|
+
|
52
|
+
:param int connect:
|
53
|
+
How many connection-related errors to retry on.
|
54
|
+
|
55
|
+
These are errors raised before the request is sent to the remote server,
|
56
|
+
which we assume has not triggered the server to process the request.
|
57
|
+
|
58
|
+
Set to ``0`` to fail on the first retry of this type.
|
59
|
+
|
60
|
+
:param int read:
|
61
|
+
How many times to retry on read errors.
|
62
|
+
|
63
|
+
These errors are raised after the request was sent to the server, so the
|
64
|
+
request may have side-effects.
|
65
|
+
|
66
|
+
Set to ``0`` to fail on the first retry of this type.
|
67
|
+
|
68
|
+
:param int redirect:
|
69
|
+
How many redirects to perform. Limit this to avoid infinite redirect
|
70
|
+
loops.
|
71
|
+
|
72
|
+
A redirect is a HTTP response with a status code 301, 302, 303, 307 or
|
73
|
+
308.
|
74
|
+
|
75
|
+
Set to ``0`` to fail on the first retry of this type.
|
76
|
+
|
77
|
+
Set to ``False`` to disable and imply ``raise_on_redirect=False``.
|
78
|
+
|
79
|
+
:param iterable method_whitelist:
|
80
|
+
Set of uppercased HTTP method verbs that we should retry on.
|
81
|
+
|
82
|
+
By default, we only retry on methods which are considered to be
|
83
|
+
idempotent (multiple requests with the same parameters end with the
|
84
|
+
same state). See :attr:`Retry.DEFAULT_METHOD_WHITELIST`.
|
85
|
+
|
86
|
+
Set to a ``False`` value to retry on any verb.
|
87
|
+
|
88
|
+
:param iterable status_forcelist:
|
89
|
+
A set of integer HTTP status codes that we should force a retry on.
|
90
|
+
A retry is initiated if the request method is in ``method_whitelist``
|
91
|
+
and the response status code is in ``status_forcelist``.
|
92
|
+
|
93
|
+
By default, this is disabled with ``None``.
|
94
|
+
|
95
|
+
:param float backoff_factor:
|
96
|
+
A backoff factor to apply between attempts after the second try
|
97
|
+
(most errors are resolved immediately by a second try without a
|
98
|
+
delay). urllib3 will sleep for::
|
99
|
+
|
100
|
+
{backoff factor} * (2 ^ ({number of total retries} - 1))
|
101
|
+
|
102
|
+
seconds. If the backoff_factor is 0.1, then :func:`.sleep` will sleep
|
103
|
+
for [0.0s, 0.2s, 0.4s, ...] between retries. It will never be longer
|
104
|
+
than :attr:`Retry.BACKOFF_MAX`.
|
105
|
+
|
106
|
+
By default, backoff is disabled (set to 0).
|
107
|
+
|
108
|
+
:param bool raise_on_redirect: Whether, if the number of redirects is
|
109
|
+
exhausted, to raise a MaxRetryError, or to return a response with a
|
110
|
+
response code in the 3xx range.
|
111
|
+
|
112
|
+
:param bool raise_on_status: Similar meaning to ``raise_on_redirect``:
|
113
|
+
whether we should raise an exception, or return a response,
|
114
|
+
if status falls in ``status_forcelist`` range and retries have
|
115
|
+
been exhausted.
|
116
|
+
"""
|
117
|
+
|
118
|
+
DEFAULT_METHOD_WHITELIST = frozenset([
|
119
|
+
'HEAD', 'GET', 'PUT', 'DELETE', 'OPTIONS', 'TRACE'])
|
120
|
+
|
121
|
+
#: Maximum backoff time.
|
122
|
+
BACKOFF_MAX = 120
|
123
|
+
|
124
|
+
def __init__(self, total=10, connect=None, read=None, redirect=None,
|
125
|
+
method_whitelist=DEFAULT_METHOD_WHITELIST, status_forcelist=None,
|
126
|
+
backoff_factor=0, raise_on_redirect=True, raise_on_status=True,
|
127
|
+
_observed_errors=0):
|
128
|
+
|
129
|
+
self.total = total
|
130
|
+
self.connect = connect
|
131
|
+
self.read = read
|
132
|
+
|
133
|
+
if redirect is False or total is False:
|
134
|
+
redirect = 0
|
135
|
+
raise_on_redirect = False
|
136
|
+
|
137
|
+
self.redirect = redirect
|
138
|
+
self.status_forcelist = status_forcelist or set()
|
139
|
+
self.method_whitelist = method_whitelist
|
140
|
+
self.backoff_factor = backoff_factor
|
141
|
+
self.raise_on_redirect = raise_on_redirect
|
142
|
+
self.raise_on_status = raise_on_status
|
143
|
+
self._observed_errors = _observed_errors # TODO: use .history instead?
|
144
|
+
|
145
|
+
def new(self, **kw):
|
146
|
+
params = dict(
|
147
|
+
total=self.total,
|
148
|
+
connect=self.connect, read=self.read, redirect=self.redirect,
|
149
|
+
method_whitelist=self.method_whitelist,
|
150
|
+
status_forcelist=self.status_forcelist,
|
151
|
+
backoff_factor=self.backoff_factor,
|
152
|
+
raise_on_redirect=self.raise_on_redirect,
|
153
|
+
raise_on_status=self.raise_on_status,
|
154
|
+
_observed_errors=self._observed_errors,
|
155
|
+
)
|
156
|
+
params.update(kw)
|
157
|
+
return type(self)(**params)
|
158
|
+
|
159
|
+
@classmethod
|
160
|
+
def from_int(cls, retries, redirect=True, default=None):
|
161
|
+
""" Backwards-compatibility for the old retries format."""
|
162
|
+
if retries is None:
|
163
|
+
retries = default if default is not None else cls.DEFAULT
|
164
|
+
|
165
|
+
if isinstance(retries, Retry):
|
166
|
+
return retries
|
167
|
+
|
168
|
+
redirect = bool(redirect) and None
|
169
|
+
new_retries = cls(retries, redirect=redirect)
|
170
|
+
log.debug("Converted retries value: %r -> %r", retries, new_retries)
|
171
|
+
return new_retries
|
172
|
+
|
173
|
+
def get_backoff_time(self):
|
174
|
+
""" Formula for computing the current backoff
|
175
|
+
|
176
|
+
:rtype: float
|
177
|
+
"""
|
178
|
+
if self._observed_errors <= 1:
|
179
|
+
return 0
|
180
|
+
|
181
|
+
backoff_value = self.backoff_factor * (2 ** (self._observed_errors - 1))
|
182
|
+
return min(self.BACKOFF_MAX, backoff_value)
|
183
|
+
|
184
|
+
def sleep(self):
|
185
|
+
""" Sleep between retry attempts using an exponential backoff.
|
186
|
+
|
187
|
+
By default, the backoff factor is 0 and this method will return
|
188
|
+
immediately.
|
189
|
+
"""
|
190
|
+
backoff = self.get_backoff_time()
|
191
|
+
if backoff <= 0:
|
192
|
+
return
|
193
|
+
time.sleep(backoff)
|
194
|
+
|
195
|
+
def _is_connection_error(self, err):
|
196
|
+
""" Errors when we're fairly sure that the server did not receive the
|
197
|
+
request, so it should be safe to retry.
|
198
|
+
"""
|
199
|
+
return isinstance(err, ConnectTimeoutError)
|
200
|
+
|
201
|
+
def _is_read_error(self, err):
|
202
|
+
""" Errors that occur after the request has been started, so we should
|
203
|
+
assume that the server began processing it.
|
204
|
+
"""
|
205
|
+
return isinstance(err, (ReadTimeoutError, ProtocolError))
|
206
|
+
|
207
|
+
def is_forced_retry(self, method, status_code):
|
208
|
+
""" Is this method/status code retryable? (Based on method/codes whitelists)
|
209
|
+
"""
|
210
|
+
if self.method_whitelist and method.upper() not in self.method_whitelist:
|
211
|
+
return False
|
212
|
+
|
213
|
+
return self.status_forcelist and status_code in self.status_forcelist
|
214
|
+
|
215
|
+
def is_exhausted(self):
|
216
|
+
""" Are we out of retries? """
|
217
|
+
retry_counts = (self.total, self.connect, self.read, self.redirect)
|
218
|
+
retry_counts = list(filter(None, retry_counts))
|
219
|
+
if not retry_counts:
|
220
|
+
return False
|
221
|
+
|
222
|
+
return min(retry_counts) < 0
|
223
|
+
|
224
|
+
def increment(self, method=None, url=None, response=None, error=None,
|
225
|
+
_pool=None, _stacktrace=None):
|
226
|
+
""" Return a new Retry object with incremented retry counters.
|
227
|
+
|
228
|
+
:param response: A response object, or None, if the server did not
|
229
|
+
return a response.
|
230
|
+
:type response: :class:`~urllib3.response.HTTPResponse`
|
231
|
+
:param Exception error: An error encountered during the request, or
|
232
|
+
None if the response was received successfully.
|
233
|
+
|
234
|
+
:return: A new ``Retry`` object.
|
235
|
+
"""
|
236
|
+
if self.total is False and error:
|
237
|
+
# Disabled, indicate to re-raise the error.
|
238
|
+
raise six.reraise(type(error), error, _stacktrace)
|
239
|
+
|
240
|
+
total = self.total
|
241
|
+
if total is not None:
|
242
|
+
total -= 1
|
243
|
+
|
244
|
+
_observed_errors = self._observed_errors
|
245
|
+
connect = self.connect
|
246
|
+
read = self.read
|
247
|
+
redirect = self.redirect
|
248
|
+
cause = 'unknown'
|
249
|
+
|
250
|
+
if error and self._is_connection_error(error):
|
251
|
+
# Connect retry?
|
252
|
+
if connect is False:
|
253
|
+
raise six.reraise(type(error), error, _stacktrace)
|
254
|
+
elif connect is not None:
|
255
|
+
connect -= 1
|
256
|
+
_observed_errors += 1
|
257
|
+
|
258
|
+
elif error and self._is_read_error(error):
|
259
|
+
# Read retry?
|
260
|
+
if read is False:
|
261
|
+
raise six.reraise(type(error), error, _stacktrace)
|
262
|
+
elif read is not None:
|
263
|
+
read -= 1
|
264
|
+
_observed_errors += 1
|
265
|
+
|
266
|
+
elif response and response.get_redirect_location():
|
267
|
+
# Redirect retry?
|
268
|
+
if redirect is not None:
|
269
|
+
redirect -= 1
|
270
|
+
cause = 'too many redirects'
|
271
|
+
|
272
|
+
else:
|
273
|
+
# Incrementing because of a server error like a 500 in
|
274
|
+
# status_forcelist and a the given method is in the whitelist
|
275
|
+
_observed_errors += 1
|
276
|
+
cause = ResponseError.GENERIC_ERROR
|
277
|
+
if response and response.status:
|
278
|
+
cause = ResponseError.SPECIFIC_ERROR.format(
|
279
|
+
status_code=response.status)
|
280
|
+
|
281
|
+
new_retry = self.new(
|
282
|
+
total=total,
|
283
|
+
connect=connect, read=read, redirect=redirect,
|
284
|
+
_observed_errors=_observed_errors)
|
285
|
+
|
286
|
+
if new_retry.is_exhausted():
|
287
|
+
raise MaxRetryError(_pool, url, error or ResponseError(cause))
|
288
|
+
|
289
|
+
log.debug("Incremented Retry for (url='%s'): %r", url, new_retry)
|
290
|
+
|
291
|
+
return new_retry
|
292
|
+
|
293
|
+
def __repr__(self):
|
294
|
+
return ('{cls.__name__}(total={self.total}, connect={self.connect}, '
|
295
|
+
'read={self.read}, redirect={self.redirect})').format(
|
296
|
+
cls=type(self), self=self)
|
297
|
+
|
298
|
+
|
299
|
+
# For backwards compatibility (equivalent to pre-v1.9):
|
300
|
+
Retry.DEFAULT = Retry(3)
|
Binary file
|