cli-ih 0.6.3.1__py3-none-any.whl → 0.7.1__py3-none-any.whl

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.
Files changed (427) hide show
  1. cli_ih/__init__.py +1 -0
  2. cli_ih/asyncClient.py +109 -10
  3. cli_ih/client.py +110 -18
  4. cli_ih/utils.py +51 -0
  5. cli_ih-0.7.1.dist-info/METADATA +100 -0
  6. cli_ih-0.7.1.dist-info/RECORD +9 -0
  7. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.1.dist-info}/top_level.txt +0 -1
  8. cli_ih-0.6.3.1.dist-info/METADATA +0 -86
  9. cli_ih-0.6.3.1.dist-info/RECORD +0 -425
  10. venv/Lib/site-packages/__editable___cli_ih_0_6_3_1_finder.py +0 -85
  11. venv/Lib/site-packages/pip/__init__.py +0 -13
  12. venv/Lib/site-packages/pip/__main__.py +0 -24
  13. venv/Lib/site-packages/pip/__pip-runner__.py +0 -50
  14. venv/Lib/site-packages/pip/_internal/__init__.py +0 -18
  15. venv/Lib/site-packages/pip/_internal/build_env.py +0 -349
  16. venv/Lib/site-packages/pip/_internal/cache.py +0 -291
  17. venv/Lib/site-packages/pip/_internal/cli/__init__.py +0 -3
  18. venv/Lib/site-packages/pip/_internal/cli/autocompletion.py +0 -184
  19. venv/Lib/site-packages/pip/_internal/cli/base_command.py +0 -244
  20. venv/Lib/site-packages/pip/_internal/cli/cmdoptions.py +0 -1138
  21. venv/Lib/site-packages/pip/_internal/cli/command_context.py +0 -28
  22. venv/Lib/site-packages/pip/_internal/cli/index_command.py +0 -175
  23. venv/Lib/site-packages/pip/_internal/cli/main.py +0 -80
  24. venv/Lib/site-packages/pip/_internal/cli/main_parser.py +0 -134
  25. venv/Lib/site-packages/pip/_internal/cli/parser.py +0 -298
  26. venv/Lib/site-packages/pip/_internal/cli/progress_bars.py +0 -151
  27. venv/Lib/site-packages/pip/_internal/cli/req_command.py +0 -351
  28. venv/Lib/site-packages/pip/_internal/cli/spinners.py +0 -235
  29. venv/Lib/site-packages/pip/_internal/cli/status_codes.py +0 -6
  30. venv/Lib/site-packages/pip/_internal/commands/__init__.py +0 -139
  31. venv/Lib/site-packages/pip/_internal/commands/cache.py +0 -231
  32. venv/Lib/site-packages/pip/_internal/commands/check.py +0 -66
  33. venv/Lib/site-packages/pip/_internal/commands/completion.py +0 -135
  34. venv/Lib/site-packages/pip/_internal/commands/configuration.py +0 -288
  35. venv/Lib/site-packages/pip/_internal/commands/debug.py +0 -203
  36. venv/Lib/site-packages/pip/_internal/commands/download.py +0 -145
  37. venv/Lib/site-packages/pip/_internal/commands/freeze.py +0 -107
  38. venv/Lib/site-packages/pip/_internal/commands/hash.py +0 -58
  39. venv/Lib/site-packages/pip/_internal/commands/help.py +0 -40
  40. venv/Lib/site-packages/pip/_internal/commands/index.py +0 -159
  41. venv/Lib/site-packages/pip/_internal/commands/inspect.py +0 -92
  42. venv/Lib/site-packages/pip/_internal/commands/install.py +0 -798
  43. venv/Lib/site-packages/pip/_internal/commands/list.py +0 -400
  44. venv/Lib/site-packages/pip/_internal/commands/lock.py +0 -170
  45. venv/Lib/site-packages/pip/_internal/commands/search.py +0 -178
  46. venv/Lib/site-packages/pip/_internal/commands/show.py +0 -231
  47. venv/Lib/site-packages/pip/_internal/commands/uninstall.py +0 -113
  48. venv/Lib/site-packages/pip/_internal/commands/wheel.py +0 -181
  49. venv/Lib/site-packages/pip/_internal/configuration.py +0 -397
  50. venv/Lib/site-packages/pip/_internal/distributions/__init__.py +0 -21
  51. venv/Lib/site-packages/pip/_internal/distributions/base.py +0 -55
  52. venv/Lib/site-packages/pip/_internal/distributions/installed.py +0 -33
  53. venv/Lib/site-packages/pip/_internal/distributions/sdist.py +0 -165
  54. venv/Lib/site-packages/pip/_internal/distributions/wheel.py +0 -44
  55. venv/Lib/site-packages/pip/_internal/exceptions.py +0 -881
  56. venv/Lib/site-packages/pip/_internal/index/__init__.py +0 -1
  57. venv/Lib/site-packages/pip/_internal/index/collector.py +0 -489
  58. venv/Lib/site-packages/pip/_internal/index/package_finder.py +0 -1059
  59. venv/Lib/site-packages/pip/_internal/index/sources.py +0 -287
  60. venv/Lib/site-packages/pip/_internal/locations/__init__.py +0 -441
  61. venv/Lib/site-packages/pip/_internal/locations/_distutils.py +0 -173
  62. venv/Lib/site-packages/pip/_internal/locations/_sysconfig.py +0 -215
  63. venv/Lib/site-packages/pip/_internal/locations/base.py +0 -82
  64. venv/Lib/site-packages/pip/_internal/main.py +0 -12
  65. venv/Lib/site-packages/pip/_internal/metadata/__init__.py +0 -164
  66. venv/Lib/site-packages/pip/_internal/metadata/_json.py +0 -87
  67. venv/Lib/site-packages/pip/_internal/metadata/base.py +0 -685
  68. venv/Lib/site-packages/pip/_internal/metadata/importlib/__init__.py +0 -6
  69. venv/Lib/site-packages/pip/_internal/metadata/importlib/_compat.py +0 -87
  70. venv/Lib/site-packages/pip/_internal/metadata/importlib/_dists.py +0 -223
  71. venv/Lib/site-packages/pip/_internal/metadata/importlib/_envs.py +0 -143
  72. venv/Lib/site-packages/pip/_internal/metadata/pkg_resources.py +0 -298
  73. venv/Lib/site-packages/pip/_internal/models/__init__.py +0 -1
  74. venv/Lib/site-packages/pip/_internal/models/candidate.py +0 -25
  75. venv/Lib/site-packages/pip/_internal/models/direct_url.py +0 -227
  76. venv/Lib/site-packages/pip/_internal/models/format_control.py +0 -78
  77. venv/Lib/site-packages/pip/_internal/models/index.py +0 -28
  78. venv/Lib/site-packages/pip/_internal/models/installation_report.py +0 -57
  79. venv/Lib/site-packages/pip/_internal/models/link.py +0 -613
  80. venv/Lib/site-packages/pip/_internal/models/pylock.py +0 -188
  81. venv/Lib/site-packages/pip/_internal/models/scheme.py +0 -25
  82. venv/Lib/site-packages/pip/_internal/models/search_scope.py +0 -126
  83. venv/Lib/site-packages/pip/_internal/models/selection_prefs.py +0 -53
  84. venv/Lib/site-packages/pip/_internal/models/target_python.py +0 -122
  85. venv/Lib/site-packages/pip/_internal/models/wheel.py +0 -141
  86. venv/Lib/site-packages/pip/_internal/network/__init__.py +0 -1
  87. venv/Lib/site-packages/pip/_internal/network/auth.py +0 -564
  88. venv/Lib/site-packages/pip/_internal/network/cache.py +0 -133
  89. venv/Lib/site-packages/pip/_internal/network/download.py +0 -342
  90. venv/Lib/site-packages/pip/_internal/network/lazy_wheel.py +0 -213
  91. venv/Lib/site-packages/pip/_internal/network/session.py +0 -528
  92. venv/Lib/site-packages/pip/_internal/network/utils.py +0 -98
  93. venv/Lib/site-packages/pip/_internal/network/xmlrpc.py +0 -61
  94. venv/Lib/site-packages/pip/_internal/operations/__init__.py +0 -0
  95. venv/Lib/site-packages/pip/_internal/operations/build/__init__.py +0 -0
  96. venv/Lib/site-packages/pip/_internal/operations/build/build_tracker.py +0 -140
  97. venv/Lib/site-packages/pip/_internal/operations/build/metadata.py +0 -38
  98. venv/Lib/site-packages/pip/_internal/operations/build/metadata_editable.py +0 -41
  99. venv/Lib/site-packages/pip/_internal/operations/build/metadata_legacy.py +0 -73
  100. venv/Lib/site-packages/pip/_internal/operations/build/wheel.py +0 -38
  101. venv/Lib/site-packages/pip/_internal/operations/build/wheel_editable.py +0 -47
  102. venv/Lib/site-packages/pip/_internal/operations/build/wheel_legacy.py +0 -119
  103. venv/Lib/site-packages/pip/_internal/operations/check.py +0 -175
  104. venv/Lib/site-packages/pip/_internal/operations/freeze.py +0 -259
  105. venv/Lib/site-packages/pip/_internal/operations/install/__init__.py +0 -1
  106. venv/Lib/site-packages/pip/_internal/operations/install/editable_legacy.py +0 -48
  107. venv/Lib/site-packages/pip/_internal/operations/install/wheel.py +0 -746
  108. venv/Lib/site-packages/pip/_internal/operations/prepare.py +0 -742
  109. venv/Lib/site-packages/pip/_internal/pyproject.py +0 -182
  110. venv/Lib/site-packages/pip/_internal/req/__init__.py +0 -105
  111. venv/Lib/site-packages/pip/_internal/req/constructors.py +0 -562
  112. venv/Lib/site-packages/pip/_internal/req/req_dependency_group.py +0 -75
  113. venv/Lib/site-packages/pip/_internal/req/req_file.py +0 -620
  114. venv/Lib/site-packages/pip/_internal/req/req_install.py +0 -937
  115. venv/Lib/site-packages/pip/_internal/req/req_set.py +0 -81
  116. venv/Lib/site-packages/pip/_internal/req/req_uninstall.py +0 -639
  117. venv/Lib/site-packages/pip/_internal/resolution/__init__.py +0 -0
  118. venv/Lib/site-packages/pip/_internal/resolution/base.py +0 -20
  119. venv/Lib/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
  120. venv/Lib/site-packages/pip/_internal/resolution/legacy/resolver.py +0 -598
  121. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
  122. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/base.py +0 -142
  123. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/candidates.py +0 -582
  124. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/factory.py +0 -814
  125. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +0 -166
  126. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/provider.py +0 -276
  127. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/reporter.py +0 -85
  128. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/requirements.py +0 -247
  129. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/resolver.py +0 -336
  130. venv/Lib/site-packages/pip/_internal/self_outdated_check.py +0 -254
  131. venv/Lib/site-packages/pip/_internal/utils/__init__.py +0 -0
  132. venv/Lib/site-packages/pip/_internal/utils/_jaraco_text.py +0 -109
  133. venv/Lib/site-packages/pip/_internal/utils/_log.py +0 -38
  134. venv/Lib/site-packages/pip/_internal/utils/appdirs.py +0 -52
  135. venv/Lib/site-packages/pip/_internal/utils/compat.py +0 -85
  136. venv/Lib/site-packages/pip/_internal/utils/compatibility_tags.py +0 -201
  137. venv/Lib/site-packages/pip/_internal/utils/datetime.py +0 -10
  138. venv/Lib/site-packages/pip/_internal/utils/deprecation.py +0 -126
  139. venv/Lib/site-packages/pip/_internal/utils/direct_url_helpers.py +0 -87
  140. venv/Lib/site-packages/pip/_internal/utils/egg_link.py +0 -81
  141. venv/Lib/site-packages/pip/_internal/utils/entrypoints.py +0 -88
  142. venv/Lib/site-packages/pip/_internal/utils/filesystem.py +0 -152
  143. venv/Lib/site-packages/pip/_internal/utils/filetypes.py +0 -24
  144. venv/Lib/site-packages/pip/_internal/utils/glibc.py +0 -102
  145. venv/Lib/site-packages/pip/_internal/utils/hashes.py +0 -150
  146. venv/Lib/site-packages/pip/_internal/utils/logging.py +0 -364
  147. venv/Lib/site-packages/pip/_internal/utils/misc.py +0 -765
  148. venv/Lib/site-packages/pip/_internal/utils/packaging.py +0 -44
  149. venv/Lib/site-packages/pip/_internal/utils/retry.py +0 -45
  150. venv/Lib/site-packages/pip/_internal/utils/setuptools_build.py +0 -149
  151. venv/Lib/site-packages/pip/_internal/utils/subprocess.py +0 -248
  152. venv/Lib/site-packages/pip/_internal/utils/temp_dir.py +0 -294
  153. venv/Lib/site-packages/pip/_internal/utils/unpacking.py +0 -337
  154. venv/Lib/site-packages/pip/_internal/utils/urls.py +0 -55
  155. venv/Lib/site-packages/pip/_internal/utils/virtualenv.py +0 -105
  156. venv/Lib/site-packages/pip/_internal/utils/wheel.py +0 -132
  157. venv/Lib/site-packages/pip/_internal/vcs/__init__.py +0 -15
  158. venv/Lib/site-packages/pip/_internal/vcs/bazaar.py +0 -130
  159. venv/Lib/site-packages/pip/_internal/vcs/git.py +0 -571
  160. venv/Lib/site-packages/pip/_internal/vcs/mercurial.py +0 -186
  161. venv/Lib/site-packages/pip/_internal/vcs/subversion.py +0 -335
  162. venv/Lib/site-packages/pip/_internal/vcs/versioncontrol.py +0 -693
  163. venv/Lib/site-packages/pip/_internal/wheel_builder.py +0 -334
  164. venv/Lib/site-packages/pip/_vendor/__init__.py +0 -117
  165. venv/Lib/site-packages/pip/_vendor/cachecontrol/__init__.py +0 -29
  166. venv/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.py +0 -70
  167. venv/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py +0 -168
  168. venv/Lib/site-packages/pip/_vendor/cachecontrol/cache.py +0 -75
  169. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +0 -8
  170. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +0 -145
  171. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +0 -48
  172. venv/Lib/site-packages/pip/_vendor/cachecontrol/controller.py +0 -511
  173. venv/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.py +0 -119
  174. venv/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py +0 -157
  175. venv/Lib/site-packages/pip/_vendor/cachecontrol/py.typed +0 -0
  176. venv/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py +0 -146
  177. venv/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py +0 -43
  178. venv/Lib/site-packages/pip/_vendor/certifi/__init__.py +0 -4
  179. venv/Lib/site-packages/pip/_vendor/certifi/__main__.py +0 -12
  180. venv/Lib/site-packages/pip/_vendor/certifi/core.py +0 -83
  181. venv/Lib/site-packages/pip/_vendor/certifi/py.typed +0 -0
  182. venv/Lib/site-packages/pip/_vendor/dependency_groups/__init__.py +0 -13
  183. venv/Lib/site-packages/pip/_vendor/dependency_groups/__main__.py +0 -65
  184. venv/Lib/site-packages/pip/_vendor/dependency_groups/_implementation.py +0 -209
  185. venv/Lib/site-packages/pip/_vendor/dependency_groups/_lint_dependency_groups.py +0 -59
  186. venv/Lib/site-packages/pip/_vendor/dependency_groups/_pip_wrapper.py +0 -62
  187. venv/Lib/site-packages/pip/_vendor/dependency_groups/_toml_compat.py +0 -9
  188. venv/Lib/site-packages/pip/_vendor/dependency_groups/py.typed +0 -0
  189. venv/Lib/site-packages/pip/_vendor/distlib/__init__.py +0 -33
  190. venv/Lib/site-packages/pip/_vendor/distlib/compat.py +0 -1137
  191. venv/Lib/site-packages/pip/_vendor/distlib/resources.py +0 -358
  192. venv/Lib/site-packages/pip/_vendor/distlib/scripts.py +0 -447
  193. venv/Lib/site-packages/pip/_vendor/distlib/util.py +0 -1984
  194. venv/Lib/site-packages/pip/_vendor/distro/__init__.py +0 -54
  195. venv/Lib/site-packages/pip/_vendor/distro/__main__.py +0 -4
  196. venv/Lib/site-packages/pip/_vendor/distro/distro.py +0 -1403
  197. venv/Lib/site-packages/pip/_vendor/distro/py.typed +0 -0
  198. venv/Lib/site-packages/pip/_vendor/idna/__init__.py +0 -45
  199. venv/Lib/site-packages/pip/_vendor/idna/codec.py +0 -122
  200. venv/Lib/site-packages/pip/_vendor/idna/compat.py +0 -15
  201. venv/Lib/site-packages/pip/_vendor/idna/core.py +0 -437
  202. venv/Lib/site-packages/pip/_vendor/idna/idnadata.py +0 -4243
  203. venv/Lib/site-packages/pip/_vendor/idna/intranges.py +0 -57
  204. venv/Lib/site-packages/pip/_vendor/idna/package_data.py +0 -1
  205. venv/Lib/site-packages/pip/_vendor/idna/py.typed +0 -0
  206. venv/Lib/site-packages/pip/_vendor/idna/uts46data.py +0 -8681
  207. venv/Lib/site-packages/pip/_vendor/msgpack/__init__.py +0 -55
  208. venv/Lib/site-packages/pip/_vendor/msgpack/exceptions.py +0 -48
  209. venv/Lib/site-packages/pip/_vendor/msgpack/ext.py +0 -170
  210. venv/Lib/site-packages/pip/_vendor/msgpack/fallback.py +0 -929
  211. venv/Lib/site-packages/pip/_vendor/packaging/__init__.py +0 -15
  212. venv/Lib/site-packages/pip/_vendor/packaging/_elffile.py +0 -109
  213. venv/Lib/site-packages/pip/_vendor/packaging/_manylinux.py +0 -262
  214. venv/Lib/site-packages/pip/_vendor/packaging/_musllinux.py +0 -85
  215. venv/Lib/site-packages/pip/_vendor/packaging/_parser.py +0 -353
  216. venv/Lib/site-packages/pip/_vendor/packaging/_structures.py +0 -61
  217. venv/Lib/site-packages/pip/_vendor/packaging/_tokenizer.py +0 -195
  218. venv/Lib/site-packages/pip/_vendor/packaging/licenses/__init__.py +0 -145
  219. venv/Lib/site-packages/pip/_vendor/packaging/licenses/_spdx.py +0 -759
  220. venv/Lib/site-packages/pip/_vendor/packaging/markers.py +0 -362
  221. venv/Lib/site-packages/pip/_vendor/packaging/metadata.py +0 -862
  222. venv/Lib/site-packages/pip/_vendor/packaging/py.typed +0 -0
  223. venv/Lib/site-packages/pip/_vendor/packaging/requirements.py +0 -91
  224. venv/Lib/site-packages/pip/_vendor/packaging/specifiers.py +0 -1019
  225. venv/Lib/site-packages/pip/_vendor/packaging/tags.py +0 -656
  226. venv/Lib/site-packages/pip/_vendor/packaging/utils.py +0 -163
  227. venv/Lib/site-packages/pip/_vendor/packaging/version.py +0 -582
  228. venv/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py +0 -3676
  229. venv/Lib/site-packages/pip/_vendor/platformdirs/__init__.py +0 -631
  230. venv/Lib/site-packages/pip/_vendor/platformdirs/__main__.py +0 -55
  231. venv/Lib/site-packages/pip/_vendor/platformdirs/android.py +0 -249
  232. venv/Lib/site-packages/pip/_vendor/platformdirs/api.py +0 -299
  233. venv/Lib/site-packages/pip/_vendor/platformdirs/macos.py +0 -144
  234. venv/Lib/site-packages/pip/_vendor/platformdirs/py.typed +0 -0
  235. venv/Lib/site-packages/pip/_vendor/platformdirs/unix.py +0 -272
  236. venv/Lib/site-packages/pip/_vendor/platformdirs/version.py +0 -21
  237. venv/Lib/site-packages/pip/_vendor/platformdirs/windows.py +0 -272
  238. venv/Lib/site-packages/pip/_vendor/pygments/__init__.py +0 -82
  239. venv/Lib/site-packages/pip/_vendor/pygments/__main__.py +0 -17
  240. venv/Lib/site-packages/pip/_vendor/pygments/console.py +0 -70
  241. venv/Lib/site-packages/pip/_vendor/pygments/filter.py +0 -70
  242. venv/Lib/site-packages/pip/_vendor/pygments/filters/__init__.py +0 -940
  243. venv/Lib/site-packages/pip/_vendor/pygments/formatter.py +0 -129
  244. venv/Lib/site-packages/pip/_vendor/pygments/formatters/__init__.py +0 -157
  245. venv/Lib/site-packages/pip/_vendor/pygments/formatters/_mapping.py +0 -23
  246. venv/Lib/site-packages/pip/_vendor/pygments/lexer.py +0 -963
  247. venv/Lib/site-packages/pip/_vendor/pygments/lexers/__init__.py +0 -362
  248. venv/Lib/site-packages/pip/_vendor/pygments/lexers/_mapping.py +0 -602
  249. venv/Lib/site-packages/pip/_vendor/pygments/lexers/python.py +0 -1201
  250. venv/Lib/site-packages/pip/_vendor/pygments/modeline.py +0 -43
  251. venv/Lib/site-packages/pip/_vendor/pygments/plugin.py +0 -72
  252. venv/Lib/site-packages/pip/_vendor/pygments/regexopt.py +0 -91
  253. venv/Lib/site-packages/pip/_vendor/pygments/scanner.py +0 -104
  254. venv/Lib/site-packages/pip/_vendor/pygments/sphinxext.py +0 -247
  255. venv/Lib/site-packages/pip/_vendor/pygments/style.py +0 -203
  256. venv/Lib/site-packages/pip/_vendor/pygments/styles/__init__.py +0 -61
  257. venv/Lib/site-packages/pip/_vendor/pygments/styles/_mapping.py +0 -54
  258. venv/Lib/site-packages/pip/_vendor/pygments/token.py +0 -214
  259. venv/Lib/site-packages/pip/_vendor/pygments/unistring.py +0 -153
  260. venv/Lib/site-packages/pip/_vendor/pygments/util.py +0 -324
  261. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/__init__.py +0 -31
  262. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_impl.py +0 -410
  263. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/__init__.py +0 -21
  264. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py +0 -389
  265. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/py.typed +0 -0
  266. venv/Lib/site-packages/pip/_vendor/requests/__init__.py +0 -179
  267. venv/Lib/site-packages/pip/_vendor/requests/__version__.py +0 -14
  268. venv/Lib/site-packages/pip/_vendor/requests/_internal_utils.py +0 -50
  269. venv/Lib/site-packages/pip/_vendor/requests/adapters.py +0 -719
  270. venv/Lib/site-packages/pip/_vendor/requests/api.py +0 -157
  271. venv/Lib/site-packages/pip/_vendor/requests/auth.py +0 -314
  272. venv/Lib/site-packages/pip/_vendor/requests/certs.py +0 -17
  273. venv/Lib/site-packages/pip/_vendor/requests/compat.py +0 -90
  274. venv/Lib/site-packages/pip/_vendor/requests/cookies.py +0 -561
  275. venv/Lib/site-packages/pip/_vendor/requests/exceptions.py +0 -151
  276. venv/Lib/site-packages/pip/_vendor/requests/help.py +0 -127
  277. venv/Lib/site-packages/pip/_vendor/requests/hooks.py +0 -33
  278. venv/Lib/site-packages/pip/_vendor/requests/models.py +0 -1039
  279. venv/Lib/site-packages/pip/_vendor/requests/packages.py +0 -25
  280. venv/Lib/site-packages/pip/_vendor/requests/sessions.py +0 -831
  281. venv/Lib/site-packages/pip/_vendor/requests/status_codes.py +0 -128
  282. venv/Lib/site-packages/pip/_vendor/requests/structures.py +0 -99
  283. venv/Lib/site-packages/pip/_vendor/requests/utils.py +0 -1086
  284. venv/Lib/site-packages/pip/_vendor/resolvelib/__init__.py +0 -27
  285. venv/Lib/site-packages/pip/_vendor/resolvelib/providers.py +0 -196
  286. venv/Lib/site-packages/pip/_vendor/resolvelib/py.typed +0 -0
  287. venv/Lib/site-packages/pip/_vendor/resolvelib/reporters.py +0 -55
  288. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/__init__.py +0 -27
  289. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/abstract.py +0 -47
  290. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/criterion.py +0 -48
  291. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/exceptions.py +0 -57
  292. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py +0 -622
  293. venv/Lib/site-packages/pip/_vendor/resolvelib/structs.py +0 -209
  294. venv/Lib/site-packages/pip/_vendor/rich/__init__.py +0 -177
  295. venv/Lib/site-packages/pip/_vendor/rich/__main__.py +0 -245
  296. venv/Lib/site-packages/pip/_vendor/rich/_cell_widths.py +0 -454
  297. venv/Lib/site-packages/pip/_vendor/rich/_emoji_codes.py +0 -3610
  298. venv/Lib/site-packages/pip/_vendor/rich/_emoji_replace.py +0 -32
  299. venv/Lib/site-packages/pip/_vendor/rich/_export_format.py +0 -76
  300. venv/Lib/site-packages/pip/_vendor/rich/_extension.py +0 -10
  301. venv/Lib/site-packages/pip/_vendor/rich/_fileno.py +0 -24
  302. venv/Lib/site-packages/pip/_vendor/rich/_inspect.py +0 -268
  303. venv/Lib/site-packages/pip/_vendor/rich/_log_render.py +0 -94
  304. venv/Lib/site-packages/pip/_vendor/rich/_loop.py +0 -43
  305. venv/Lib/site-packages/pip/_vendor/rich/_null_file.py +0 -69
  306. venv/Lib/site-packages/pip/_vendor/rich/_palettes.py +0 -309
  307. venv/Lib/site-packages/pip/_vendor/rich/_pick.py +0 -17
  308. venv/Lib/site-packages/pip/_vendor/rich/_ratio.py +0 -153
  309. venv/Lib/site-packages/pip/_vendor/rich/_spinners.py +0 -482
  310. venv/Lib/site-packages/pip/_vendor/rich/_stack.py +0 -16
  311. venv/Lib/site-packages/pip/_vendor/rich/_timer.py +0 -19
  312. venv/Lib/site-packages/pip/_vendor/rich/_win32_console.py +0 -661
  313. venv/Lib/site-packages/pip/_vendor/rich/_windows.py +0 -71
  314. venv/Lib/site-packages/pip/_vendor/rich/_windows_renderer.py +0 -56
  315. venv/Lib/site-packages/pip/_vendor/rich/_wrap.py +0 -93
  316. venv/Lib/site-packages/pip/_vendor/rich/abc.py +0 -33
  317. venv/Lib/site-packages/pip/_vendor/rich/align.py +0 -306
  318. venv/Lib/site-packages/pip/_vendor/rich/ansi.py +0 -241
  319. venv/Lib/site-packages/pip/_vendor/rich/bar.py +0 -93
  320. venv/Lib/site-packages/pip/_vendor/rich/box.py +0 -474
  321. venv/Lib/site-packages/pip/_vendor/rich/cells.py +0 -174
  322. venv/Lib/site-packages/pip/_vendor/rich/color.py +0 -621
  323. venv/Lib/site-packages/pip/_vendor/rich/color_triplet.py +0 -38
  324. venv/Lib/site-packages/pip/_vendor/rich/columns.py +0 -187
  325. venv/Lib/site-packages/pip/_vendor/rich/console.py +0 -2680
  326. venv/Lib/site-packages/pip/_vendor/rich/constrain.py +0 -37
  327. venv/Lib/site-packages/pip/_vendor/rich/containers.py +0 -167
  328. venv/Lib/site-packages/pip/_vendor/rich/control.py +0 -219
  329. venv/Lib/site-packages/pip/_vendor/rich/default_styles.py +0 -193
  330. venv/Lib/site-packages/pip/_vendor/rich/diagnose.py +0 -39
  331. venv/Lib/site-packages/pip/_vendor/rich/emoji.py +0 -91
  332. venv/Lib/site-packages/pip/_vendor/rich/errors.py +0 -34
  333. venv/Lib/site-packages/pip/_vendor/rich/file_proxy.py +0 -57
  334. venv/Lib/site-packages/pip/_vendor/rich/filesize.py +0 -88
  335. venv/Lib/site-packages/pip/_vendor/rich/highlighter.py +0 -232
  336. venv/Lib/site-packages/pip/_vendor/rich/json.py +0 -139
  337. venv/Lib/site-packages/pip/_vendor/rich/jupyter.py +0 -101
  338. venv/Lib/site-packages/pip/_vendor/rich/layout.py +0 -442
  339. venv/Lib/site-packages/pip/_vendor/rich/live.py +0 -400
  340. venv/Lib/site-packages/pip/_vendor/rich/live_render.py +0 -106
  341. venv/Lib/site-packages/pip/_vendor/rich/logging.py +0 -297
  342. venv/Lib/site-packages/pip/_vendor/rich/markup.py +0 -251
  343. venv/Lib/site-packages/pip/_vendor/rich/measure.py +0 -151
  344. venv/Lib/site-packages/pip/_vendor/rich/padding.py +0 -141
  345. venv/Lib/site-packages/pip/_vendor/rich/pager.py +0 -34
  346. venv/Lib/site-packages/pip/_vendor/rich/palette.py +0 -100
  347. venv/Lib/site-packages/pip/_vendor/rich/panel.py +0 -317
  348. venv/Lib/site-packages/pip/_vendor/rich/pretty.py +0 -1016
  349. venv/Lib/site-packages/pip/_vendor/rich/progress.py +0 -1715
  350. venv/Lib/site-packages/pip/_vendor/rich/progress_bar.py +0 -223
  351. venv/Lib/site-packages/pip/_vendor/rich/prompt.py +0 -400
  352. venv/Lib/site-packages/pip/_vendor/rich/protocol.py +0 -42
  353. venv/Lib/site-packages/pip/_vendor/rich/py.typed +0 -0
  354. venv/Lib/site-packages/pip/_vendor/rich/region.py +0 -10
  355. venv/Lib/site-packages/pip/_vendor/rich/repr.py +0 -149
  356. venv/Lib/site-packages/pip/_vendor/rich/rule.py +0 -130
  357. venv/Lib/site-packages/pip/_vendor/rich/scope.py +0 -86
  358. venv/Lib/site-packages/pip/_vendor/rich/screen.py +0 -54
  359. venv/Lib/site-packages/pip/_vendor/rich/segment.py +0 -752
  360. venv/Lib/site-packages/pip/_vendor/rich/spinner.py +0 -132
  361. venv/Lib/site-packages/pip/_vendor/rich/status.py +0 -131
  362. venv/Lib/site-packages/pip/_vendor/rich/style.py +0 -796
  363. venv/Lib/site-packages/pip/_vendor/rich/styled.py +0 -42
  364. venv/Lib/site-packages/pip/_vendor/rich/syntax.py +0 -985
  365. venv/Lib/site-packages/pip/_vendor/rich/table.py +0 -1006
  366. venv/Lib/site-packages/pip/_vendor/rich/terminal_theme.py +0 -153
  367. venv/Lib/site-packages/pip/_vendor/rich/text.py +0 -1361
  368. venv/Lib/site-packages/pip/_vendor/rich/theme.py +0 -115
  369. venv/Lib/site-packages/pip/_vendor/rich/themes.py +0 -5
  370. venv/Lib/site-packages/pip/_vendor/rich/traceback.py +0 -899
  371. venv/Lib/site-packages/pip/_vendor/rich/tree.py +0 -257
  372. venv/Lib/site-packages/pip/_vendor/tomli/__init__.py +0 -8
  373. venv/Lib/site-packages/pip/_vendor/tomli/_parser.py +0 -770
  374. venv/Lib/site-packages/pip/_vendor/tomli/_re.py +0 -112
  375. venv/Lib/site-packages/pip/_vendor/tomli/_types.py +0 -10
  376. venv/Lib/site-packages/pip/_vendor/tomli/py.typed +0 -1
  377. venv/Lib/site-packages/pip/_vendor/tomli_w/__init__.py +0 -4
  378. venv/Lib/site-packages/pip/_vendor/tomli_w/_writer.py +0 -229
  379. venv/Lib/site-packages/pip/_vendor/tomli_w/py.typed +0 -1
  380. venv/Lib/site-packages/pip/_vendor/truststore/__init__.py +0 -36
  381. venv/Lib/site-packages/pip/_vendor/truststore/_api.py +0 -333
  382. venv/Lib/site-packages/pip/_vendor/truststore/_macos.py +0 -571
  383. venv/Lib/site-packages/pip/_vendor/truststore/_openssl.py +0 -66
  384. venv/Lib/site-packages/pip/_vendor/truststore/_ssl_constants.py +0 -31
  385. venv/Lib/site-packages/pip/_vendor/truststore/_windows.py +0 -567
  386. venv/Lib/site-packages/pip/_vendor/truststore/py.typed +0 -0
  387. venv/Lib/site-packages/pip/_vendor/urllib3/__init__.py +0 -102
  388. venv/Lib/site-packages/pip/_vendor/urllib3/_collections.py +0 -355
  389. venv/Lib/site-packages/pip/_vendor/urllib3/_version.py +0 -2
  390. venv/Lib/site-packages/pip/_vendor/urllib3/connection.py +0 -572
  391. venv/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py +0 -1140
  392. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
  393. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +0 -36
  394. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
  395. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +0 -519
  396. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +0 -397
  397. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/appengine.py +0 -314
  398. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +0 -130
  399. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +0 -518
  400. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +0 -920
  401. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/socks.py +0 -216
  402. venv/Lib/site-packages/pip/_vendor/urllib3/exceptions.py +0 -323
  403. venv/Lib/site-packages/pip/_vendor/urllib3/fields.py +0 -274
  404. venv/Lib/site-packages/pip/_vendor/urllib3/filepost.py +0 -98
  405. venv/Lib/site-packages/pip/_vendor/urllib3/packages/__init__.py +0 -0
  406. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
  407. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +0 -51
  408. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/weakref_finalize.py +0 -155
  409. venv/Lib/site-packages/pip/_vendor/urllib3/packages/six.py +0 -1076
  410. venv/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py +0 -540
  411. venv/Lib/site-packages/pip/_vendor/urllib3/request.py +0 -191
  412. venv/Lib/site-packages/pip/_vendor/urllib3/response.py +0 -879
  413. venv/Lib/site-packages/pip/_vendor/urllib3/util/__init__.py +0 -49
  414. venv/Lib/site-packages/pip/_vendor/urllib3/util/connection.py +0 -149
  415. venv/Lib/site-packages/pip/_vendor/urllib3/util/proxy.py +0 -57
  416. venv/Lib/site-packages/pip/_vendor/urllib3/util/queue.py +0 -22
  417. venv/Lib/site-packages/pip/_vendor/urllib3/util/request.py +0 -137
  418. venv/Lib/site-packages/pip/_vendor/urllib3/util/response.py +0 -107
  419. venv/Lib/site-packages/pip/_vendor/urllib3/util/retry.py +0 -622
  420. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py +0 -504
  421. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +0 -159
  422. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssltransport.py +0 -221
  423. venv/Lib/site-packages/pip/_vendor/urllib3/util/timeout.py +0 -271
  424. venv/Lib/site-packages/pip/_vendor/urllib3/util/url.py +0 -435
  425. venv/Lib/site-packages/pip/_vendor/urllib3/util/wait.py +0 -152
  426. venv/Lib/site-packages/pip/py.typed +0 -4
  427. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.1.dist-info}/WHEEL +0 -0
@@ -1,561 +0,0 @@
1
- """
2
- requests.cookies
3
- ~~~~~~~~~~~~~~~~
4
-
5
- Compatibility code to be able to use `http.cookiejar.CookieJar` with requests.
6
-
7
- requests.utils imports from here, so be careful with imports.
8
- """
9
-
10
- import calendar
11
- import copy
12
- import time
13
-
14
- from ._internal_utils import to_native_string
15
- from .compat import Morsel, MutableMapping, cookielib, urlparse, urlunparse
16
-
17
- try:
18
- import threading
19
- except ImportError:
20
- import dummy_threading as threading
21
-
22
-
23
- class MockRequest:
24
- """Wraps a `requests.Request` to mimic a `urllib2.Request`.
25
-
26
- The code in `http.cookiejar.CookieJar` expects this interface in order to correctly
27
- manage cookie policies, i.e., determine whether a cookie can be set, given the
28
- domains of the request and the cookie.
29
-
30
- The original request object is read-only. The client is responsible for collecting
31
- the new headers via `get_new_headers()` and interpreting them appropriately. You
32
- probably want `get_cookie_header`, defined below.
33
- """
34
-
35
- def __init__(self, request):
36
- self._r = request
37
- self._new_headers = {}
38
- self.type = urlparse(self._r.url).scheme
39
-
40
- def get_type(self):
41
- return self.type
42
-
43
- def get_host(self):
44
- return urlparse(self._r.url).netloc
45
-
46
- def get_origin_req_host(self):
47
- return self.get_host()
48
-
49
- def get_full_url(self):
50
- # Only return the response's URL if the user hadn't set the Host
51
- # header
52
- if not self._r.headers.get("Host"):
53
- return self._r.url
54
- # If they did set it, retrieve it and reconstruct the expected domain
55
- host = to_native_string(self._r.headers["Host"], encoding="utf-8")
56
- parsed = urlparse(self._r.url)
57
- # Reconstruct the URL as we expect it
58
- return urlunparse(
59
- [
60
- parsed.scheme,
61
- host,
62
- parsed.path,
63
- parsed.params,
64
- parsed.query,
65
- parsed.fragment,
66
- ]
67
- )
68
-
69
- def is_unverifiable(self):
70
- return True
71
-
72
- def has_header(self, name):
73
- return name in self._r.headers or name in self._new_headers
74
-
75
- def get_header(self, name, default=None):
76
- return self._r.headers.get(name, self._new_headers.get(name, default))
77
-
78
- def add_header(self, key, val):
79
- """cookiejar has no legitimate use for this method; add it back if you find one."""
80
- raise NotImplementedError(
81
- "Cookie headers should be added with add_unredirected_header()"
82
- )
83
-
84
- def add_unredirected_header(self, name, value):
85
- self._new_headers[name] = value
86
-
87
- def get_new_headers(self):
88
- return self._new_headers
89
-
90
- @property
91
- def unverifiable(self):
92
- return self.is_unverifiable()
93
-
94
- @property
95
- def origin_req_host(self):
96
- return self.get_origin_req_host()
97
-
98
- @property
99
- def host(self):
100
- return self.get_host()
101
-
102
-
103
- class MockResponse:
104
- """Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`.
105
-
106
- ...what? Basically, expose the parsed HTTP headers from the server response
107
- the way `http.cookiejar` expects to see them.
108
- """
109
-
110
- def __init__(self, headers):
111
- """Make a MockResponse for `cookiejar` to read.
112
-
113
- :param headers: a httplib.HTTPMessage or analogous carrying the headers
114
- """
115
- self._headers = headers
116
-
117
- def info(self):
118
- return self._headers
119
-
120
- def getheaders(self, name):
121
- self._headers.getheaders(name)
122
-
123
-
124
- def extract_cookies_to_jar(jar, request, response):
125
- """Extract the cookies from the response into a CookieJar.
126
-
127
- :param jar: http.cookiejar.CookieJar (not necessarily a RequestsCookieJar)
128
- :param request: our own requests.Request object
129
- :param response: urllib3.HTTPResponse object
130
- """
131
- if not (hasattr(response, "_original_response") and response._original_response):
132
- return
133
- # the _original_response field is the wrapped httplib.HTTPResponse object,
134
- req = MockRequest(request)
135
- # pull out the HTTPMessage with the headers and put it in the mock:
136
- res = MockResponse(response._original_response.msg)
137
- jar.extract_cookies(res, req)
138
-
139
-
140
- def get_cookie_header(jar, request):
141
- """
142
- Produce an appropriate Cookie header string to be sent with `request`, or None.
143
-
144
- :rtype: str
145
- """
146
- r = MockRequest(request)
147
- jar.add_cookie_header(r)
148
- return r.get_new_headers().get("Cookie")
149
-
150
-
151
- def remove_cookie_by_name(cookiejar, name, domain=None, path=None):
152
- """Unsets a cookie by name, by default over all domains and paths.
153
-
154
- Wraps CookieJar.clear(), is O(n).
155
- """
156
- clearables = []
157
- for cookie in cookiejar:
158
- if cookie.name != name:
159
- continue
160
- if domain is not None and domain != cookie.domain:
161
- continue
162
- if path is not None and path != cookie.path:
163
- continue
164
- clearables.append((cookie.domain, cookie.path, cookie.name))
165
-
166
- for domain, path, name in clearables:
167
- cookiejar.clear(domain, path, name)
168
-
169
-
170
- class CookieConflictError(RuntimeError):
171
- """There are two cookies that meet the criteria specified in the cookie jar.
172
- Use .get and .set and include domain and path args in order to be more specific.
173
- """
174
-
175
-
176
- class RequestsCookieJar(cookielib.CookieJar, MutableMapping):
177
- """Compatibility class; is a http.cookiejar.CookieJar, but exposes a dict
178
- interface.
179
-
180
- This is the CookieJar we create by default for requests and sessions that
181
- don't specify one, since some clients may expect response.cookies and
182
- session.cookies to support dict operations.
183
-
184
- Requests does not use the dict interface internally; it's just for
185
- compatibility with external client code. All requests code should work
186
- out of the box with externally provided instances of ``CookieJar``, e.g.
187
- ``LWPCookieJar`` and ``FileCookieJar``.
188
-
189
- Unlike a regular CookieJar, this class is pickleable.
190
-
191
- .. warning:: dictionary operations that are normally O(1) may be O(n).
192
- """
193
-
194
- def get(self, name, default=None, domain=None, path=None):
195
- """Dict-like get() that also supports optional domain and path args in
196
- order to resolve naming collisions from using one cookie jar over
197
- multiple domains.
198
-
199
- .. warning:: operation is O(n), not O(1).
200
- """
201
- try:
202
- return self._find_no_duplicates(name, domain, path)
203
- except KeyError:
204
- return default
205
-
206
- def set(self, name, value, **kwargs):
207
- """Dict-like set() that also supports optional domain and path args in
208
- order to resolve naming collisions from using one cookie jar over
209
- multiple domains.
210
- """
211
- # support client code that unsets cookies by assignment of a None value:
212
- if value is None:
213
- remove_cookie_by_name(
214
- self, name, domain=kwargs.get("domain"), path=kwargs.get("path")
215
- )
216
- return
217
-
218
- if isinstance(value, Morsel):
219
- c = morsel_to_cookie(value)
220
- else:
221
- c = create_cookie(name, value, **kwargs)
222
- self.set_cookie(c)
223
- return c
224
-
225
- def iterkeys(self):
226
- """Dict-like iterkeys() that returns an iterator of names of cookies
227
- from the jar.
228
-
229
- .. seealso:: itervalues() and iteritems().
230
- """
231
- for cookie in iter(self):
232
- yield cookie.name
233
-
234
- def keys(self):
235
- """Dict-like keys() that returns a list of names of cookies from the
236
- jar.
237
-
238
- .. seealso:: values() and items().
239
- """
240
- return list(self.iterkeys())
241
-
242
- def itervalues(self):
243
- """Dict-like itervalues() that returns an iterator of values of cookies
244
- from the jar.
245
-
246
- .. seealso:: iterkeys() and iteritems().
247
- """
248
- for cookie in iter(self):
249
- yield cookie.value
250
-
251
- def values(self):
252
- """Dict-like values() that returns a list of values of cookies from the
253
- jar.
254
-
255
- .. seealso:: keys() and items().
256
- """
257
- return list(self.itervalues())
258
-
259
- def iteritems(self):
260
- """Dict-like iteritems() that returns an iterator of name-value tuples
261
- from the jar.
262
-
263
- .. seealso:: iterkeys() and itervalues().
264
- """
265
- for cookie in iter(self):
266
- yield cookie.name, cookie.value
267
-
268
- def items(self):
269
- """Dict-like items() that returns a list of name-value tuples from the
270
- jar. Allows client-code to call ``dict(RequestsCookieJar)`` and get a
271
- vanilla python dict of key value pairs.
272
-
273
- .. seealso:: keys() and values().
274
- """
275
- return list(self.iteritems())
276
-
277
- def list_domains(self):
278
- """Utility method to list all the domains in the jar."""
279
- domains = []
280
- for cookie in iter(self):
281
- if cookie.domain not in domains:
282
- domains.append(cookie.domain)
283
- return domains
284
-
285
- def list_paths(self):
286
- """Utility method to list all the paths in the jar."""
287
- paths = []
288
- for cookie in iter(self):
289
- if cookie.path not in paths:
290
- paths.append(cookie.path)
291
- return paths
292
-
293
- def multiple_domains(self):
294
- """Returns True if there are multiple domains in the jar.
295
- Returns False otherwise.
296
-
297
- :rtype: bool
298
- """
299
- domains = []
300
- for cookie in iter(self):
301
- if cookie.domain is not None and cookie.domain in domains:
302
- return True
303
- domains.append(cookie.domain)
304
- return False # there is only one domain in jar
305
-
306
- def get_dict(self, domain=None, path=None):
307
- """Takes as an argument an optional domain and path and returns a plain
308
- old Python dict of name-value pairs of cookies that meet the
309
- requirements.
310
-
311
- :rtype: dict
312
- """
313
- dictionary = {}
314
- for cookie in iter(self):
315
- if (domain is None or cookie.domain == domain) and (
316
- path is None or cookie.path == path
317
- ):
318
- dictionary[cookie.name] = cookie.value
319
- return dictionary
320
-
321
- def __contains__(self, name):
322
- try:
323
- return super().__contains__(name)
324
- except CookieConflictError:
325
- return True
326
-
327
- def __getitem__(self, name):
328
- """Dict-like __getitem__() for compatibility with client code. Throws
329
- exception if there are more than one cookie with name. In that case,
330
- use the more explicit get() method instead.
331
-
332
- .. warning:: operation is O(n), not O(1).
333
- """
334
- return self._find_no_duplicates(name)
335
-
336
- def __setitem__(self, name, value):
337
- """Dict-like __setitem__ for compatibility with client code. Throws
338
- exception if there is already a cookie of that name in the jar. In that
339
- case, use the more explicit set() method instead.
340
- """
341
- self.set(name, value)
342
-
343
- def __delitem__(self, name):
344
- """Deletes a cookie given a name. Wraps ``http.cookiejar.CookieJar``'s
345
- ``remove_cookie_by_name()``.
346
- """
347
- remove_cookie_by_name(self, name)
348
-
349
- def set_cookie(self, cookie, *args, **kwargs):
350
- if (
351
- hasattr(cookie.value, "startswith")
352
- and cookie.value.startswith('"')
353
- and cookie.value.endswith('"')
354
- ):
355
- cookie.value = cookie.value.replace('\\"', "")
356
- return super().set_cookie(cookie, *args, **kwargs)
357
-
358
- def update(self, other):
359
- """Updates this jar with cookies from another CookieJar or dict-like"""
360
- if isinstance(other, cookielib.CookieJar):
361
- for cookie in other:
362
- self.set_cookie(copy.copy(cookie))
363
- else:
364
- super().update(other)
365
-
366
- def _find(self, name, domain=None, path=None):
367
- """Requests uses this method internally to get cookie values.
368
-
369
- If there are conflicting cookies, _find arbitrarily chooses one.
370
- See _find_no_duplicates if you want an exception thrown if there are
371
- conflicting cookies.
372
-
373
- :param name: a string containing name of cookie
374
- :param domain: (optional) string containing domain of cookie
375
- :param path: (optional) string containing path of cookie
376
- :return: cookie.value
377
- """
378
- for cookie in iter(self):
379
- if cookie.name == name:
380
- if domain is None or cookie.domain == domain:
381
- if path is None or cookie.path == path:
382
- return cookie.value
383
-
384
- raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}")
385
-
386
- def _find_no_duplicates(self, name, domain=None, path=None):
387
- """Both ``__get_item__`` and ``get`` call this function: it's never
388
- used elsewhere in Requests.
389
-
390
- :param name: a string containing name of cookie
391
- :param domain: (optional) string containing domain of cookie
392
- :param path: (optional) string containing path of cookie
393
- :raises KeyError: if cookie is not found
394
- :raises CookieConflictError: if there are multiple cookies
395
- that match name and optionally domain and path
396
- :return: cookie.value
397
- """
398
- toReturn = None
399
- for cookie in iter(self):
400
- if cookie.name == name:
401
- if domain is None or cookie.domain == domain:
402
- if path is None or cookie.path == path:
403
- if toReturn is not None:
404
- # if there are multiple cookies that meet passed in criteria
405
- raise CookieConflictError(
406
- f"There are multiple cookies with name, {name!r}"
407
- )
408
- # we will eventually return this as long as no cookie conflict
409
- toReturn = cookie.value
410
-
411
- if toReturn:
412
- return toReturn
413
- raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}")
414
-
415
- def __getstate__(self):
416
- """Unlike a normal CookieJar, this class is pickleable."""
417
- state = self.__dict__.copy()
418
- # remove the unpickleable RLock object
419
- state.pop("_cookies_lock")
420
- return state
421
-
422
- def __setstate__(self, state):
423
- """Unlike a normal CookieJar, this class is pickleable."""
424
- self.__dict__.update(state)
425
- if "_cookies_lock" not in self.__dict__:
426
- self._cookies_lock = threading.RLock()
427
-
428
- def copy(self):
429
- """Return a copy of this RequestsCookieJar."""
430
- new_cj = RequestsCookieJar()
431
- new_cj.set_policy(self.get_policy())
432
- new_cj.update(self)
433
- return new_cj
434
-
435
- def get_policy(self):
436
- """Return the CookiePolicy instance used."""
437
- return self._policy
438
-
439
-
440
- def _copy_cookie_jar(jar):
441
- if jar is None:
442
- return None
443
-
444
- if hasattr(jar, "copy"):
445
- # We're dealing with an instance of RequestsCookieJar
446
- return jar.copy()
447
- # We're dealing with a generic CookieJar instance
448
- new_jar = copy.copy(jar)
449
- new_jar.clear()
450
- for cookie in jar:
451
- new_jar.set_cookie(copy.copy(cookie))
452
- return new_jar
453
-
454
-
455
- def create_cookie(name, value, **kwargs):
456
- """Make a cookie from underspecified parameters.
457
-
458
- By default, the pair of `name` and `value` will be set for the domain ''
459
- and sent on every request (this is sometimes called a "supercookie").
460
- """
461
- result = {
462
- "version": 0,
463
- "name": name,
464
- "value": value,
465
- "port": None,
466
- "domain": "",
467
- "path": "/",
468
- "secure": False,
469
- "expires": None,
470
- "discard": True,
471
- "comment": None,
472
- "comment_url": None,
473
- "rest": {"HttpOnly": None},
474
- "rfc2109": False,
475
- }
476
-
477
- badargs = set(kwargs) - set(result)
478
- if badargs:
479
- raise TypeError(
480
- f"create_cookie() got unexpected keyword arguments: {list(badargs)}"
481
- )
482
-
483
- result.update(kwargs)
484
- result["port_specified"] = bool(result["port"])
485
- result["domain_specified"] = bool(result["domain"])
486
- result["domain_initial_dot"] = result["domain"].startswith(".")
487
- result["path_specified"] = bool(result["path"])
488
-
489
- return cookielib.Cookie(**result)
490
-
491
-
492
- def morsel_to_cookie(morsel):
493
- """Convert a Morsel object into a Cookie containing the one k/v pair."""
494
-
495
- expires = None
496
- if morsel["max-age"]:
497
- try:
498
- expires = int(time.time() + int(morsel["max-age"]))
499
- except ValueError:
500
- raise TypeError(f"max-age: {morsel['max-age']} must be integer")
501
- elif morsel["expires"]:
502
- time_template = "%a, %d-%b-%Y %H:%M:%S GMT"
503
- expires = calendar.timegm(time.strptime(morsel["expires"], time_template))
504
- return create_cookie(
505
- comment=morsel["comment"],
506
- comment_url=bool(morsel["comment"]),
507
- discard=False,
508
- domain=morsel["domain"],
509
- expires=expires,
510
- name=morsel.key,
511
- path=morsel["path"],
512
- port=None,
513
- rest={"HttpOnly": morsel["httponly"]},
514
- rfc2109=False,
515
- secure=bool(morsel["secure"]),
516
- value=morsel.value,
517
- version=morsel["version"] or 0,
518
- )
519
-
520
-
521
- def cookiejar_from_dict(cookie_dict, cookiejar=None, overwrite=True):
522
- """Returns a CookieJar from a key/value dictionary.
523
-
524
- :param cookie_dict: Dict of key/values to insert into CookieJar.
525
- :param cookiejar: (optional) A cookiejar to add the cookies to.
526
- :param overwrite: (optional) If False, will not replace cookies
527
- already in the jar with new ones.
528
- :rtype: CookieJar
529
- """
530
- if cookiejar is None:
531
- cookiejar = RequestsCookieJar()
532
-
533
- if cookie_dict is not None:
534
- names_from_jar = [cookie.name for cookie in cookiejar]
535
- for name in cookie_dict:
536
- if overwrite or (name not in names_from_jar):
537
- cookiejar.set_cookie(create_cookie(name, cookie_dict[name]))
538
-
539
- return cookiejar
540
-
541
-
542
- def merge_cookies(cookiejar, cookies):
543
- """Add cookies to cookiejar and returns a merged CookieJar.
544
-
545
- :param cookiejar: CookieJar object to add the cookies to.
546
- :param cookies: Dictionary or CookieJar object to be added.
547
- :rtype: CookieJar
548
- """
549
- if not isinstance(cookiejar, cookielib.CookieJar):
550
- raise ValueError("You can only merge into CookieJar")
551
-
552
- if isinstance(cookies, dict):
553
- cookiejar = cookiejar_from_dict(cookies, cookiejar=cookiejar, overwrite=False)
554
- elif isinstance(cookies, cookielib.CookieJar):
555
- try:
556
- cookiejar.update(cookies)
557
- except AttributeError:
558
- for cookie_in_jar in cookies:
559
- cookiejar.set_cookie(cookie_in_jar)
560
-
561
- return cookiejar
@@ -1,151 +0,0 @@
1
- """
2
- requests.exceptions
3
- ~~~~~~~~~~~~~~~~~~~
4
-
5
- This module contains the set of Requests' exceptions.
6
- """
7
- from pip._vendor.urllib3.exceptions import HTTPError as BaseHTTPError
8
-
9
- from .compat import JSONDecodeError as CompatJSONDecodeError
10
-
11
-
12
- class RequestException(IOError):
13
- """There was an ambiguous exception that occurred while handling your
14
- request.
15
- """
16
-
17
- def __init__(self, *args, **kwargs):
18
- """Initialize RequestException with `request` and `response` objects."""
19
- response = kwargs.pop("response", None)
20
- self.response = response
21
- self.request = kwargs.pop("request", None)
22
- if response is not None and not self.request and hasattr(response, "request"):
23
- self.request = self.response.request
24
- super().__init__(*args, **kwargs)
25
-
26
-
27
- class InvalidJSONError(RequestException):
28
- """A JSON error occurred."""
29
-
30
-
31
- class JSONDecodeError(InvalidJSONError, CompatJSONDecodeError):
32
- """Couldn't decode the text into json"""
33
-
34
- def __init__(self, *args, **kwargs):
35
- """
36
- Construct the JSONDecodeError instance first with all
37
- args. Then use it's args to construct the IOError so that
38
- the json specific args aren't used as IOError specific args
39
- and the error message from JSONDecodeError is preserved.
40
- """
41
- CompatJSONDecodeError.__init__(self, *args)
42
- InvalidJSONError.__init__(self, *self.args, **kwargs)
43
-
44
- def __reduce__(self):
45
- """
46
- The __reduce__ method called when pickling the object must
47
- be the one from the JSONDecodeError (be it json/simplejson)
48
- as it expects all the arguments for instantiation, not just
49
- one like the IOError, and the MRO would by default call the
50
- __reduce__ method from the IOError due to the inheritance order.
51
- """
52
- return CompatJSONDecodeError.__reduce__(self)
53
-
54
-
55
- class HTTPError(RequestException):
56
- """An HTTP error occurred."""
57
-
58
-
59
- class ConnectionError(RequestException):
60
- """A Connection error occurred."""
61
-
62
-
63
- class ProxyError(ConnectionError):
64
- """A proxy error occurred."""
65
-
66
-
67
- class SSLError(ConnectionError):
68
- """An SSL error occurred."""
69
-
70
-
71
- class Timeout(RequestException):
72
- """The request timed out.
73
-
74
- Catching this error will catch both
75
- :exc:`~requests.exceptions.ConnectTimeout` and
76
- :exc:`~requests.exceptions.ReadTimeout` errors.
77
- """
78
-
79
-
80
- class ConnectTimeout(ConnectionError, Timeout):
81
- """The request timed out while trying to connect to the remote server.
82
-
83
- Requests that produced this error are safe to retry.
84
- """
85
-
86
-
87
- class ReadTimeout(Timeout):
88
- """The server did not send any data in the allotted amount of time."""
89
-
90
-
91
- class URLRequired(RequestException):
92
- """A valid URL is required to make a request."""
93
-
94
-
95
- class TooManyRedirects(RequestException):
96
- """Too many redirects."""
97
-
98
-
99
- class MissingSchema(RequestException, ValueError):
100
- """The URL scheme (e.g. http or https) is missing."""
101
-
102
-
103
- class InvalidSchema(RequestException, ValueError):
104
- """The URL scheme provided is either invalid or unsupported."""
105
-
106
-
107
- class InvalidURL(RequestException, ValueError):
108
- """The URL provided was somehow invalid."""
109
-
110
-
111
- class InvalidHeader(RequestException, ValueError):
112
- """The header value provided was somehow invalid."""
113
-
114
-
115
- class InvalidProxyURL(InvalidURL):
116
- """The proxy URL provided is invalid."""
117
-
118
-
119
- class ChunkedEncodingError(RequestException):
120
- """The server declared chunked encoding but sent an invalid chunk."""
121
-
122
-
123
- class ContentDecodingError(RequestException, BaseHTTPError):
124
- """Failed to decode response content."""
125
-
126
-
127
- class StreamConsumedError(RequestException, TypeError):
128
- """The content for this response was already consumed."""
129
-
130
-
131
- class RetryError(RequestException):
132
- """Custom retries logic failed"""
133
-
134
-
135
- class UnrewindableBodyError(RequestException):
136
- """Requests encountered an error when trying to rewind a body."""
137
-
138
-
139
- # Warnings
140
-
141
-
142
- class RequestsWarning(Warning):
143
- """Base warning for Requests."""
144
-
145
-
146
- class FileModeWarning(RequestsWarning, DeprecationWarning):
147
- """A file was opened in text mode, but Requests determined its binary length."""
148
-
149
-
150
- class RequestsDependencyWarning(RequestsWarning):
151
- """An imported dependency doesn't match the expected version range."""