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
Binary file
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import sys
|
2
|
+
|
3
|
+
|
4
|
+
class VendorImporter:
|
5
|
+
"""
|
6
|
+
A PEP 302 meta path importer for finding optionally-vendored
|
7
|
+
or otherwise naturally-installed packages from root_name.
|
8
|
+
"""
|
9
|
+
|
10
|
+
def __init__(self, root_name, vendored_names=(), vendor_pkg=None):
|
11
|
+
self.root_name = root_name
|
12
|
+
self.vendored_names = set(vendored_names)
|
13
|
+
self.vendor_pkg = vendor_pkg or root_name.replace('extern', '_vendor')
|
14
|
+
|
15
|
+
@property
|
16
|
+
def search_path(self):
|
17
|
+
"""
|
18
|
+
Search first the vendor package then as a natural package.
|
19
|
+
"""
|
20
|
+
yield self.vendor_pkg + '.'
|
21
|
+
yield ''
|
22
|
+
|
23
|
+
def find_module(self, fullname, path=None):
|
24
|
+
"""
|
25
|
+
Return self when fullname starts with root_name and the
|
26
|
+
target module is one vendored through this importer.
|
27
|
+
"""
|
28
|
+
root, base, target = fullname.partition(self.root_name + '.')
|
29
|
+
if root:
|
30
|
+
return
|
31
|
+
if not any(map(target.startswith, self.vendored_names)):
|
32
|
+
return
|
33
|
+
return self
|
34
|
+
|
35
|
+
def load_module(self, fullname):
|
36
|
+
"""
|
37
|
+
Iterate over the search path to locate and load fullname.
|
38
|
+
"""
|
39
|
+
root, base, target = fullname.partition(self.root_name + '.')
|
40
|
+
for prefix in self.search_path:
|
41
|
+
try:
|
42
|
+
extant = prefix + target
|
43
|
+
__import__(extant)
|
44
|
+
mod = sys.modules[extant]
|
45
|
+
sys.modules[fullname] = mod
|
46
|
+
# mysterious hack:
|
47
|
+
# Remove the reference to the extant package/module
|
48
|
+
# on later Python versions to cause relative imports
|
49
|
+
# in the vendor package to resolve the same modules
|
50
|
+
# as those going through this importer.
|
51
|
+
if sys.version_info > (3, 3):
|
52
|
+
del sys.modules[extant]
|
53
|
+
return mod
|
54
|
+
except ImportError:
|
55
|
+
pass
|
56
|
+
else:
|
57
|
+
raise ImportError(
|
58
|
+
"The '{target}' package is required; "
|
59
|
+
"normally this is bundled with this package so if you get "
|
60
|
+
"this warning, consult the packager of your "
|
61
|
+
"distribution.".format(**locals())
|
62
|
+
)
|
63
|
+
|
64
|
+
def install(self):
|
65
|
+
"""
|
66
|
+
Install this importer into sys.meta_path if not already present.
|
67
|
+
"""
|
68
|
+
if self not in sys.meta_path:
|
69
|
+
sys.meta_path.append(self)
|
70
|
+
|
71
|
+
|
72
|
+
names = 'packaging', 'pyparsing', 'six', 'appdirs'
|
73
|
+
VendorImporter(__name__, names).install()
|
Binary file
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
# __
|
4
|
+
# /__) _ _ _ _ _/ _
|
5
|
+
# / ( (- (/ (/ (- _) / _)
|
6
|
+
# /
|
7
|
+
|
8
|
+
"""
|
9
|
+
Requests HTTP library
|
10
|
+
~~~~~~~~~~~~~~~~~~~~~
|
11
|
+
|
12
|
+
Requests is an HTTP library, written in Python, for human beings. Basic GET
|
13
|
+
usage:
|
14
|
+
|
15
|
+
>>> import requests
|
16
|
+
>>> r = requests.get('https://www.python.org')
|
17
|
+
>>> r.status_code
|
18
|
+
200
|
19
|
+
>>> 'Python is a programming language' in r.content
|
20
|
+
True
|
21
|
+
|
22
|
+
... or POST:
|
23
|
+
|
24
|
+
>>> payload = dict(key1='value1', key2='value2')
|
25
|
+
>>> r = requests.post('http://httpbin.org/post', data=payload)
|
26
|
+
>>> print(r.text)
|
27
|
+
{
|
28
|
+
...
|
29
|
+
"form": {
|
30
|
+
"key2": "value2",
|
31
|
+
"key1": "value1"
|
32
|
+
},
|
33
|
+
...
|
34
|
+
}
|
35
|
+
|
36
|
+
The other HTTP methods are supported - see `requests.api`. Full documentation
|
37
|
+
is at <http://python-requests.org>.
|
38
|
+
|
39
|
+
:copyright: (c) 2016 by Kenneth Reitz.
|
40
|
+
:license: Apache 2.0, see LICENSE for more details.
|
41
|
+
"""
|
42
|
+
|
43
|
+
__title__ = 'requests'
|
44
|
+
__version__ = '2.11.1'
|
45
|
+
__build__ = 0x021101
|
46
|
+
__author__ = 'Kenneth Reitz'
|
47
|
+
__license__ = 'Apache 2.0'
|
48
|
+
__copyright__ = 'Copyright 2016 Kenneth Reitz'
|
49
|
+
|
50
|
+
# Attempt to enable urllib3's SNI support, if possible
|
51
|
+
try:
|
52
|
+
from .packages.urllib3.contrib import pyopenssl
|
53
|
+
pyopenssl.inject_into_urllib3()
|
54
|
+
except ImportError:
|
55
|
+
pass
|
56
|
+
|
57
|
+
import warnings
|
58
|
+
|
59
|
+
# urllib3's DependencyWarnings should be silenced.
|
60
|
+
from .packages.urllib3.exceptions import DependencyWarning
|
61
|
+
warnings.simplefilter('ignore', DependencyWarning)
|
62
|
+
|
63
|
+
from . import utils
|
64
|
+
from .models import Request, Response, PreparedRequest
|
65
|
+
from .api import request, get, head, post, patch, put, delete, options
|
66
|
+
from .sessions import session, Session
|
67
|
+
from .status_codes import codes
|
68
|
+
from .exceptions import (
|
69
|
+
RequestException, Timeout, URLRequired,
|
70
|
+
TooManyRedirects, HTTPError, ConnectionError,
|
71
|
+
FileModeWarning, ConnectTimeout, ReadTimeout
|
72
|
+
)
|
73
|
+
|
74
|
+
# Set default logging handler to avoid "No handler found" warnings.
|
75
|
+
import logging
|
76
|
+
try: # Python 2.7+
|
77
|
+
from logging import NullHandler
|
78
|
+
except ImportError:
|
79
|
+
class NullHandler(logging.Handler):
|
80
|
+
def emit(self, record):
|
81
|
+
pass
|
82
|
+
|
83
|
+
logging.getLogger(__name__).addHandler(NullHandler())
|
84
|
+
|
85
|
+
# FileModeWarnings go off per the default.
|
86
|
+
warnings.simplefilter('default', FileModeWarning, append=True)
|
Binary file
|
@@ -0,0 +1,503 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
"""
|
4
|
+
requests.adapters
|
5
|
+
~~~~~~~~~~~~~~~~~
|
6
|
+
|
7
|
+
This module contains the transport adapters that Requests uses to define
|
8
|
+
and maintain connections.
|
9
|
+
"""
|
10
|
+
|
11
|
+
import os.path
|
12
|
+
import socket
|
13
|
+
|
14
|
+
from .models import Response
|
15
|
+
from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
|
16
|
+
from .packages.urllib3.response import HTTPResponse
|
17
|
+
from .packages.urllib3.util import Timeout as TimeoutSauce
|
18
|
+
from .packages.urllib3.util.retry import Retry
|
19
|
+
from .compat import urlparse, basestring
|
20
|
+
from .utils import (DEFAULT_CA_BUNDLE_PATH, get_encoding_from_headers,
|
21
|
+
prepend_scheme_if_needed, get_auth_from_url, urldefragauth,
|
22
|
+
select_proxy, to_native_string)
|
23
|
+
from .structures import CaseInsensitiveDict
|
24
|
+
from .packages.urllib3.exceptions import ClosedPoolError
|
25
|
+
from .packages.urllib3.exceptions import ConnectTimeoutError
|
26
|
+
from .packages.urllib3.exceptions import HTTPError as _HTTPError
|
27
|
+
from .packages.urllib3.exceptions import MaxRetryError
|
28
|
+
from .packages.urllib3.exceptions import NewConnectionError
|
29
|
+
from .packages.urllib3.exceptions import ProxyError as _ProxyError
|
30
|
+
from .packages.urllib3.exceptions import ProtocolError
|
31
|
+
from .packages.urllib3.exceptions import ReadTimeoutError
|
32
|
+
from .packages.urllib3.exceptions import SSLError as _SSLError
|
33
|
+
from .packages.urllib3.exceptions import ResponseError
|
34
|
+
from .cookies import extract_cookies_to_jar
|
35
|
+
from .exceptions import (ConnectionError, ConnectTimeout, ReadTimeout, SSLError,
|
36
|
+
ProxyError, RetryError, InvalidSchema)
|
37
|
+
from .auth import _basic_auth_str
|
38
|
+
|
39
|
+
try:
|
40
|
+
from .packages.urllib3.contrib.socks import SOCKSProxyManager
|
41
|
+
except ImportError:
|
42
|
+
def SOCKSProxyManager(*args, **kwargs):
|
43
|
+
raise InvalidSchema("Missing dependencies for SOCKS support.")
|
44
|
+
|
45
|
+
DEFAULT_POOLBLOCK = False
|
46
|
+
DEFAULT_POOLSIZE = 10
|
47
|
+
DEFAULT_RETRIES = 0
|
48
|
+
DEFAULT_POOL_TIMEOUT = None
|
49
|
+
|
50
|
+
|
51
|
+
class BaseAdapter(object):
|
52
|
+
"""The Base Transport Adapter"""
|
53
|
+
|
54
|
+
def __init__(self):
|
55
|
+
super(BaseAdapter, self).__init__()
|
56
|
+
|
57
|
+
def send(self, request, stream=False, timeout=None, verify=True,
|
58
|
+
cert=None, proxies=None):
|
59
|
+
"""Sends PreparedRequest object. Returns Response object.
|
60
|
+
|
61
|
+
:param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
|
62
|
+
:param stream: (optional) Whether to stream the request content.
|
63
|
+
:param timeout: (optional) How long to wait for the server to send
|
64
|
+
data before giving up, as a float, or a :ref:`(connect timeout,
|
65
|
+
read timeout) <timeouts>` tuple.
|
66
|
+
:type timeout: float or tuple
|
67
|
+
:param verify: (optional) Whether to verify SSL certificates.
|
68
|
+
:param cert: (optional) Any user-provided SSL certificate to be trusted.
|
69
|
+
:param proxies: (optional) The proxies dictionary to apply to the request.
|
70
|
+
"""
|
71
|
+
raise NotImplementedError
|
72
|
+
|
73
|
+
def close(self):
|
74
|
+
"""Cleans up adapter specific items."""
|
75
|
+
raise NotImplementedError
|
76
|
+
|
77
|
+
|
78
|
+
class HTTPAdapter(BaseAdapter):
|
79
|
+
"""The built-in HTTP Adapter for urllib3.
|
80
|
+
|
81
|
+
Provides a general-case interface for Requests sessions to contact HTTP and
|
82
|
+
HTTPS urls by implementing the Transport Adapter interface. This class will
|
83
|
+
usually be created by the :class:`Session <Session>` class under the
|
84
|
+
covers.
|
85
|
+
|
86
|
+
:param pool_connections: The number of urllib3 connection pools to cache.
|
87
|
+
:param pool_maxsize: The maximum number of connections to save in the pool.
|
88
|
+
:param max_retries: The maximum number of retries each connection
|
89
|
+
should attempt. Note, this applies only to failed DNS lookups, socket
|
90
|
+
connections and connection timeouts, never to requests where data has
|
91
|
+
made it to the server. By default, Requests does not retry failed
|
92
|
+
connections. If you need granular control over the conditions under
|
93
|
+
which we retry a request, import urllib3's ``Retry`` class and pass
|
94
|
+
that instead.
|
95
|
+
:param pool_block: Whether the connection pool should block for connections.
|
96
|
+
|
97
|
+
Usage::
|
98
|
+
|
99
|
+
>>> import requests
|
100
|
+
>>> s = requests.Session()
|
101
|
+
>>> a = requests.adapters.HTTPAdapter(max_retries=3)
|
102
|
+
>>> s.mount('http://', a)
|
103
|
+
"""
|
104
|
+
__attrs__ = ['max_retries', 'config', '_pool_connections', '_pool_maxsize',
|
105
|
+
'_pool_block']
|
106
|
+
|
107
|
+
def __init__(self, pool_connections=DEFAULT_POOLSIZE,
|
108
|
+
pool_maxsize=DEFAULT_POOLSIZE, max_retries=DEFAULT_RETRIES,
|
109
|
+
pool_block=DEFAULT_POOLBLOCK):
|
110
|
+
if max_retries == DEFAULT_RETRIES:
|
111
|
+
self.max_retries = Retry(0, read=False)
|
112
|
+
else:
|
113
|
+
self.max_retries = Retry.from_int(max_retries)
|
114
|
+
self.config = {}
|
115
|
+
self.proxy_manager = {}
|
116
|
+
|
117
|
+
super(HTTPAdapter, self).__init__()
|
118
|
+
|
119
|
+
self._pool_connections = pool_connections
|
120
|
+
self._pool_maxsize = pool_maxsize
|
121
|
+
self._pool_block = pool_block
|
122
|
+
|
123
|
+
self.init_poolmanager(pool_connections, pool_maxsize, block=pool_block)
|
124
|
+
|
125
|
+
def __getstate__(self):
|
126
|
+
return dict((attr, getattr(self, attr, None)) for attr in
|
127
|
+
self.__attrs__)
|
128
|
+
|
129
|
+
def __setstate__(self, state):
|
130
|
+
# Can't handle by adding 'proxy_manager' to self.__attrs__ because
|
131
|
+
# self.poolmanager uses a lambda function, which isn't pickleable.
|
132
|
+
self.proxy_manager = {}
|
133
|
+
self.config = {}
|
134
|
+
|
135
|
+
for attr, value in state.items():
|
136
|
+
setattr(self, attr, value)
|
137
|
+
|
138
|
+
self.init_poolmanager(self._pool_connections, self._pool_maxsize,
|
139
|
+
block=self._pool_block)
|
140
|
+
|
141
|
+
def init_poolmanager(self, connections, maxsize, block=DEFAULT_POOLBLOCK, **pool_kwargs):
|
142
|
+
"""Initializes a urllib3 PoolManager.
|
143
|
+
|
144
|
+
This method should not be called from user code, and is only
|
145
|
+
exposed for use when subclassing the
|
146
|
+
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
|
147
|
+
|
148
|
+
:param connections: The number of urllib3 connection pools to cache.
|
149
|
+
:param maxsize: The maximum number of connections to save in the pool.
|
150
|
+
:param block: Block when no free connections are available.
|
151
|
+
:param pool_kwargs: Extra keyword arguments used to initialize the Pool Manager.
|
152
|
+
"""
|
153
|
+
# save these values for pickling
|
154
|
+
self._pool_connections = connections
|
155
|
+
self._pool_maxsize = maxsize
|
156
|
+
self._pool_block = block
|
157
|
+
|
158
|
+
self.poolmanager = PoolManager(num_pools=connections, maxsize=maxsize,
|
159
|
+
block=block, strict=True, **pool_kwargs)
|
160
|
+
|
161
|
+
def proxy_manager_for(self, proxy, **proxy_kwargs):
|
162
|
+
"""Return urllib3 ProxyManager for the given proxy.
|
163
|
+
|
164
|
+
This method should not be called from user code, and is only
|
165
|
+
exposed for use when subclassing the
|
166
|
+
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
|
167
|
+
|
168
|
+
:param proxy: The proxy to return a urllib3 ProxyManager for.
|
169
|
+
:param proxy_kwargs: Extra keyword arguments used to configure the Proxy Manager.
|
170
|
+
:returns: ProxyManager
|
171
|
+
:rtype: requests.packages.urllib3.ProxyManager
|
172
|
+
"""
|
173
|
+
if proxy in self.proxy_manager:
|
174
|
+
manager = self.proxy_manager[proxy]
|
175
|
+
elif proxy.lower().startswith('socks'):
|
176
|
+
username, password = get_auth_from_url(proxy)
|
177
|
+
manager = self.proxy_manager[proxy] = SOCKSProxyManager(
|
178
|
+
proxy,
|
179
|
+
username=username,
|
180
|
+
password=password,
|
181
|
+
num_pools=self._pool_connections,
|
182
|
+
maxsize=self._pool_maxsize,
|
183
|
+
block=self._pool_block,
|
184
|
+
**proxy_kwargs
|
185
|
+
)
|
186
|
+
else:
|
187
|
+
proxy_headers = self.proxy_headers(proxy)
|
188
|
+
manager = self.proxy_manager[proxy] = proxy_from_url(
|
189
|
+
proxy,
|
190
|
+
proxy_headers=proxy_headers,
|
191
|
+
num_pools=self._pool_connections,
|
192
|
+
maxsize=self._pool_maxsize,
|
193
|
+
block=self._pool_block,
|
194
|
+
**proxy_kwargs)
|
195
|
+
|
196
|
+
return manager
|
197
|
+
|
198
|
+
def cert_verify(self, conn, url, verify, cert):
|
199
|
+
"""Verify a SSL certificate. This method should not be called from user
|
200
|
+
code, and is only exposed for use when subclassing the
|
201
|
+
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
|
202
|
+
|
203
|
+
:param conn: The urllib3 connection object associated with the cert.
|
204
|
+
:param url: The requested URL.
|
205
|
+
:param verify: Whether we should actually verify the certificate.
|
206
|
+
:param cert: The SSL certificate to verify.
|
207
|
+
"""
|
208
|
+
if url.lower().startswith('https') and verify:
|
209
|
+
|
210
|
+
cert_loc = None
|
211
|
+
|
212
|
+
# Allow self-specified cert location.
|
213
|
+
if verify is not True:
|
214
|
+
cert_loc = verify
|
215
|
+
|
216
|
+
if not cert_loc:
|
217
|
+
cert_loc = DEFAULT_CA_BUNDLE_PATH
|
218
|
+
|
219
|
+
if not cert_loc:
|
220
|
+
raise Exception("Could not find a suitable SSL CA certificate bundle.")
|
221
|
+
|
222
|
+
conn.cert_reqs = 'CERT_REQUIRED'
|
223
|
+
|
224
|
+
if not os.path.isdir(cert_loc):
|
225
|
+
conn.ca_certs = cert_loc
|
226
|
+
else:
|
227
|
+
conn.ca_cert_dir = cert_loc
|
228
|
+
else:
|
229
|
+
conn.cert_reqs = 'CERT_NONE'
|
230
|
+
conn.ca_certs = None
|
231
|
+
conn.ca_cert_dir = None
|
232
|
+
|
233
|
+
if cert:
|
234
|
+
if not isinstance(cert, basestring):
|
235
|
+
conn.cert_file = cert[0]
|
236
|
+
conn.key_file = cert[1]
|
237
|
+
else:
|
238
|
+
conn.cert_file = cert
|
239
|
+
|
240
|
+
def build_response(self, req, resp):
|
241
|
+
"""Builds a :class:`Response <requests.Response>` object from a urllib3
|
242
|
+
response. This should not be called from user code, and is only exposed
|
243
|
+
for use when subclassing the
|
244
|
+
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`
|
245
|
+
|
246
|
+
:param req: The :class:`PreparedRequest <PreparedRequest>` used to generate the response.
|
247
|
+
:param resp: The urllib3 response object.
|
248
|
+
:rtype: requests.Response
|
249
|
+
"""
|
250
|
+
response = Response()
|
251
|
+
|
252
|
+
# Fallback to None if there's no status_code, for whatever reason.
|
253
|
+
response.status_code = getattr(resp, 'status', None)
|
254
|
+
|
255
|
+
# Make headers case-insensitive.
|
256
|
+
response.headers = CaseInsensitiveDict(getattr(resp, 'headers', {}))
|
257
|
+
|
258
|
+
# Set encoding.
|
259
|
+
response.encoding = get_encoding_from_headers(response.headers)
|
260
|
+
response.raw = resp
|
261
|
+
response.reason = response.raw.reason
|
262
|
+
|
263
|
+
if isinstance(req.url, bytes):
|
264
|
+
response.url = req.url.decode('utf-8')
|
265
|
+
else:
|
266
|
+
response.url = req.url
|
267
|
+
|
268
|
+
# Add new cookies from the server.
|
269
|
+
extract_cookies_to_jar(response.cookies, req, resp)
|
270
|
+
|
271
|
+
# Give the Response some context.
|
272
|
+
response.request = req
|
273
|
+
response.connection = self
|
274
|
+
|
275
|
+
return response
|
276
|
+
|
277
|
+
def get_connection(self, url, proxies=None):
|
278
|
+
"""Returns a urllib3 connection for the given URL. This should not be
|
279
|
+
called from user code, and is only exposed for use when subclassing the
|
280
|
+
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
|
281
|
+
|
282
|
+
:param url: The URL to connect to.
|
283
|
+
:param proxies: (optional) A Requests-style dictionary of proxies used on this request.
|
284
|
+
:rtype: requests.packages.urllib3.ConnectionPool
|
285
|
+
"""
|
286
|
+
proxy = select_proxy(url, proxies)
|
287
|
+
|
288
|
+
if proxy:
|
289
|
+
proxy = prepend_scheme_if_needed(proxy, 'http')
|
290
|
+
proxy_manager = self.proxy_manager_for(proxy)
|
291
|
+
conn = proxy_manager.connection_from_url(url)
|
292
|
+
else:
|
293
|
+
# Only scheme should be lower case
|
294
|
+
parsed = urlparse(url)
|
295
|
+
url = parsed.geturl()
|
296
|
+
conn = self.poolmanager.connection_from_url(url)
|
297
|
+
|
298
|
+
return conn
|
299
|
+
|
300
|
+
def close(self):
|
301
|
+
"""Disposes of any internal state.
|
302
|
+
|
303
|
+
Currently, this closes the PoolManager and any active ProxyManager,
|
304
|
+
which closes any pooled connections.
|
305
|
+
"""
|
306
|
+
self.poolmanager.clear()
|
307
|
+
for proxy in self.proxy_manager.values():
|
308
|
+
proxy.clear()
|
309
|
+
|
310
|
+
def request_url(self, request, proxies):
|
311
|
+
"""Obtain the url to use when making the final request.
|
312
|
+
|
313
|
+
If the message is being sent through a HTTP proxy, the full URL has to
|
314
|
+
be used. Otherwise, we should only use the path portion of the URL.
|
315
|
+
|
316
|
+
This should not be called from user code, and is only exposed for use
|
317
|
+
when subclassing the
|
318
|
+
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
|
319
|
+
|
320
|
+
:param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
|
321
|
+
:param proxies: A dictionary of schemes or schemes and hosts to proxy URLs.
|
322
|
+
:rtype: str
|
323
|
+
"""
|
324
|
+
proxy = select_proxy(request.url, proxies)
|
325
|
+
scheme = urlparse(request.url).scheme
|
326
|
+
|
327
|
+
is_proxied_http_request = (proxy and scheme != 'https')
|
328
|
+
using_socks_proxy = False
|
329
|
+
if proxy:
|
330
|
+
proxy_scheme = urlparse(proxy).scheme.lower()
|
331
|
+
using_socks_proxy = proxy_scheme.startswith('socks')
|
332
|
+
|
333
|
+
url = request.path_url
|
334
|
+
if is_proxied_http_request and not using_socks_proxy:
|
335
|
+
url = urldefragauth(request.url)
|
336
|
+
|
337
|
+
return url
|
338
|
+
|
339
|
+
def add_headers(self, request, **kwargs):
|
340
|
+
"""Add any headers needed by the connection. As of v2.0 this does
|
341
|
+
nothing by default, but is left for overriding by users that subclass
|
342
|
+
the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
|
343
|
+
|
344
|
+
This should not be called from user code, and is only exposed for use
|
345
|
+
when subclassing the
|
346
|
+
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
|
347
|
+
|
348
|
+
:param request: The :class:`PreparedRequest <PreparedRequest>` to add headers to.
|
349
|
+
:param kwargs: The keyword arguments from the call to send().
|
350
|
+
"""
|
351
|
+
pass
|
352
|
+
|
353
|
+
def proxy_headers(self, proxy):
|
354
|
+
"""Returns a dictionary of the headers to add to any request sent
|
355
|
+
through a proxy. This works with urllib3 magic to ensure that they are
|
356
|
+
correctly sent to the proxy, rather than in a tunnelled request if
|
357
|
+
CONNECT is being used.
|
358
|
+
|
359
|
+
This should not be called from user code, and is only exposed for use
|
360
|
+
when subclassing the
|
361
|
+
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
|
362
|
+
|
363
|
+
:param proxies: The url of the proxy being used for this request.
|
364
|
+
:rtype: dict
|
365
|
+
"""
|
366
|
+
headers = {}
|
367
|
+
username, password = get_auth_from_url(proxy)
|
368
|
+
|
369
|
+
if username and password:
|
370
|
+
headers['Proxy-Authorization'] = _basic_auth_str(username,
|
371
|
+
password)
|
372
|
+
|
373
|
+
return headers
|
374
|
+
|
375
|
+
def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None):
|
376
|
+
"""Sends PreparedRequest object. Returns Response object.
|
377
|
+
|
378
|
+
:param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
|
379
|
+
:param stream: (optional) Whether to stream the request content.
|
380
|
+
:param timeout: (optional) How long to wait for the server to send
|
381
|
+
data before giving up, as a float, or a :ref:`(connect timeout,
|
382
|
+
read timeout) <timeouts>` tuple.
|
383
|
+
:type timeout: float or tuple
|
384
|
+
:param verify: (optional) Whether to verify SSL certificates.
|
385
|
+
:param cert: (optional) Any user-provided SSL certificate to be trusted.
|
386
|
+
:param proxies: (optional) The proxies dictionary to apply to the request.
|
387
|
+
:rtype: requests.Response
|
388
|
+
"""
|
389
|
+
|
390
|
+
conn = self.get_connection(request.url, proxies)
|
391
|
+
|
392
|
+
self.cert_verify(conn, request.url, verify, cert)
|
393
|
+
url = self.request_url(request, proxies)
|
394
|
+
self.add_headers(request)
|
395
|
+
|
396
|
+
chunked = not (request.body is None or 'Content-Length' in request.headers)
|
397
|
+
|
398
|
+
if isinstance(timeout, tuple):
|
399
|
+
try:
|
400
|
+
connect, read = timeout
|
401
|
+
timeout = TimeoutSauce(connect=connect, read=read)
|
402
|
+
except ValueError as e:
|
403
|
+
# this may raise a string formatting error.
|
404
|
+
err = ("Invalid timeout {0}. Pass a (connect, read) "
|
405
|
+
"timeout tuple, or a single float to set "
|
406
|
+
"both timeouts to the same value".format(timeout))
|
407
|
+
raise ValueError(err)
|
408
|
+
else:
|
409
|
+
timeout = TimeoutSauce(connect=timeout, read=timeout)
|
410
|
+
|
411
|
+
try:
|
412
|
+
if not chunked:
|
413
|
+
resp = conn.urlopen(
|
414
|
+
method=request.method,
|
415
|
+
url=url,
|
416
|
+
body=request.body,
|
417
|
+
headers=request.headers,
|
418
|
+
redirect=False,
|
419
|
+
assert_same_host=False,
|
420
|
+
preload_content=False,
|
421
|
+
decode_content=False,
|
422
|
+
retries=self.max_retries,
|
423
|
+
timeout=timeout
|
424
|
+
)
|
425
|
+
|
426
|
+
# Send the request.
|
427
|
+
else:
|
428
|
+
if hasattr(conn, 'proxy_pool'):
|
429
|
+
conn = conn.proxy_pool
|
430
|
+
|
431
|
+
low_conn = conn._get_conn(timeout=DEFAULT_POOL_TIMEOUT)
|
432
|
+
|
433
|
+
try:
|
434
|
+
low_conn.putrequest(request.method,
|
435
|
+
url,
|
436
|
+
skip_accept_encoding=True)
|
437
|
+
|
438
|
+
for header, value in request.headers.items():
|
439
|
+
low_conn.putheader(header, value)
|
440
|
+
|
441
|
+
low_conn.endheaders()
|
442
|
+
|
443
|
+
for i in request.body:
|
444
|
+
low_conn.send(hex(len(i))[2:].encode('utf-8'))
|
445
|
+
low_conn.send(b'\r\n')
|
446
|
+
low_conn.send(i)
|
447
|
+
low_conn.send(b'\r\n')
|
448
|
+
low_conn.send(b'0\r\n\r\n')
|
449
|
+
|
450
|
+
# Receive the response from the server
|
451
|
+
try:
|
452
|
+
# For Python 2.7+ versions, use buffering of HTTP
|
453
|
+
# responses
|
454
|
+
r = low_conn.getresponse(buffering=True)
|
455
|
+
except TypeError:
|
456
|
+
# For compatibility with Python 2.6 versions and back
|
457
|
+
r = low_conn.getresponse()
|
458
|
+
|
459
|
+
resp = HTTPResponse.from_httplib(
|
460
|
+
r,
|
461
|
+
pool=conn,
|
462
|
+
connection=low_conn,
|
463
|
+
preload_content=False,
|
464
|
+
decode_content=False
|
465
|
+
)
|
466
|
+
except:
|
467
|
+
# If we hit any problems here, clean up the connection.
|
468
|
+
# Then, reraise so that we can handle the actual exception.
|
469
|
+
low_conn.close()
|
470
|
+
raise
|
471
|
+
|
472
|
+
except (ProtocolError, socket.error) as err:
|
473
|
+
raise ConnectionError(err, request=request)
|
474
|
+
|
475
|
+
except MaxRetryError as e:
|
476
|
+
if isinstance(e.reason, ConnectTimeoutError):
|
477
|
+
# TODO: Remove this in 3.0.0: see #2811
|
478
|
+
if not isinstance(e.reason, NewConnectionError):
|
479
|
+
raise ConnectTimeout(e, request=request)
|
480
|
+
|
481
|
+
if isinstance(e.reason, ResponseError):
|
482
|
+
raise RetryError(e, request=request)
|
483
|
+
|
484
|
+
if isinstance(e.reason, _ProxyError):
|
485
|
+
raise ProxyError(e, request=request)
|
486
|
+
|
487
|
+
raise ConnectionError(e, request=request)
|
488
|
+
|
489
|
+
except ClosedPoolError as e:
|
490
|
+
raise ConnectionError(e, request=request)
|
491
|
+
|
492
|
+
except _ProxyError as e:
|
493
|
+
raise ProxyError(e)
|
494
|
+
|
495
|
+
except (_SSLError, _HTTPError) as e:
|
496
|
+
if isinstance(e, _SSLError):
|
497
|
+
raise SSLError(e, request=request)
|
498
|
+
elif isinstance(e, ReadTimeoutError):
|
499
|
+
raise ReadTimeout(e, request=request)
|
500
|
+
else:
|
501
|
+
raise
|
502
|
+
|
503
|
+
return self.build_response(request, resp)
|
Binary file
|