com.googler.python 1.0.8 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/python3.4.2/lib/python3.4/site-packages/pip/__init__.py +1 -277
- package/python3.4.2/lib/python3.4/site-packages/pip/__main__.py +19 -7
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/__init__.py +246 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/basecommand.py +373 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/{baseparser.py → _internal/baseparser.py} +240 -224
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/build_env.py +92 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/cache.py +202 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/cmdoptions.py +609 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/__init__.py +79 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/check.py +42 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/completion.py +94 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/configuration.py +227 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/download.py +233 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/freeze.py +96 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/hash.py +57 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/{commands → _internal/commands}/help.py +36 -33
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/install.py +477 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/list.py +343 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/search.py +135 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/show.py +164 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/uninstall.py +71 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/wheel.py +179 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/compat.py +235 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/configuration.py +378 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/download.py +922 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/exceptions.py +249 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/index.py +1117 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/locations.py +194 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/models/__init__.py +4 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/models/index.py +15 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/{_vendor/requests/packages/urllib3/contrib → _internal/operations}/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/operations/check.py +106 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/operations/freeze.py +252 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/operations/prepare.py +378 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/pep425tags.py +317 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/__init__.py +69 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/req_file.py +338 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/req_install.py +1115 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/req_set.py +164 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/req_uninstall.py +455 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/resolve.py +354 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/{status_codes.py → _internal/status_codes.py} +8 -6
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/appdirs.py +258 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/deprecation.py +77 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/encoding.py +33 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/filesystem.py +28 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/glibc.py +84 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/hashes.py +94 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/logging.py +132 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/misc.py +851 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/outdated.py +163 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/packaging.py +70 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/setuptools_build.py +8 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/temp_dir.py +82 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/typing.py +29 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/ui.py +421 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/__init__.py +471 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/bazaar.py +113 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/git.py +311 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/mercurial.py +105 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/subversion.py +271 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/wheel.py +817 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/__init__.py +109 -8
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/appdirs.py +604 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/__init__.py +11 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/_cmd.py +60 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/adapter.py +134 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/cache.py +39 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +2 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +133 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +43 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/compat.py +29 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/controller.py +373 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/filewrapper.py +78 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/heuristics.py +138 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/serialize.py +194 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/wrapper.py +27 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/certifi/__init__.py +3 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/certifi/__main__.py +2 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests → certifi}/cacert.pem +1765 -2358
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/certifi/core.py +37 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/__init__.py +39 -32
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/big5freq.py +386 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/big5prober.py +47 -42
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/chardistribution.py +233 -231
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/charsetgroupprober.py +106 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/charsetprober.py +145 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/cli/__init__.py +1 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/cli/chardetect.py +85 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/codingstatemachine.py +88 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/compat.py +34 -34
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/cp949prober.py +49 -44
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/enums.py +76 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/escprober.py +101 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/escsm.py +246 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/eucjpprober.py +92 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/euckrfreq.py +195 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/euckrprober.py +47 -42
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/euctwfreq.py +387 -428
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/euctwprober.py +46 -41
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/gb2312freq.py +283 -472
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/gb2312prober.py +46 -41
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/hebrewprober.py +292 -283
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/jisfreq.py +325 -569
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/jpcntx.py +233 -219
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langbulgarianmodel.py +228 -229
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langcyrillicmodel.py +333 -329
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langgreekmodel.py +225 -225
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langhebrewmodel.py +200 -201
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langhungarianmodel.py +225 -225
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langthaimodel.py +199 -200
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/langturkishmodel.py +193 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/latin1prober.py +145 -139
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/mbcharsetprober.py +91 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/mbcsgroupprober.py +54 -54
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/mbcssm.py +572 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/sbcharsetprober.py +132 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/sbcsgroupprober.py +73 -69
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/sjisprober.py +92 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/universaldetector.py +286 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/utf8prober.py +82 -76
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/version.py +9 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/__init__.py +7 -7
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/ansi.py +102 -50
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/ansitowin32.py +236 -190
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/initialise.py +82 -56
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/win32.py +156 -137
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/winterm.py +162 -120
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/__init__.py +23 -23
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/__init__.py +6 -6
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/misc.py +41 -41
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/shutil.py +761 -761
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/sysconfig.cfg +84 -84
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/sysconfig.py +788 -788
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/tarfile.py +2607 -2607
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/compat.py +1117 -1064
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/database.py +1318 -1301
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/index.py +516 -488
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/locators.py +1292 -1194
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/manifest.py +393 -364
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/markers.py +131 -190
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/metadata.py +1068 -1026
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/resources.py +355 -317
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/scripts.py +415 -323
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/t32.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/t64.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/util.py +1755 -1575
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/version.py +736 -721
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/w32.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/w64.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/wheel.py +984 -958
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distro.py +1104 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/__init__.py +35 -23
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{ihatexml.py → _ihatexml.py} +288 -285
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{inputstream.py → _inputstream.py} +923 -881
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{tokenizer.py → _tokenizer.py} +1721 -1731
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{trie → _trie}/__init__.py +14 -12
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{trie → _trie}/_base.py +37 -37
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{trie → _trie}/datrie.py +44 -44
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{trie → _trie}/py.py +67 -67
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{utils.py → _utils.py} +124 -82
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/constants.py +2947 -3104
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.py +29 -20
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/{_base.py → base.py} +12 -12
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py +73 -65
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/lint.py +93 -93
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/optionaltags.py +207 -205
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/sanitizer.py +896 -12
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/whitespace.py +38 -38
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/html5parser.py +2791 -2713
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/serializer.py +409 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treeadapters/__init__.py +30 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py +54 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treeadapters/sax.py +50 -44
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py +88 -76
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/{_base.py → base.py} +417 -377
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/dom.py +236 -227
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.py +340 -337
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py +366 -369
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py +154 -57
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/{_base.py → base.py} +252 -200
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/dom.py +43 -46
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/etree.py +130 -138
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/{lxmletree.py → etree_lxml.py} +213 -208
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/{genshistream.py → genshi.py} +69 -69
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/__init__.py +2 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/codec.py +118 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/compat.py +12 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/core.py +387 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/idnadata.py +1585 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/intranges.py +53 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/package_data.py +2 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/uts46data.py +7634 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/ipaddress.py +2419 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/__init__.py +347 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/linklockfile.py +73 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/mkdirlockfile.py +84 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/pidlockfile.py +190 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/sqlitelockfile.py +156 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/symlinklockfile.py +70 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/msgpack/__init__.py +66 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/msgpack/_version.py +1 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/msgpack/exceptions.py +41 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/msgpack/fallback.py +971 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/__about__.py +21 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/__init__.py +14 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/_compat.py +30 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/_structures.py +70 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/markers.py +301 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/requirements.py +130 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/specifiers.py +774 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/utils.py +63 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/version.py +441 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{pkg_resources.py → pkg_resources/__init__.py} +3125 -2762
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pkg_resources/py31compat.py +22 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/__init__.py +127 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/bar.py +88 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/counter.py +48 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/helpers.py +91 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/spinner.py +44 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pyparsing.py +5720 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pytoml/__init__.py +3 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pytoml/core.py +13 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pytoml/parser.py +374 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pytoml/writer.py +127 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/__init__.py +123 -77
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/__version__.py +14 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/_internal_utils.py +42 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/adapters.py +525 -388
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/api.py +152 -120
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/auth.py +293 -193
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/certs.py +18 -24
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/compat.py +73 -115
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/cookies.py +542 -454
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/exceptions.py +122 -75
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/help.py +120 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/hooks.py +34 -45
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/models.py +948 -803
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages.py +16 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/sessions.py +737 -637
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/status_codes.py +91 -88
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/structures.py +105 -127
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/utils.py +904 -673
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/retrying.py +267 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/six.py +891 -646
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/__init__.py +97 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/_collections.py +319 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/connection.py +373 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/connectionpool.py +905 -710
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +593 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +343 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/appengine.py +296 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/contrib/ntlmpool.py +112 -120
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +455 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +810 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/socks.py +188 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/exceptions.py +246 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/fields.py +178 -177
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/filepost.py +94 -100
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/packages/__init__.py +5 -4
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +53 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/packages/ordered_dict.py +259 -260
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/packages/six.py +868 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/packages/ssl_match_hostname/__init__.py +19 -13
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/packages/ssl_match_hostname/_implementation.py +157 -105
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/poolmanager.py +440 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/request.py +148 -141
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/response.py +626 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/__init__.py +54 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/connection.py +130 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/request.py +118 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/response.py +81 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/retry.py +401 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/selectors.py +581 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/ssl_.py +341 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/util/timeout.py +242 -234
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/util/url.py +230 -162
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/wait.py +40 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/__init__.py +342 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/labels.py +231 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/mklabels.py +59 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/tests.py +153 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/x_user_defined.py +325 -0
- package/python3.4.2/lib/python3.4/site-packages/pip-10.0.0.dist-info/LICENSE.txt +20 -0
- package/python3.4.2/lib/python3.4/site-packages/pip-10.0.0.dist-info/METADATA +78 -0
- package/python3.4.2/lib/python3.4/site-packages/pip-10.0.0.dist-info/RECORD +294 -0
- package/python3.4.2/lib/python3.4/site-packages/{pip-1.5.6.dist-info → pip-10.0.0.dist-info}/WHEEL +6 -6
- package/python3.4.2/lib/python3.4/site-packages/pip-10.0.0.dist-info/entry_points.txt +5 -0
- package/python3.4.2/lib/python3.4/site-packages/{pip-1.5.6.dist-info → pip-10.0.0.dist-info}/top_level.txt +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/_markerlib/__init__.py +0 -16
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/_markerlib/markers.py +0 -119
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/sanitizer.py +0 -271
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/serializer/__init__.py +0 -16
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.py +0 -320
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py +0 -63
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/re-vendor.py +0 -34
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/__init__.py +0 -3
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py +0 -925
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/chardetect.py +0 -46
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py +0 -106
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py +0 -62
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py +0 -61
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/constants.py +0 -39
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/escprober.py +0 -86
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/escsm.py +0 -242
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.py +0 -90
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/euckrfreq.py +0 -596
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.py +0 -86
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py +0 -575
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/sbcharsetprober.py +0 -120
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py +0 -91
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py +0 -170
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py +0 -58
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py +0 -205
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/connection.py +0 -204
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py +0 -422
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py +0 -126
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py +0 -385
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py +0 -258
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/response.py +0 -308
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/__init__.py +0 -27
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py +0 -45
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/request.py +0 -68
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/response.py +0 -13
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py +0 -133
- package/python3.4.2/lib/python3.4/site-packages/pip/backwardcompat/__init__.py +0 -138
- package/python3.4.2/lib/python3.4/site-packages/pip/basecommand.py +0 -201
- package/python3.4.2/lib/python3.4/site-packages/pip/cmdoptions.py +0 -371
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/__init__.py +0 -88
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/bundle.py +0 -42
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/completion.py +0 -59
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/freeze.py +0 -114
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/install.py +0 -314
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/list.py +0 -162
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/search.py +0 -132
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/show.py +0 -80
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/uninstall.py +0 -59
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/unzip.py +0 -7
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/wheel.py +0 -195
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/zip.py +0 -351
- package/python3.4.2/lib/python3.4/site-packages/pip/download.py +0 -644
- package/python3.4.2/lib/python3.4/site-packages/pip/exceptions.py +0 -46
- package/python3.4.2/lib/python3.4/site-packages/pip/index.py +0 -990
- package/python3.4.2/lib/python3.4/site-packages/pip/locations.py +0 -171
- package/python3.4.2/lib/python3.4/site-packages/pip/log.py +0 -276
- package/python3.4.2/lib/python3.4/site-packages/pip/pep425tags.py +0 -102
- package/python3.4.2/lib/python3.4/site-packages/pip/req.py +0 -1931
- package/python3.4.2/lib/python3.4/site-packages/pip/runner.py +0 -18
- package/python3.4.2/lib/python3.4/site-packages/pip/util.py +0 -720
- package/python3.4.2/lib/python3.4/site-packages/pip/vcs/__init__.py +0 -251
- package/python3.4.2/lib/python3.4/site-packages/pip/vcs/bazaar.py +0 -131
- package/python3.4.2/lib/python3.4/site-packages/pip/vcs/git.py +0 -194
- package/python3.4.2/lib/python3.4/site-packages/pip/vcs/mercurial.py +0 -151
- package/python3.4.2/lib/python3.4/site-packages/pip/vcs/subversion.py +0 -273
- package/python3.4.2/lib/python3.4/site-packages/pip/wheel.py +0 -560
- package/python3.4.2/lib/python3.4/site-packages/pip-1.5.6.dist-info/DESCRIPTION.rst +0 -71
- package/python3.4.2/lib/python3.4/site-packages/pip-1.5.6.dist-info/METADATA +0 -98
- package/python3.4.2/lib/python3.4/site-packages/pip-1.5.6.dist-info/RECORD +0 -373
- package/python3.4.2/lib/python3.4/site-packages/pip-1.5.6.dist-info/entry_points.txt +0 -5
- package/python3.4.2/lib/python3.4/site-packages/pip-1.5.6.dist-info/metadata.json +0 -1
package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py
DELETED
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
# urllib3/poolmanager.py
|
|
2
|
-
# Copyright 2008-2014 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
|
|
3
|
-
#
|
|
4
|
-
# This module is part of urllib3 and is released under
|
|
5
|
-
# the MIT License: http://www.opensource.org/licenses/mit-license.php
|
|
6
|
-
|
|
7
|
-
import logging
|
|
8
|
-
|
|
9
|
-
try: # Python 3
|
|
10
|
-
from urllib.parse import urljoin
|
|
11
|
-
except ImportError:
|
|
12
|
-
from urlparse import urljoin
|
|
13
|
-
|
|
14
|
-
from ._collections import RecentlyUsedContainer
|
|
15
|
-
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool
|
|
16
|
-
from .connectionpool import port_by_scheme
|
|
17
|
-
from .request import RequestMethods
|
|
18
|
-
from .util import parse_url
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
__all__ = ['PoolManager', 'ProxyManager', 'proxy_from_url']
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
pool_classes_by_scheme = {
|
|
25
|
-
'http': HTTPConnectionPool,
|
|
26
|
-
'https': HTTPSConnectionPool,
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
log = logging.getLogger(__name__)
|
|
30
|
-
|
|
31
|
-
SSL_KEYWORDS = ('key_file', 'cert_file', 'cert_reqs', 'ca_certs',
|
|
32
|
-
'ssl_version')
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class PoolManager(RequestMethods):
|
|
36
|
-
"""
|
|
37
|
-
Allows for arbitrary requests while transparently keeping track of
|
|
38
|
-
necessary connection pools for you.
|
|
39
|
-
|
|
40
|
-
:param num_pools:
|
|
41
|
-
Number of connection pools to cache before discarding the least
|
|
42
|
-
recently used pool.
|
|
43
|
-
|
|
44
|
-
:param headers:
|
|
45
|
-
Headers to include with all requests, unless other headers are given
|
|
46
|
-
explicitly.
|
|
47
|
-
|
|
48
|
-
:param \**connection_pool_kw:
|
|
49
|
-
Additional parameters are used to create fresh
|
|
50
|
-
:class:`urllib3.connectionpool.ConnectionPool` instances.
|
|
51
|
-
|
|
52
|
-
Example: ::
|
|
53
|
-
|
|
54
|
-
>>> manager = PoolManager(num_pools=2)
|
|
55
|
-
>>> r = manager.request('GET', 'http://google.com/')
|
|
56
|
-
>>> r = manager.request('GET', 'http://google.com/mail')
|
|
57
|
-
>>> r = manager.request('GET', 'http://yahoo.com/')
|
|
58
|
-
>>> len(manager.pools)
|
|
59
|
-
2
|
|
60
|
-
|
|
61
|
-
"""
|
|
62
|
-
|
|
63
|
-
proxy = None
|
|
64
|
-
|
|
65
|
-
def __init__(self, num_pools=10, headers=None, **connection_pool_kw):
|
|
66
|
-
RequestMethods.__init__(self, headers)
|
|
67
|
-
self.connection_pool_kw = connection_pool_kw
|
|
68
|
-
self.pools = RecentlyUsedContainer(num_pools,
|
|
69
|
-
dispose_func=lambda p: p.close())
|
|
70
|
-
|
|
71
|
-
def _new_pool(self, scheme, host, port):
|
|
72
|
-
"""
|
|
73
|
-
Create a new :class:`ConnectionPool` based on host, port and scheme.
|
|
74
|
-
|
|
75
|
-
This method is used to actually create the connection pools handed out
|
|
76
|
-
by :meth:`connection_from_url` and companion methods. It is intended
|
|
77
|
-
to be overridden for customization.
|
|
78
|
-
"""
|
|
79
|
-
pool_cls = pool_classes_by_scheme[scheme]
|
|
80
|
-
kwargs = self.connection_pool_kw
|
|
81
|
-
if scheme == 'http':
|
|
82
|
-
kwargs = self.connection_pool_kw.copy()
|
|
83
|
-
for kw in SSL_KEYWORDS:
|
|
84
|
-
kwargs.pop(kw, None)
|
|
85
|
-
|
|
86
|
-
return pool_cls(host, port, **kwargs)
|
|
87
|
-
|
|
88
|
-
def clear(self):
|
|
89
|
-
"""
|
|
90
|
-
Empty our store of pools and direct them all to close.
|
|
91
|
-
|
|
92
|
-
This will not affect in-flight connections, but they will not be
|
|
93
|
-
re-used after completion.
|
|
94
|
-
"""
|
|
95
|
-
self.pools.clear()
|
|
96
|
-
|
|
97
|
-
def connection_from_host(self, host, port=None, scheme='http'):
|
|
98
|
-
"""
|
|
99
|
-
Get a :class:`ConnectionPool` based on the host, port, and scheme.
|
|
100
|
-
|
|
101
|
-
If ``port`` isn't given, it will be derived from the ``scheme`` using
|
|
102
|
-
``urllib3.connectionpool.port_by_scheme``.
|
|
103
|
-
"""
|
|
104
|
-
|
|
105
|
-
scheme = scheme or 'http'
|
|
106
|
-
|
|
107
|
-
port = port or port_by_scheme.get(scheme, 80)
|
|
108
|
-
|
|
109
|
-
pool_key = (scheme, host, port)
|
|
110
|
-
|
|
111
|
-
with self.pools.lock:
|
|
112
|
-
# If the scheme, host, or port doesn't match existing open
|
|
113
|
-
# connections, open a new ConnectionPool.
|
|
114
|
-
pool = self.pools.get(pool_key)
|
|
115
|
-
if pool:
|
|
116
|
-
return pool
|
|
117
|
-
|
|
118
|
-
# Make a fresh ConnectionPool of the desired type
|
|
119
|
-
pool = self._new_pool(scheme, host, port)
|
|
120
|
-
self.pools[pool_key] = pool
|
|
121
|
-
return pool
|
|
122
|
-
|
|
123
|
-
def connection_from_url(self, url):
|
|
124
|
-
"""
|
|
125
|
-
Similar to :func:`urllib3.connectionpool.connection_from_url` but
|
|
126
|
-
doesn't pass any additional parameters to the
|
|
127
|
-
:class:`urllib3.connectionpool.ConnectionPool` constructor.
|
|
128
|
-
|
|
129
|
-
Additional parameters are taken from the :class:`.PoolManager`
|
|
130
|
-
constructor.
|
|
131
|
-
"""
|
|
132
|
-
u = parse_url(url)
|
|
133
|
-
return self.connection_from_host(u.host, port=u.port, scheme=u.scheme)
|
|
134
|
-
|
|
135
|
-
def urlopen(self, method, url, redirect=True, **kw):
|
|
136
|
-
"""
|
|
137
|
-
Same as :meth:`urllib3.connectionpool.HTTPConnectionPool.urlopen`
|
|
138
|
-
with custom cross-host redirect logic and only sends the request-uri
|
|
139
|
-
portion of the ``url``.
|
|
140
|
-
|
|
141
|
-
The given ``url`` parameter must be absolute, such that an appropriate
|
|
142
|
-
:class:`urllib3.connectionpool.ConnectionPool` can be chosen for it.
|
|
143
|
-
"""
|
|
144
|
-
u = parse_url(url)
|
|
145
|
-
conn = self.connection_from_host(u.host, port=u.port, scheme=u.scheme)
|
|
146
|
-
|
|
147
|
-
kw['assert_same_host'] = False
|
|
148
|
-
kw['redirect'] = False
|
|
149
|
-
if 'headers' not in kw:
|
|
150
|
-
kw['headers'] = self.headers
|
|
151
|
-
|
|
152
|
-
if self.proxy is not None and u.scheme == "http":
|
|
153
|
-
response = conn.urlopen(method, url, **kw)
|
|
154
|
-
else:
|
|
155
|
-
response = conn.urlopen(method, u.request_uri, **kw)
|
|
156
|
-
|
|
157
|
-
redirect_location = redirect and response.get_redirect_location()
|
|
158
|
-
if not redirect_location:
|
|
159
|
-
return response
|
|
160
|
-
|
|
161
|
-
# Support relative URLs for redirecting.
|
|
162
|
-
redirect_location = urljoin(url, redirect_location)
|
|
163
|
-
|
|
164
|
-
# RFC 2616, Section 10.3.4
|
|
165
|
-
if response.status == 303:
|
|
166
|
-
method = 'GET'
|
|
167
|
-
|
|
168
|
-
log.info("Redirecting %s -> %s" % (url, redirect_location))
|
|
169
|
-
kw['retries'] = kw.get('retries', 3) - 1 # Persist retries countdown
|
|
170
|
-
kw['redirect'] = redirect
|
|
171
|
-
return self.urlopen(method, redirect_location, **kw)
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
class ProxyManager(PoolManager):
|
|
175
|
-
"""
|
|
176
|
-
Behaves just like :class:`PoolManager`, but sends all requests through
|
|
177
|
-
the defined proxy, using the CONNECT method for HTTPS URLs.
|
|
178
|
-
|
|
179
|
-
:param proxy_url:
|
|
180
|
-
The URL of the proxy to be used.
|
|
181
|
-
|
|
182
|
-
:param proxy_headers:
|
|
183
|
-
A dictionary contaning headers that will be sent to the proxy. In case
|
|
184
|
-
of HTTP they are being sent with each request, while in the
|
|
185
|
-
HTTPS/CONNECT case they are sent only once. Could be used for proxy
|
|
186
|
-
authentication.
|
|
187
|
-
|
|
188
|
-
Example:
|
|
189
|
-
>>> proxy = urllib3.ProxyManager('http://localhost:3128/')
|
|
190
|
-
>>> r1 = proxy.request('GET', 'http://google.com/')
|
|
191
|
-
>>> r2 = proxy.request('GET', 'http://httpbin.org/')
|
|
192
|
-
>>> len(proxy.pools)
|
|
193
|
-
1
|
|
194
|
-
>>> r3 = proxy.request('GET', 'https://httpbin.org/')
|
|
195
|
-
>>> r4 = proxy.request('GET', 'https://twitter.com/')
|
|
196
|
-
>>> len(proxy.pools)
|
|
197
|
-
3
|
|
198
|
-
|
|
199
|
-
"""
|
|
200
|
-
|
|
201
|
-
def __init__(self, proxy_url, num_pools=10, headers=None,
|
|
202
|
-
proxy_headers=None, **connection_pool_kw):
|
|
203
|
-
|
|
204
|
-
if isinstance(proxy_url, HTTPConnectionPool):
|
|
205
|
-
proxy_url = '%s://%s:%i' % (proxy_url.scheme, proxy_url.host,
|
|
206
|
-
proxy_url.port)
|
|
207
|
-
proxy = parse_url(proxy_url)
|
|
208
|
-
if not proxy.port:
|
|
209
|
-
port = port_by_scheme.get(proxy.scheme, 80)
|
|
210
|
-
proxy = proxy._replace(port=port)
|
|
211
|
-
self.proxy = proxy
|
|
212
|
-
self.proxy_headers = proxy_headers or {}
|
|
213
|
-
assert self.proxy.scheme in ("http", "https"), \
|
|
214
|
-
'Not supported proxy scheme %s' % self.proxy.scheme
|
|
215
|
-
connection_pool_kw['_proxy'] = self.proxy
|
|
216
|
-
connection_pool_kw['_proxy_headers'] = self.proxy_headers
|
|
217
|
-
super(ProxyManager, self).__init__(
|
|
218
|
-
num_pools, headers, **connection_pool_kw)
|
|
219
|
-
|
|
220
|
-
def connection_from_host(self, host, port=None, scheme='http'):
|
|
221
|
-
if scheme == "https":
|
|
222
|
-
return super(ProxyManager, self).connection_from_host(
|
|
223
|
-
host, port, scheme)
|
|
224
|
-
|
|
225
|
-
return super(ProxyManager, self).connection_from_host(
|
|
226
|
-
self.proxy.host, self.proxy.port, self.proxy.scheme)
|
|
227
|
-
|
|
228
|
-
def _set_proxy_headers(self, url, headers=None):
|
|
229
|
-
"""
|
|
230
|
-
Sets headers needed by proxies: specifically, the Accept and Host
|
|
231
|
-
headers. Only sets headers not provided by the user.
|
|
232
|
-
"""
|
|
233
|
-
headers_ = {'Accept': '*/*'}
|
|
234
|
-
|
|
235
|
-
netloc = parse_url(url).netloc
|
|
236
|
-
if netloc:
|
|
237
|
-
headers_['Host'] = netloc
|
|
238
|
-
|
|
239
|
-
if headers:
|
|
240
|
-
headers_.update(headers)
|
|
241
|
-
return headers_
|
|
242
|
-
|
|
243
|
-
def urlopen(self, method, url, redirect=True, **kw):
|
|
244
|
-
"Same as HTTP(S)ConnectionPool.urlopen, ``url`` must be absolute."
|
|
245
|
-
u = parse_url(url)
|
|
246
|
-
|
|
247
|
-
if u.scheme == "http":
|
|
248
|
-
# For proxied HTTPS requests, httplib sets the necessary headers
|
|
249
|
-
# on the CONNECT to the proxy. For HTTP, we'll definitely
|
|
250
|
-
# need to set 'Host' at the very least.
|
|
251
|
-
kw['headers'] = self._set_proxy_headers(url, kw.get('headers',
|
|
252
|
-
self.headers))
|
|
253
|
-
|
|
254
|
-
return super(ProxyManager, self).urlopen(method, url, redirect, **kw)
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
def proxy_from_url(url, **kw):
|
|
258
|
-
return ProxyManager(proxy_url=url, **kw)
|
package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/response.py
DELETED
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
# urllib3/response.py
|
|
2
|
-
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
|
|
3
|
-
#
|
|
4
|
-
# This module is part of urllib3 and is released under
|
|
5
|
-
# the MIT License: http://www.opensource.org/licenses/mit-license.php
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import logging
|
|
9
|
-
import zlib
|
|
10
|
-
import io
|
|
11
|
-
|
|
12
|
-
from ._collections import HTTPHeaderDict
|
|
13
|
-
from .exceptions import DecodeError
|
|
14
|
-
from .packages.six import string_types as basestring, binary_type
|
|
15
|
-
from .util import is_fp_closed
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
log = logging.getLogger(__name__)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class DeflateDecoder(object):
|
|
22
|
-
|
|
23
|
-
def __init__(self):
|
|
24
|
-
self._first_try = True
|
|
25
|
-
self._data = binary_type()
|
|
26
|
-
self._obj = zlib.decompressobj()
|
|
27
|
-
|
|
28
|
-
def __getattr__(self, name):
|
|
29
|
-
return getattr(self._obj, name)
|
|
30
|
-
|
|
31
|
-
def decompress(self, data):
|
|
32
|
-
if not self._first_try:
|
|
33
|
-
return self._obj.decompress(data)
|
|
34
|
-
|
|
35
|
-
self._data += data
|
|
36
|
-
try:
|
|
37
|
-
return self._obj.decompress(data)
|
|
38
|
-
except zlib.error:
|
|
39
|
-
self._first_try = False
|
|
40
|
-
self._obj = zlib.decompressobj(-zlib.MAX_WBITS)
|
|
41
|
-
try:
|
|
42
|
-
return self.decompress(self._data)
|
|
43
|
-
finally:
|
|
44
|
-
self._data = None
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
def _get_decoder(mode):
|
|
48
|
-
if mode == 'gzip':
|
|
49
|
-
return zlib.decompressobj(16 + zlib.MAX_WBITS)
|
|
50
|
-
|
|
51
|
-
return DeflateDecoder()
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
class HTTPResponse(io.IOBase):
|
|
55
|
-
"""
|
|
56
|
-
HTTP Response container.
|
|
57
|
-
|
|
58
|
-
Backwards-compatible to httplib's HTTPResponse but the response ``body`` is
|
|
59
|
-
loaded and decoded on-demand when the ``data`` property is accessed.
|
|
60
|
-
|
|
61
|
-
Extra parameters for behaviour not present in httplib.HTTPResponse:
|
|
62
|
-
|
|
63
|
-
:param preload_content:
|
|
64
|
-
If True, the response's body will be preloaded during construction.
|
|
65
|
-
|
|
66
|
-
:param decode_content:
|
|
67
|
-
If True, attempts to decode specific content-encoding's based on headers
|
|
68
|
-
(like 'gzip' and 'deflate') will be skipped and raw data will be used
|
|
69
|
-
instead.
|
|
70
|
-
|
|
71
|
-
:param original_response:
|
|
72
|
-
When this HTTPResponse wrapper is generated from an httplib.HTTPResponse
|
|
73
|
-
object, it's convenient to include the original for debug purposes. It's
|
|
74
|
-
otherwise unused.
|
|
75
|
-
"""
|
|
76
|
-
|
|
77
|
-
CONTENT_DECODERS = ['gzip', 'deflate']
|
|
78
|
-
REDIRECT_STATUSES = [301, 302, 303, 307, 308]
|
|
79
|
-
|
|
80
|
-
def __init__(self, body='', headers=None, status=0, version=0, reason=None,
|
|
81
|
-
strict=0, preload_content=True, decode_content=True,
|
|
82
|
-
original_response=None, pool=None, connection=None):
|
|
83
|
-
|
|
84
|
-
self.headers = HTTPHeaderDict()
|
|
85
|
-
if headers:
|
|
86
|
-
self.headers.update(headers)
|
|
87
|
-
self.status = status
|
|
88
|
-
self.version = version
|
|
89
|
-
self.reason = reason
|
|
90
|
-
self.strict = strict
|
|
91
|
-
self.decode_content = decode_content
|
|
92
|
-
|
|
93
|
-
self._decoder = None
|
|
94
|
-
self._body = body if body and isinstance(body, basestring) else None
|
|
95
|
-
self._fp = None
|
|
96
|
-
self._original_response = original_response
|
|
97
|
-
self._fp_bytes_read = 0
|
|
98
|
-
|
|
99
|
-
self._pool = pool
|
|
100
|
-
self._connection = connection
|
|
101
|
-
|
|
102
|
-
if hasattr(body, 'read'):
|
|
103
|
-
self._fp = body
|
|
104
|
-
|
|
105
|
-
if preload_content and not self._body:
|
|
106
|
-
self._body = self.read(decode_content=decode_content)
|
|
107
|
-
|
|
108
|
-
def get_redirect_location(self):
|
|
109
|
-
"""
|
|
110
|
-
Should we redirect and where to?
|
|
111
|
-
|
|
112
|
-
:returns: Truthy redirect location string if we got a redirect status
|
|
113
|
-
code and valid location. ``None`` if redirect status and no
|
|
114
|
-
location. ``False`` if not a redirect status code.
|
|
115
|
-
"""
|
|
116
|
-
if self.status in self.REDIRECT_STATUSES:
|
|
117
|
-
return self.headers.get('location')
|
|
118
|
-
|
|
119
|
-
return False
|
|
120
|
-
|
|
121
|
-
def release_conn(self):
|
|
122
|
-
if not self._pool or not self._connection:
|
|
123
|
-
return
|
|
124
|
-
|
|
125
|
-
self._pool._put_conn(self._connection)
|
|
126
|
-
self._connection = None
|
|
127
|
-
|
|
128
|
-
@property
|
|
129
|
-
def data(self):
|
|
130
|
-
# For backwords-compat with earlier urllib3 0.4 and earlier.
|
|
131
|
-
if self._body:
|
|
132
|
-
return self._body
|
|
133
|
-
|
|
134
|
-
if self._fp:
|
|
135
|
-
return self.read(cache_content=True)
|
|
136
|
-
|
|
137
|
-
def tell(self):
|
|
138
|
-
"""
|
|
139
|
-
Obtain the number of bytes pulled over the wire so far. May differ from
|
|
140
|
-
the amount of content returned by :meth:``HTTPResponse.read`` if bytes
|
|
141
|
-
are encoded on the wire (e.g, compressed).
|
|
142
|
-
"""
|
|
143
|
-
return self._fp_bytes_read
|
|
144
|
-
|
|
145
|
-
def read(self, amt=None, decode_content=None, cache_content=False):
|
|
146
|
-
"""
|
|
147
|
-
Similar to :meth:`httplib.HTTPResponse.read`, but with two additional
|
|
148
|
-
parameters: ``decode_content`` and ``cache_content``.
|
|
149
|
-
|
|
150
|
-
:param amt:
|
|
151
|
-
How much of the content to read. If specified, caching is skipped
|
|
152
|
-
because it doesn't make sense to cache partial content as the full
|
|
153
|
-
response.
|
|
154
|
-
|
|
155
|
-
:param decode_content:
|
|
156
|
-
If True, will attempt to decode the body based on the
|
|
157
|
-
'content-encoding' header.
|
|
158
|
-
|
|
159
|
-
:param cache_content:
|
|
160
|
-
If True, will save the returned data such that the same result is
|
|
161
|
-
returned despite of the state of the underlying file object. This
|
|
162
|
-
is useful if you want the ``.data`` property to continue working
|
|
163
|
-
after having ``.read()`` the file object. (Overridden if ``amt`` is
|
|
164
|
-
set.)
|
|
165
|
-
"""
|
|
166
|
-
# Note: content-encoding value should be case-insensitive, per RFC 2616
|
|
167
|
-
# Section 3.5
|
|
168
|
-
content_encoding = self.headers.get('content-encoding', '').lower()
|
|
169
|
-
if self._decoder is None:
|
|
170
|
-
if content_encoding in self.CONTENT_DECODERS:
|
|
171
|
-
self._decoder = _get_decoder(content_encoding)
|
|
172
|
-
if decode_content is None:
|
|
173
|
-
decode_content = self.decode_content
|
|
174
|
-
|
|
175
|
-
if self._fp is None:
|
|
176
|
-
return
|
|
177
|
-
|
|
178
|
-
flush_decoder = False
|
|
179
|
-
|
|
180
|
-
try:
|
|
181
|
-
if amt is None:
|
|
182
|
-
# cStringIO doesn't like amt=None
|
|
183
|
-
data = self._fp.read()
|
|
184
|
-
flush_decoder = True
|
|
185
|
-
else:
|
|
186
|
-
cache_content = False
|
|
187
|
-
data = self._fp.read(amt)
|
|
188
|
-
if amt != 0 and not data: # Platform-specific: Buggy versions of Python.
|
|
189
|
-
# Close the connection when no data is returned
|
|
190
|
-
#
|
|
191
|
-
# This is redundant to what httplib/http.client _should_
|
|
192
|
-
# already do. However, versions of python released before
|
|
193
|
-
# December 15, 2012 (http://bugs.python.org/issue16298) do not
|
|
194
|
-
# properly close the connection in all cases. There is no harm
|
|
195
|
-
# in redundantly calling close.
|
|
196
|
-
self._fp.close()
|
|
197
|
-
flush_decoder = True
|
|
198
|
-
|
|
199
|
-
self._fp_bytes_read += len(data)
|
|
200
|
-
|
|
201
|
-
try:
|
|
202
|
-
if decode_content and self._decoder:
|
|
203
|
-
data = self._decoder.decompress(data)
|
|
204
|
-
except (IOError, zlib.error) as e:
|
|
205
|
-
raise DecodeError(
|
|
206
|
-
"Received response with content-encoding: %s, but "
|
|
207
|
-
"failed to decode it." % content_encoding,
|
|
208
|
-
e)
|
|
209
|
-
|
|
210
|
-
if flush_decoder and decode_content and self._decoder:
|
|
211
|
-
buf = self._decoder.decompress(binary_type())
|
|
212
|
-
data += buf + self._decoder.flush()
|
|
213
|
-
|
|
214
|
-
if cache_content:
|
|
215
|
-
self._body = data
|
|
216
|
-
|
|
217
|
-
return data
|
|
218
|
-
|
|
219
|
-
finally:
|
|
220
|
-
if self._original_response and self._original_response.isclosed():
|
|
221
|
-
self.release_conn()
|
|
222
|
-
|
|
223
|
-
def stream(self, amt=2**16, decode_content=None):
|
|
224
|
-
"""
|
|
225
|
-
A generator wrapper for the read() method. A call will block until
|
|
226
|
-
``amt`` bytes have been read from the connection or until the
|
|
227
|
-
connection is closed.
|
|
228
|
-
|
|
229
|
-
:param amt:
|
|
230
|
-
How much of the content to read. The generator will return up to
|
|
231
|
-
much data per iteration, but may return less. This is particularly
|
|
232
|
-
likely when using compressed data. However, the empty string will
|
|
233
|
-
never be returned.
|
|
234
|
-
|
|
235
|
-
:param decode_content:
|
|
236
|
-
If True, will attempt to decode the body based on the
|
|
237
|
-
'content-encoding' header.
|
|
238
|
-
"""
|
|
239
|
-
while not is_fp_closed(self._fp):
|
|
240
|
-
data = self.read(amt=amt, decode_content=decode_content)
|
|
241
|
-
|
|
242
|
-
if data:
|
|
243
|
-
yield data
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
@classmethod
|
|
247
|
-
def from_httplib(ResponseCls, r, **response_kw):
|
|
248
|
-
"""
|
|
249
|
-
Given an :class:`httplib.HTTPResponse` instance ``r``, return a
|
|
250
|
-
corresponding :class:`urllib3.response.HTTPResponse` object.
|
|
251
|
-
|
|
252
|
-
Remaining parameters are passed to the HTTPResponse constructor, along
|
|
253
|
-
with ``original_response=r``.
|
|
254
|
-
"""
|
|
255
|
-
|
|
256
|
-
headers = HTTPHeaderDict()
|
|
257
|
-
for k, v in r.getheaders():
|
|
258
|
-
headers.add(k, v)
|
|
259
|
-
|
|
260
|
-
# HTTPResponse objects in Python 3 don't have a .strict attribute
|
|
261
|
-
strict = getattr(r, 'strict', 0)
|
|
262
|
-
return ResponseCls(body=r,
|
|
263
|
-
headers=headers,
|
|
264
|
-
status=r.status,
|
|
265
|
-
version=r.version,
|
|
266
|
-
reason=r.reason,
|
|
267
|
-
strict=strict,
|
|
268
|
-
original_response=r,
|
|
269
|
-
**response_kw)
|
|
270
|
-
|
|
271
|
-
# Backwards-compatibility methods for httplib.HTTPResponse
|
|
272
|
-
def getheaders(self):
|
|
273
|
-
return self.headers
|
|
274
|
-
|
|
275
|
-
def getheader(self, name, default=None):
|
|
276
|
-
return self.headers.get(name, default)
|
|
277
|
-
|
|
278
|
-
# Overrides from io.IOBase
|
|
279
|
-
def close(self):
|
|
280
|
-
if not self.closed:
|
|
281
|
-
self._fp.close()
|
|
282
|
-
|
|
283
|
-
@property
|
|
284
|
-
def closed(self):
|
|
285
|
-
if self._fp is None:
|
|
286
|
-
return True
|
|
287
|
-
elif hasattr(self._fp, 'closed'):
|
|
288
|
-
return self._fp.closed
|
|
289
|
-
elif hasattr(self._fp, 'isclosed'): # Python 2
|
|
290
|
-
return self._fp.isclosed()
|
|
291
|
-
else:
|
|
292
|
-
return True
|
|
293
|
-
|
|
294
|
-
def fileno(self):
|
|
295
|
-
if self._fp is None:
|
|
296
|
-
raise IOError("HTTPResponse has no file to get a fileno from")
|
|
297
|
-
elif hasattr(self._fp, "fileno"):
|
|
298
|
-
return self._fp.fileno()
|
|
299
|
-
else:
|
|
300
|
-
raise IOError("The file-like object this HTTPResponse is wrapped "
|
|
301
|
-
"around has no file descriptor")
|
|
302
|
-
|
|
303
|
-
def flush(self):
|
|
304
|
-
if self._fp is not None and hasattr(self._fp, 'flush'):
|
|
305
|
-
return self._fp.flush()
|
|
306
|
-
|
|
307
|
-
def readable(self):
|
|
308
|
-
return True
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# urllib3/util/__init__.py
|
|
2
|
-
# Copyright 2008-2014 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
|
|
3
|
-
#
|
|
4
|
-
# This module is part of urllib3 and is released under
|
|
5
|
-
# the MIT License: http://www.opensource.org/licenses/mit-license.php
|
|
6
|
-
|
|
7
|
-
from .connection import is_connection_dropped
|
|
8
|
-
from .request import make_headers
|
|
9
|
-
from .response import is_fp_closed
|
|
10
|
-
from .ssl_ import (
|
|
11
|
-
SSLContext,
|
|
12
|
-
HAS_SNI,
|
|
13
|
-
assert_fingerprint,
|
|
14
|
-
resolve_cert_reqs,
|
|
15
|
-
resolve_ssl_version,
|
|
16
|
-
ssl_wrap_socket,
|
|
17
|
-
)
|
|
18
|
-
from .timeout import (
|
|
19
|
-
current_time,
|
|
20
|
-
Timeout,
|
|
21
|
-
)
|
|
22
|
-
from .url import (
|
|
23
|
-
get_host,
|
|
24
|
-
parse_url,
|
|
25
|
-
split_first,
|
|
26
|
-
Url,
|
|
27
|
-
)
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
from socket import error as SocketError
|
|
2
|
-
try:
|
|
3
|
-
from select import poll, POLLIN
|
|
4
|
-
except ImportError: # `poll` doesn't exist on OSX and other platforms
|
|
5
|
-
poll = False
|
|
6
|
-
try:
|
|
7
|
-
from select import select
|
|
8
|
-
except ImportError: # `select` doesn't exist on AppEngine.
|
|
9
|
-
select = False
|
|
10
|
-
|
|
11
|
-
def is_connection_dropped(conn): # Platform-specific
|
|
12
|
-
"""
|
|
13
|
-
Returns True if the connection is dropped and should be closed.
|
|
14
|
-
|
|
15
|
-
:param conn:
|
|
16
|
-
:class:`httplib.HTTPConnection` object.
|
|
17
|
-
|
|
18
|
-
Note: For platforms like AppEngine, this will always return ``False`` to
|
|
19
|
-
let the platform handle connection recycling transparently for us.
|
|
20
|
-
"""
|
|
21
|
-
sock = getattr(conn, 'sock', False)
|
|
22
|
-
if sock is False: # Platform-specific: AppEngine
|
|
23
|
-
return False
|
|
24
|
-
if sock is None: # Connection already closed (such as by httplib).
|
|
25
|
-
return False
|
|
26
|
-
|
|
27
|
-
if not poll:
|
|
28
|
-
if not select: # Platform-specific: AppEngine
|
|
29
|
-
return False
|
|
30
|
-
|
|
31
|
-
try:
|
|
32
|
-
return select([sock], [], [], 0.0)[0]
|
|
33
|
-
except SocketError:
|
|
34
|
-
return True
|
|
35
|
-
|
|
36
|
-
# This version is better on platforms that support it.
|
|
37
|
-
p = poll()
|
|
38
|
-
p.register(sock, POLLIN)
|
|
39
|
-
for (fno, ev) in p.poll(0.0):
|
|
40
|
-
if fno == sock.fileno():
|
|
41
|
-
# Either data is buffered (bad), or the connection is dropped.
|
|
42
|
-
return True
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|