cli-ih 0.6.3.1__py3-none-any.whl → 0.7.0__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 (426) hide show
  1. cli_ih/__init__.py +1 -0
  2. cli_ih/asyncClient.py +73 -10
  3. cli_ih/client.py +63 -18
  4. cli_ih/utils.py +51 -0
  5. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/METADATA +1 -1
  6. cli_ih-0.7.0.dist-info/RECORD +9 -0
  7. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/top_level.txt +0 -1
  8. cli_ih-0.6.3.1.dist-info/RECORD +0 -425
  9. venv/Lib/site-packages/__editable___cli_ih_0_6_3_1_finder.py +0 -85
  10. venv/Lib/site-packages/pip/__init__.py +0 -13
  11. venv/Lib/site-packages/pip/__main__.py +0 -24
  12. venv/Lib/site-packages/pip/__pip-runner__.py +0 -50
  13. venv/Lib/site-packages/pip/_internal/__init__.py +0 -18
  14. venv/Lib/site-packages/pip/_internal/build_env.py +0 -349
  15. venv/Lib/site-packages/pip/_internal/cache.py +0 -291
  16. venv/Lib/site-packages/pip/_internal/cli/__init__.py +0 -3
  17. venv/Lib/site-packages/pip/_internal/cli/autocompletion.py +0 -184
  18. venv/Lib/site-packages/pip/_internal/cli/base_command.py +0 -244
  19. venv/Lib/site-packages/pip/_internal/cli/cmdoptions.py +0 -1138
  20. venv/Lib/site-packages/pip/_internal/cli/command_context.py +0 -28
  21. venv/Lib/site-packages/pip/_internal/cli/index_command.py +0 -175
  22. venv/Lib/site-packages/pip/_internal/cli/main.py +0 -80
  23. venv/Lib/site-packages/pip/_internal/cli/main_parser.py +0 -134
  24. venv/Lib/site-packages/pip/_internal/cli/parser.py +0 -298
  25. venv/Lib/site-packages/pip/_internal/cli/progress_bars.py +0 -151
  26. venv/Lib/site-packages/pip/_internal/cli/req_command.py +0 -351
  27. venv/Lib/site-packages/pip/_internal/cli/spinners.py +0 -235
  28. venv/Lib/site-packages/pip/_internal/cli/status_codes.py +0 -6
  29. venv/Lib/site-packages/pip/_internal/commands/__init__.py +0 -139
  30. venv/Lib/site-packages/pip/_internal/commands/cache.py +0 -231
  31. venv/Lib/site-packages/pip/_internal/commands/check.py +0 -66
  32. venv/Lib/site-packages/pip/_internal/commands/completion.py +0 -135
  33. venv/Lib/site-packages/pip/_internal/commands/configuration.py +0 -288
  34. venv/Lib/site-packages/pip/_internal/commands/debug.py +0 -203
  35. venv/Lib/site-packages/pip/_internal/commands/download.py +0 -145
  36. venv/Lib/site-packages/pip/_internal/commands/freeze.py +0 -107
  37. venv/Lib/site-packages/pip/_internal/commands/hash.py +0 -58
  38. venv/Lib/site-packages/pip/_internal/commands/help.py +0 -40
  39. venv/Lib/site-packages/pip/_internal/commands/index.py +0 -159
  40. venv/Lib/site-packages/pip/_internal/commands/inspect.py +0 -92
  41. venv/Lib/site-packages/pip/_internal/commands/install.py +0 -798
  42. venv/Lib/site-packages/pip/_internal/commands/list.py +0 -400
  43. venv/Lib/site-packages/pip/_internal/commands/lock.py +0 -170
  44. venv/Lib/site-packages/pip/_internal/commands/search.py +0 -178
  45. venv/Lib/site-packages/pip/_internal/commands/show.py +0 -231
  46. venv/Lib/site-packages/pip/_internal/commands/uninstall.py +0 -113
  47. venv/Lib/site-packages/pip/_internal/commands/wheel.py +0 -181
  48. venv/Lib/site-packages/pip/_internal/configuration.py +0 -397
  49. venv/Lib/site-packages/pip/_internal/distributions/__init__.py +0 -21
  50. venv/Lib/site-packages/pip/_internal/distributions/base.py +0 -55
  51. venv/Lib/site-packages/pip/_internal/distributions/installed.py +0 -33
  52. venv/Lib/site-packages/pip/_internal/distributions/sdist.py +0 -165
  53. venv/Lib/site-packages/pip/_internal/distributions/wheel.py +0 -44
  54. venv/Lib/site-packages/pip/_internal/exceptions.py +0 -881
  55. venv/Lib/site-packages/pip/_internal/index/__init__.py +0 -1
  56. venv/Lib/site-packages/pip/_internal/index/collector.py +0 -489
  57. venv/Lib/site-packages/pip/_internal/index/package_finder.py +0 -1059
  58. venv/Lib/site-packages/pip/_internal/index/sources.py +0 -287
  59. venv/Lib/site-packages/pip/_internal/locations/__init__.py +0 -441
  60. venv/Lib/site-packages/pip/_internal/locations/_distutils.py +0 -173
  61. venv/Lib/site-packages/pip/_internal/locations/_sysconfig.py +0 -215
  62. venv/Lib/site-packages/pip/_internal/locations/base.py +0 -82
  63. venv/Lib/site-packages/pip/_internal/main.py +0 -12
  64. venv/Lib/site-packages/pip/_internal/metadata/__init__.py +0 -164
  65. venv/Lib/site-packages/pip/_internal/metadata/_json.py +0 -87
  66. venv/Lib/site-packages/pip/_internal/metadata/base.py +0 -685
  67. venv/Lib/site-packages/pip/_internal/metadata/importlib/__init__.py +0 -6
  68. venv/Lib/site-packages/pip/_internal/metadata/importlib/_compat.py +0 -87
  69. venv/Lib/site-packages/pip/_internal/metadata/importlib/_dists.py +0 -223
  70. venv/Lib/site-packages/pip/_internal/metadata/importlib/_envs.py +0 -143
  71. venv/Lib/site-packages/pip/_internal/metadata/pkg_resources.py +0 -298
  72. venv/Lib/site-packages/pip/_internal/models/__init__.py +0 -1
  73. venv/Lib/site-packages/pip/_internal/models/candidate.py +0 -25
  74. venv/Lib/site-packages/pip/_internal/models/direct_url.py +0 -227
  75. venv/Lib/site-packages/pip/_internal/models/format_control.py +0 -78
  76. venv/Lib/site-packages/pip/_internal/models/index.py +0 -28
  77. venv/Lib/site-packages/pip/_internal/models/installation_report.py +0 -57
  78. venv/Lib/site-packages/pip/_internal/models/link.py +0 -613
  79. venv/Lib/site-packages/pip/_internal/models/pylock.py +0 -188
  80. venv/Lib/site-packages/pip/_internal/models/scheme.py +0 -25
  81. venv/Lib/site-packages/pip/_internal/models/search_scope.py +0 -126
  82. venv/Lib/site-packages/pip/_internal/models/selection_prefs.py +0 -53
  83. venv/Lib/site-packages/pip/_internal/models/target_python.py +0 -122
  84. venv/Lib/site-packages/pip/_internal/models/wheel.py +0 -141
  85. venv/Lib/site-packages/pip/_internal/network/__init__.py +0 -1
  86. venv/Lib/site-packages/pip/_internal/network/auth.py +0 -564
  87. venv/Lib/site-packages/pip/_internal/network/cache.py +0 -133
  88. venv/Lib/site-packages/pip/_internal/network/download.py +0 -342
  89. venv/Lib/site-packages/pip/_internal/network/lazy_wheel.py +0 -213
  90. venv/Lib/site-packages/pip/_internal/network/session.py +0 -528
  91. venv/Lib/site-packages/pip/_internal/network/utils.py +0 -98
  92. venv/Lib/site-packages/pip/_internal/network/xmlrpc.py +0 -61
  93. venv/Lib/site-packages/pip/_internal/operations/__init__.py +0 -0
  94. venv/Lib/site-packages/pip/_internal/operations/build/__init__.py +0 -0
  95. venv/Lib/site-packages/pip/_internal/operations/build/build_tracker.py +0 -140
  96. venv/Lib/site-packages/pip/_internal/operations/build/metadata.py +0 -38
  97. venv/Lib/site-packages/pip/_internal/operations/build/metadata_editable.py +0 -41
  98. venv/Lib/site-packages/pip/_internal/operations/build/metadata_legacy.py +0 -73
  99. venv/Lib/site-packages/pip/_internal/operations/build/wheel.py +0 -38
  100. venv/Lib/site-packages/pip/_internal/operations/build/wheel_editable.py +0 -47
  101. venv/Lib/site-packages/pip/_internal/operations/build/wheel_legacy.py +0 -119
  102. venv/Lib/site-packages/pip/_internal/operations/check.py +0 -175
  103. venv/Lib/site-packages/pip/_internal/operations/freeze.py +0 -259
  104. venv/Lib/site-packages/pip/_internal/operations/install/__init__.py +0 -1
  105. venv/Lib/site-packages/pip/_internal/operations/install/editable_legacy.py +0 -48
  106. venv/Lib/site-packages/pip/_internal/operations/install/wheel.py +0 -746
  107. venv/Lib/site-packages/pip/_internal/operations/prepare.py +0 -742
  108. venv/Lib/site-packages/pip/_internal/pyproject.py +0 -182
  109. venv/Lib/site-packages/pip/_internal/req/__init__.py +0 -105
  110. venv/Lib/site-packages/pip/_internal/req/constructors.py +0 -562
  111. venv/Lib/site-packages/pip/_internal/req/req_dependency_group.py +0 -75
  112. venv/Lib/site-packages/pip/_internal/req/req_file.py +0 -620
  113. venv/Lib/site-packages/pip/_internal/req/req_install.py +0 -937
  114. venv/Lib/site-packages/pip/_internal/req/req_set.py +0 -81
  115. venv/Lib/site-packages/pip/_internal/req/req_uninstall.py +0 -639
  116. venv/Lib/site-packages/pip/_internal/resolution/__init__.py +0 -0
  117. venv/Lib/site-packages/pip/_internal/resolution/base.py +0 -20
  118. venv/Lib/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
  119. venv/Lib/site-packages/pip/_internal/resolution/legacy/resolver.py +0 -598
  120. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
  121. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/base.py +0 -142
  122. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/candidates.py +0 -582
  123. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/factory.py +0 -814
  124. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +0 -166
  125. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/provider.py +0 -276
  126. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/reporter.py +0 -85
  127. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/requirements.py +0 -247
  128. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/resolver.py +0 -336
  129. venv/Lib/site-packages/pip/_internal/self_outdated_check.py +0 -254
  130. venv/Lib/site-packages/pip/_internal/utils/__init__.py +0 -0
  131. venv/Lib/site-packages/pip/_internal/utils/_jaraco_text.py +0 -109
  132. venv/Lib/site-packages/pip/_internal/utils/_log.py +0 -38
  133. venv/Lib/site-packages/pip/_internal/utils/appdirs.py +0 -52
  134. venv/Lib/site-packages/pip/_internal/utils/compat.py +0 -85
  135. venv/Lib/site-packages/pip/_internal/utils/compatibility_tags.py +0 -201
  136. venv/Lib/site-packages/pip/_internal/utils/datetime.py +0 -10
  137. venv/Lib/site-packages/pip/_internal/utils/deprecation.py +0 -126
  138. venv/Lib/site-packages/pip/_internal/utils/direct_url_helpers.py +0 -87
  139. venv/Lib/site-packages/pip/_internal/utils/egg_link.py +0 -81
  140. venv/Lib/site-packages/pip/_internal/utils/entrypoints.py +0 -88
  141. venv/Lib/site-packages/pip/_internal/utils/filesystem.py +0 -152
  142. venv/Lib/site-packages/pip/_internal/utils/filetypes.py +0 -24
  143. venv/Lib/site-packages/pip/_internal/utils/glibc.py +0 -102
  144. venv/Lib/site-packages/pip/_internal/utils/hashes.py +0 -150
  145. venv/Lib/site-packages/pip/_internal/utils/logging.py +0 -364
  146. venv/Lib/site-packages/pip/_internal/utils/misc.py +0 -765
  147. venv/Lib/site-packages/pip/_internal/utils/packaging.py +0 -44
  148. venv/Lib/site-packages/pip/_internal/utils/retry.py +0 -45
  149. venv/Lib/site-packages/pip/_internal/utils/setuptools_build.py +0 -149
  150. venv/Lib/site-packages/pip/_internal/utils/subprocess.py +0 -248
  151. venv/Lib/site-packages/pip/_internal/utils/temp_dir.py +0 -294
  152. venv/Lib/site-packages/pip/_internal/utils/unpacking.py +0 -337
  153. venv/Lib/site-packages/pip/_internal/utils/urls.py +0 -55
  154. venv/Lib/site-packages/pip/_internal/utils/virtualenv.py +0 -105
  155. venv/Lib/site-packages/pip/_internal/utils/wheel.py +0 -132
  156. venv/Lib/site-packages/pip/_internal/vcs/__init__.py +0 -15
  157. venv/Lib/site-packages/pip/_internal/vcs/bazaar.py +0 -130
  158. venv/Lib/site-packages/pip/_internal/vcs/git.py +0 -571
  159. venv/Lib/site-packages/pip/_internal/vcs/mercurial.py +0 -186
  160. venv/Lib/site-packages/pip/_internal/vcs/subversion.py +0 -335
  161. venv/Lib/site-packages/pip/_internal/vcs/versioncontrol.py +0 -693
  162. venv/Lib/site-packages/pip/_internal/wheel_builder.py +0 -334
  163. venv/Lib/site-packages/pip/_vendor/__init__.py +0 -117
  164. venv/Lib/site-packages/pip/_vendor/cachecontrol/__init__.py +0 -29
  165. venv/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.py +0 -70
  166. venv/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py +0 -168
  167. venv/Lib/site-packages/pip/_vendor/cachecontrol/cache.py +0 -75
  168. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +0 -8
  169. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +0 -145
  170. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +0 -48
  171. venv/Lib/site-packages/pip/_vendor/cachecontrol/controller.py +0 -511
  172. venv/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.py +0 -119
  173. venv/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py +0 -157
  174. venv/Lib/site-packages/pip/_vendor/cachecontrol/py.typed +0 -0
  175. venv/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py +0 -146
  176. venv/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py +0 -43
  177. venv/Lib/site-packages/pip/_vendor/certifi/__init__.py +0 -4
  178. venv/Lib/site-packages/pip/_vendor/certifi/__main__.py +0 -12
  179. venv/Lib/site-packages/pip/_vendor/certifi/core.py +0 -83
  180. venv/Lib/site-packages/pip/_vendor/certifi/py.typed +0 -0
  181. venv/Lib/site-packages/pip/_vendor/dependency_groups/__init__.py +0 -13
  182. venv/Lib/site-packages/pip/_vendor/dependency_groups/__main__.py +0 -65
  183. venv/Lib/site-packages/pip/_vendor/dependency_groups/_implementation.py +0 -209
  184. venv/Lib/site-packages/pip/_vendor/dependency_groups/_lint_dependency_groups.py +0 -59
  185. venv/Lib/site-packages/pip/_vendor/dependency_groups/_pip_wrapper.py +0 -62
  186. venv/Lib/site-packages/pip/_vendor/dependency_groups/_toml_compat.py +0 -9
  187. venv/Lib/site-packages/pip/_vendor/dependency_groups/py.typed +0 -0
  188. venv/Lib/site-packages/pip/_vendor/distlib/__init__.py +0 -33
  189. venv/Lib/site-packages/pip/_vendor/distlib/compat.py +0 -1137
  190. venv/Lib/site-packages/pip/_vendor/distlib/resources.py +0 -358
  191. venv/Lib/site-packages/pip/_vendor/distlib/scripts.py +0 -447
  192. venv/Lib/site-packages/pip/_vendor/distlib/util.py +0 -1984
  193. venv/Lib/site-packages/pip/_vendor/distro/__init__.py +0 -54
  194. venv/Lib/site-packages/pip/_vendor/distro/__main__.py +0 -4
  195. venv/Lib/site-packages/pip/_vendor/distro/distro.py +0 -1403
  196. venv/Lib/site-packages/pip/_vendor/distro/py.typed +0 -0
  197. venv/Lib/site-packages/pip/_vendor/idna/__init__.py +0 -45
  198. venv/Lib/site-packages/pip/_vendor/idna/codec.py +0 -122
  199. venv/Lib/site-packages/pip/_vendor/idna/compat.py +0 -15
  200. venv/Lib/site-packages/pip/_vendor/idna/core.py +0 -437
  201. venv/Lib/site-packages/pip/_vendor/idna/idnadata.py +0 -4243
  202. venv/Lib/site-packages/pip/_vendor/idna/intranges.py +0 -57
  203. venv/Lib/site-packages/pip/_vendor/idna/package_data.py +0 -1
  204. venv/Lib/site-packages/pip/_vendor/idna/py.typed +0 -0
  205. venv/Lib/site-packages/pip/_vendor/idna/uts46data.py +0 -8681
  206. venv/Lib/site-packages/pip/_vendor/msgpack/__init__.py +0 -55
  207. venv/Lib/site-packages/pip/_vendor/msgpack/exceptions.py +0 -48
  208. venv/Lib/site-packages/pip/_vendor/msgpack/ext.py +0 -170
  209. venv/Lib/site-packages/pip/_vendor/msgpack/fallback.py +0 -929
  210. venv/Lib/site-packages/pip/_vendor/packaging/__init__.py +0 -15
  211. venv/Lib/site-packages/pip/_vendor/packaging/_elffile.py +0 -109
  212. venv/Lib/site-packages/pip/_vendor/packaging/_manylinux.py +0 -262
  213. venv/Lib/site-packages/pip/_vendor/packaging/_musllinux.py +0 -85
  214. venv/Lib/site-packages/pip/_vendor/packaging/_parser.py +0 -353
  215. venv/Lib/site-packages/pip/_vendor/packaging/_structures.py +0 -61
  216. venv/Lib/site-packages/pip/_vendor/packaging/_tokenizer.py +0 -195
  217. venv/Lib/site-packages/pip/_vendor/packaging/licenses/__init__.py +0 -145
  218. venv/Lib/site-packages/pip/_vendor/packaging/licenses/_spdx.py +0 -759
  219. venv/Lib/site-packages/pip/_vendor/packaging/markers.py +0 -362
  220. venv/Lib/site-packages/pip/_vendor/packaging/metadata.py +0 -862
  221. venv/Lib/site-packages/pip/_vendor/packaging/py.typed +0 -0
  222. venv/Lib/site-packages/pip/_vendor/packaging/requirements.py +0 -91
  223. venv/Lib/site-packages/pip/_vendor/packaging/specifiers.py +0 -1019
  224. venv/Lib/site-packages/pip/_vendor/packaging/tags.py +0 -656
  225. venv/Lib/site-packages/pip/_vendor/packaging/utils.py +0 -163
  226. venv/Lib/site-packages/pip/_vendor/packaging/version.py +0 -582
  227. venv/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py +0 -3676
  228. venv/Lib/site-packages/pip/_vendor/platformdirs/__init__.py +0 -631
  229. venv/Lib/site-packages/pip/_vendor/platformdirs/__main__.py +0 -55
  230. venv/Lib/site-packages/pip/_vendor/platformdirs/android.py +0 -249
  231. venv/Lib/site-packages/pip/_vendor/platformdirs/api.py +0 -299
  232. venv/Lib/site-packages/pip/_vendor/platformdirs/macos.py +0 -144
  233. venv/Lib/site-packages/pip/_vendor/platformdirs/py.typed +0 -0
  234. venv/Lib/site-packages/pip/_vendor/platformdirs/unix.py +0 -272
  235. venv/Lib/site-packages/pip/_vendor/platformdirs/version.py +0 -21
  236. venv/Lib/site-packages/pip/_vendor/platformdirs/windows.py +0 -272
  237. venv/Lib/site-packages/pip/_vendor/pygments/__init__.py +0 -82
  238. venv/Lib/site-packages/pip/_vendor/pygments/__main__.py +0 -17
  239. venv/Lib/site-packages/pip/_vendor/pygments/console.py +0 -70
  240. venv/Lib/site-packages/pip/_vendor/pygments/filter.py +0 -70
  241. venv/Lib/site-packages/pip/_vendor/pygments/filters/__init__.py +0 -940
  242. venv/Lib/site-packages/pip/_vendor/pygments/formatter.py +0 -129
  243. venv/Lib/site-packages/pip/_vendor/pygments/formatters/__init__.py +0 -157
  244. venv/Lib/site-packages/pip/_vendor/pygments/formatters/_mapping.py +0 -23
  245. venv/Lib/site-packages/pip/_vendor/pygments/lexer.py +0 -963
  246. venv/Lib/site-packages/pip/_vendor/pygments/lexers/__init__.py +0 -362
  247. venv/Lib/site-packages/pip/_vendor/pygments/lexers/_mapping.py +0 -602
  248. venv/Lib/site-packages/pip/_vendor/pygments/lexers/python.py +0 -1201
  249. venv/Lib/site-packages/pip/_vendor/pygments/modeline.py +0 -43
  250. venv/Lib/site-packages/pip/_vendor/pygments/plugin.py +0 -72
  251. venv/Lib/site-packages/pip/_vendor/pygments/regexopt.py +0 -91
  252. venv/Lib/site-packages/pip/_vendor/pygments/scanner.py +0 -104
  253. venv/Lib/site-packages/pip/_vendor/pygments/sphinxext.py +0 -247
  254. venv/Lib/site-packages/pip/_vendor/pygments/style.py +0 -203
  255. venv/Lib/site-packages/pip/_vendor/pygments/styles/__init__.py +0 -61
  256. venv/Lib/site-packages/pip/_vendor/pygments/styles/_mapping.py +0 -54
  257. venv/Lib/site-packages/pip/_vendor/pygments/token.py +0 -214
  258. venv/Lib/site-packages/pip/_vendor/pygments/unistring.py +0 -153
  259. venv/Lib/site-packages/pip/_vendor/pygments/util.py +0 -324
  260. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/__init__.py +0 -31
  261. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_impl.py +0 -410
  262. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/__init__.py +0 -21
  263. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py +0 -389
  264. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/py.typed +0 -0
  265. venv/Lib/site-packages/pip/_vendor/requests/__init__.py +0 -179
  266. venv/Lib/site-packages/pip/_vendor/requests/__version__.py +0 -14
  267. venv/Lib/site-packages/pip/_vendor/requests/_internal_utils.py +0 -50
  268. venv/Lib/site-packages/pip/_vendor/requests/adapters.py +0 -719
  269. venv/Lib/site-packages/pip/_vendor/requests/api.py +0 -157
  270. venv/Lib/site-packages/pip/_vendor/requests/auth.py +0 -314
  271. venv/Lib/site-packages/pip/_vendor/requests/certs.py +0 -17
  272. venv/Lib/site-packages/pip/_vendor/requests/compat.py +0 -90
  273. venv/Lib/site-packages/pip/_vendor/requests/cookies.py +0 -561
  274. venv/Lib/site-packages/pip/_vendor/requests/exceptions.py +0 -151
  275. venv/Lib/site-packages/pip/_vendor/requests/help.py +0 -127
  276. venv/Lib/site-packages/pip/_vendor/requests/hooks.py +0 -33
  277. venv/Lib/site-packages/pip/_vendor/requests/models.py +0 -1039
  278. venv/Lib/site-packages/pip/_vendor/requests/packages.py +0 -25
  279. venv/Lib/site-packages/pip/_vendor/requests/sessions.py +0 -831
  280. venv/Lib/site-packages/pip/_vendor/requests/status_codes.py +0 -128
  281. venv/Lib/site-packages/pip/_vendor/requests/structures.py +0 -99
  282. venv/Lib/site-packages/pip/_vendor/requests/utils.py +0 -1086
  283. venv/Lib/site-packages/pip/_vendor/resolvelib/__init__.py +0 -27
  284. venv/Lib/site-packages/pip/_vendor/resolvelib/providers.py +0 -196
  285. venv/Lib/site-packages/pip/_vendor/resolvelib/py.typed +0 -0
  286. venv/Lib/site-packages/pip/_vendor/resolvelib/reporters.py +0 -55
  287. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/__init__.py +0 -27
  288. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/abstract.py +0 -47
  289. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/criterion.py +0 -48
  290. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/exceptions.py +0 -57
  291. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py +0 -622
  292. venv/Lib/site-packages/pip/_vendor/resolvelib/structs.py +0 -209
  293. venv/Lib/site-packages/pip/_vendor/rich/__init__.py +0 -177
  294. venv/Lib/site-packages/pip/_vendor/rich/__main__.py +0 -245
  295. venv/Lib/site-packages/pip/_vendor/rich/_cell_widths.py +0 -454
  296. venv/Lib/site-packages/pip/_vendor/rich/_emoji_codes.py +0 -3610
  297. venv/Lib/site-packages/pip/_vendor/rich/_emoji_replace.py +0 -32
  298. venv/Lib/site-packages/pip/_vendor/rich/_export_format.py +0 -76
  299. venv/Lib/site-packages/pip/_vendor/rich/_extension.py +0 -10
  300. venv/Lib/site-packages/pip/_vendor/rich/_fileno.py +0 -24
  301. venv/Lib/site-packages/pip/_vendor/rich/_inspect.py +0 -268
  302. venv/Lib/site-packages/pip/_vendor/rich/_log_render.py +0 -94
  303. venv/Lib/site-packages/pip/_vendor/rich/_loop.py +0 -43
  304. venv/Lib/site-packages/pip/_vendor/rich/_null_file.py +0 -69
  305. venv/Lib/site-packages/pip/_vendor/rich/_palettes.py +0 -309
  306. venv/Lib/site-packages/pip/_vendor/rich/_pick.py +0 -17
  307. venv/Lib/site-packages/pip/_vendor/rich/_ratio.py +0 -153
  308. venv/Lib/site-packages/pip/_vendor/rich/_spinners.py +0 -482
  309. venv/Lib/site-packages/pip/_vendor/rich/_stack.py +0 -16
  310. venv/Lib/site-packages/pip/_vendor/rich/_timer.py +0 -19
  311. venv/Lib/site-packages/pip/_vendor/rich/_win32_console.py +0 -661
  312. venv/Lib/site-packages/pip/_vendor/rich/_windows.py +0 -71
  313. venv/Lib/site-packages/pip/_vendor/rich/_windows_renderer.py +0 -56
  314. venv/Lib/site-packages/pip/_vendor/rich/_wrap.py +0 -93
  315. venv/Lib/site-packages/pip/_vendor/rich/abc.py +0 -33
  316. venv/Lib/site-packages/pip/_vendor/rich/align.py +0 -306
  317. venv/Lib/site-packages/pip/_vendor/rich/ansi.py +0 -241
  318. venv/Lib/site-packages/pip/_vendor/rich/bar.py +0 -93
  319. venv/Lib/site-packages/pip/_vendor/rich/box.py +0 -474
  320. venv/Lib/site-packages/pip/_vendor/rich/cells.py +0 -174
  321. venv/Lib/site-packages/pip/_vendor/rich/color.py +0 -621
  322. venv/Lib/site-packages/pip/_vendor/rich/color_triplet.py +0 -38
  323. venv/Lib/site-packages/pip/_vendor/rich/columns.py +0 -187
  324. venv/Lib/site-packages/pip/_vendor/rich/console.py +0 -2680
  325. venv/Lib/site-packages/pip/_vendor/rich/constrain.py +0 -37
  326. venv/Lib/site-packages/pip/_vendor/rich/containers.py +0 -167
  327. venv/Lib/site-packages/pip/_vendor/rich/control.py +0 -219
  328. venv/Lib/site-packages/pip/_vendor/rich/default_styles.py +0 -193
  329. venv/Lib/site-packages/pip/_vendor/rich/diagnose.py +0 -39
  330. venv/Lib/site-packages/pip/_vendor/rich/emoji.py +0 -91
  331. venv/Lib/site-packages/pip/_vendor/rich/errors.py +0 -34
  332. venv/Lib/site-packages/pip/_vendor/rich/file_proxy.py +0 -57
  333. venv/Lib/site-packages/pip/_vendor/rich/filesize.py +0 -88
  334. venv/Lib/site-packages/pip/_vendor/rich/highlighter.py +0 -232
  335. venv/Lib/site-packages/pip/_vendor/rich/json.py +0 -139
  336. venv/Lib/site-packages/pip/_vendor/rich/jupyter.py +0 -101
  337. venv/Lib/site-packages/pip/_vendor/rich/layout.py +0 -442
  338. venv/Lib/site-packages/pip/_vendor/rich/live.py +0 -400
  339. venv/Lib/site-packages/pip/_vendor/rich/live_render.py +0 -106
  340. venv/Lib/site-packages/pip/_vendor/rich/logging.py +0 -297
  341. venv/Lib/site-packages/pip/_vendor/rich/markup.py +0 -251
  342. venv/Lib/site-packages/pip/_vendor/rich/measure.py +0 -151
  343. venv/Lib/site-packages/pip/_vendor/rich/padding.py +0 -141
  344. venv/Lib/site-packages/pip/_vendor/rich/pager.py +0 -34
  345. venv/Lib/site-packages/pip/_vendor/rich/palette.py +0 -100
  346. venv/Lib/site-packages/pip/_vendor/rich/panel.py +0 -317
  347. venv/Lib/site-packages/pip/_vendor/rich/pretty.py +0 -1016
  348. venv/Lib/site-packages/pip/_vendor/rich/progress.py +0 -1715
  349. venv/Lib/site-packages/pip/_vendor/rich/progress_bar.py +0 -223
  350. venv/Lib/site-packages/pip/_vendor/rich/prompt.py +0 -400
  351. venv/Lib/site-packages/pip/_vendor/rich/protocol.py +0 -42
  352. venv/Lib/site-packages/pip/_vendor/rich/py.typed +0 -0
  353. venv/Lib/site-packages/pip/_vendor/rich/region.py +0 -10
  354. venv/Lib/site-packages/pip/_vendor/rich/repr.py +0 -149
  355. venv/Lib/site-packages/pip/_vendor/rich/rule.py +0 -130
  356. venv/Lib/site-packages/pip/_vendor/rich/scope.py +0 -86
  357. venv/Lib/site-packages/pip/_vendor/rich/screen.py +0 -54
  358. venv/Lib/site-packages/pip/_vendor/rich/segment.py +0 -752
  359. venv/Lib/site-packages/pip/_vendor/rich/spinner.py +0 -132
  360. venv/Lib/site-packages/pip/_vendor/rich/status.py +0 -131
  361. venv/Lib/site-packages/pip/_vendor/rich/style.py +0 -796
  362. venv/Lib/site-packages/pip/_vendor/rich/styled.py +0 -42
  363. venv/Lib/site-packages/pip/_vendor/rich/syntax.py +0 -985
  364. venv/Lib/site-packages/pip/_vendor/rich/table.py +0 -1006
  365. venv/Lib/site-packages/pip/_vendor/rich/terminal_theme.py +0 -153
  366. venv/Lib/site-packages/pip/_vendor/rich/text.py +0 -1361
  367. venv/Lib/site-packages/pip/_vendor/rich/theme.py +0 -115
  368. venv/Lib/site-packages/pip/_vendor/rich/themes.py +0 -5
  369. venv/Lib/site-packages/pip/_vendor/rich/traceback.py +0 -899
  370. venv/Lib/site-packages/pip/_vendor/rich/tree.py +0 -257
  371. venv/Lib/site-packages/pip/_vendor/tomli/__init__.py +0 -8
  372. venv/Lib/site-packages/pip/_vendor/tomli/_parser.py +0 -770
  373. venv/Lib/site-packages/pip/_vendor/tomli/_re.py +0 -112
  374. venv/Lib/site-packages/pip/_vendor/tomli/_types.py +0 -10
  375. venv/Lib/site-packages/pip/_vendor/tomli/py.typed +0 -1
  376. venv/Lib/site-packages/pip/_vendor/tomli_w/__init__.py +0 -4
  377. venv/Lib/site-packages/pip/_vendor/tomli_w/_writer.py +0 -229
  378. venv/Lib/site-packages/pip/_vendor/tomli_w/py.typed +0 -1
  379. venv/Lib/site-packages/pip/_vendor/truststore/__init__.py +0 -36
  380. venv/Lib/site-packages/pip/_vendor/truststore/_api.py +0 -333
  381. venv/Lib/site-packages/pip/_vendor/truststore/_macos.py +0 -571
  382. venv/Lib/site-packages/pip/_vendor/truststore/_openssl.py +0 -66
  383. venv/Lib/site-packages/pip/_vendor/truststore/_ssl_constants.py +0 -31
  384. venv/Lib/site-packages/pip/_vendor/truststore/_windows.py +0 -567
  385. venv/Lib/site-packages/pip/_vendor/truststore/py.typed +0 -0
  386. venv/Lib/site-packages/pip/_vendor/urllib3/__init__.py +0 -102
  387. venv/Lib/site-packages/pip/_vendor/urllib3/_collections.py +0 -355
  388. venv/Lib/site-packages/pip/_vendor/urllib3/_version.py +0 -2
  389. venv/Lib/site-packages/pip/_vendor/urllib3/connection.py +0 -572
  390. venv/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py +0 -1140
  391. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
  392. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +0 -36
  393. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
  394. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +0 -519
  395. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +0 -397
  396. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/appengine.py +0 -314
  397. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +0 -130
  398. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +0 -518
  399. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +0 -920
  400. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/socks.py +0 -216
  401. venv/Lib/site-packages/pip/_vendor/urllib3/exceptions.py +0 -323
  402. venv/Lib/site-packages/pip/_vendor/urllib3/fields.py +0 -274
  403. venv/Lib/site-packages/pip/_vendor/urllib3/filepost.py +0 -98
  404. venv/Lib/site-packages/pip/_vendor/urllib3/packages/__init__.py +0 -0
  405. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
  406. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +0 -51
  407. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/weakref_finalize.py +0 -155
  408. venv/Lib/site-packages/pip/_vendor/urllib3/packages/six.py +0 -1076
  409. venv/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py +0 -540
  410. venv/Lib/site-packages/pip/_vendor/urllib3/request.py +0 -191
  411. venv/Lib/site-packages/pip/_vendor/urllib3/response.py +0 -879
  412. venv/Lib/site-packages/pip/_vendor/urllib3/util/__init__.py +0 -49
  413. venv/Lib/site-packages/pip/_vendor/urllib3/util/connection.py +0 -149
  414. venv/Lib/site-packages/pip/_vendor/urllib3/util/proxy.py +0 -57
  415. venv/Lib/site-packages/pip/_vendor/urllib3/util/queue.py +0 -22
  416. venv/Lib/site-packages/pip/_vendor/urllib3/util/request.py +0 -137
  417. venv/Lib/site-packages/pip/_vendor/urllib3/util/response.py +0 -107
  418. venv/Lib/site-packages/pip/_vendor/urllib3/util/retry.py +0 -622
  419. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py +0 -504
  420. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +0 -159
  421. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssltransport.py +0 -221
  422. venv/Lib/site-packages/pip/_vendor/urllib3/util/timeout.py +0 -271
  423. venv/Lib/site-packages/pip/_vendor/urllib3/util/url.py +0 -435
  424. venv/Lib/site-packages/pip/_vendor/urllib3/util/wait.py +0 -152
  425. venv/Lib/site-packages/pip/py.typed +0 -4
  426. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/WHEEL +0 -0
@@ -1,223 +0,0 @@
1
- import math
2
- from functools import lru_cache
3
- from time import monotonic
4
- from typing import Iterable, List, Optional
5
-
6
- from .color import Color, blend_rgb
7
- from .color_triplet import ColorTriplet
8
- from .console import Console, ConsoleOptions, RenderResult
9
- from .jupyter import JupyterMixin
10
- from .measure import Measurement
11
- from .segment import Segment
12
- from .style import Style, StyleType
13
-
14
- # Number of characters before 'pulse' animation repeats
15
- PULSE_SIZE = 20
16
-
17
-
18
- class ProgressBar(JupyterMixin):
19
- """Renders a (progress) bar. Used by rich.progress.
20
-
21
- Args:
22
- total (float, optional): Number of steps in the bar. Defaults to 100. Set to None to render a pulsing animation.
23
- completed (float, optional): Number of steps completed. Defaults to 0.
24
- width (int, optional): Width of the bar, or ``None`` for maximum width. Defaults to None.
25
- pulse (bool, optional): Enable pulse effect. Defaults to False. Will pulse if a None total was passed.
26
- style (StyleType, optional): Style for the bar background. Defaults to "bar.back".
27
- complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete".
28
- finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished".
29
- pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse".
30
- animation_time (Optional[float], optional): Time in seconds to use for animation, or None to use system time.
31
- """
32
-
33
- def __init__(
34
- self,
35
- total: Optional[float] = 100.0,
36
- completed: float = 0,
37
- width: Optional[int] = None,
38
- pulse: bool = False,
39
- style: StyleType = "bar.back",
40
- complete_style: StyleType = "bar.complete",
41
- finished_style: StyleType = "bar.finished",
42
- pulse_style: StyleType = "bar.pulse",
43
- animation_time: Optional[float] = None,
44
- ):
45
- self.total = total
46
- self.completed = completed
47
- self.width = width
48
- self.pulse = pulse
49
- self.style = style
50
- self.complete_style = complete_style
51
- self.finished_style = finished_style
52
- self.pulse_style = pulse_style
53
- self.animation_time = animation_time
54
-
55
- self._pulse_segments: Optional[List[Segment]] = None
56
-
57
- def __repr__(self) -> str:
58
- return f"<Bar {self.completed!r} of {self.total!r}>"
59
-
60
- @property
61
- def percentage_completed(self) -> Optional[float]:
62
- """Calculate percentage complete."""
63
- if self.total is None:
64
- return None
65
- completed = (self.completed / self.total) * 100.0
66
- completed = min(100, max(0.0, completed))
67
- return completed
68
-
69
- @lru_cache(maxsize=16)
70
- def _get_pulse_segments(
71
- self,
72
- fore_style: Style,
73
- back_style: Style,
74
- color_system: str,
75
- no_color: bool,
76
- ascii: bool = False,
77
- ) -> List[Segment]:
78
- """Get a list of segments to render a pulse animation.
79
-
80
- Returns:
81
- List[Segment]: A list of segments, one segment per character.
82
- """
83
- bar = "-" if ascii else "━"
84
- segments: List[Segment] = []
85
- if color_system not in ("standard", "eight_bit", "truecolor") or no_color:
86
- segments += [Segment(bar, fore_style)] * (PULSE_SIZE // 2)
87
- segments += [Segment(" " if no_color else bar, back_style)] * (
88
- PULSE_SIZE - (PULSE_SIZE // 2)
89
- )
90
- return segments
91
-
92
- append = segments.append
93
- fore_color = (
94
- fore_style.color.get_truecolor()
95
- if fore_style.color
96
- else ColorTriplet(255, 0, 255)
97
- )
98
- back_color = (
99
- back_style.color.get_truecolor()
100
- if back_style.color
101
- else ColorTriplet(0, 0, 0)
102
- )
103
- cos = math.cos
104
- pi = math.pi
105
- _Segment = Segment
106
- _Style = Style
107
- from_triplet = Color.from_triplet
108
-
109
- for index in range(PULSE_SIZE):
110
- position = index / PULSE_SIZE
111
- fade = 0.5 + cos(position * pi * 2) / 2.0
112
- color = blend_rgb(fore_color, back_color, cross_fade=fade)
113
- append(_Segment(bar, _Style(color=from_triplet(color))))
114
- return segments
115
-
116
- def update(self, completed: float, total: Optional[float] = None) -> None:
117
- """Update progress with new values.
118
-
119
- Args:
120
- completed (float): Number of steps completed.
121
- total (float, optional): Total number of steps, or ``None`` to not change. Defaults to None.
122
- """
123
- self.completed = completed
124
- self.total = total if total is not None else self.total
125
-
126
- def _render_pulse(
127
- self, console: Console, width: int, ascii: bool = False
128
- ) -> Iterable[Segment]:
129
- """Renders the pulse animation.
130
-
131
- Args:
132
- console (Console): Console instance.
133
- width (int): Width in characters of pulse animation.
134
-
135
- Returns:
136
- RenderResult: [description]
137
-
138
- Yields:
139
- Iterator[Segment]: Segments to render pulse
140
- """
141
- fore_style = console.get_style(self.pulse_style, default="white")
142
- back_style = console.get_style(self.style, default="black")
143
-
144
- pulse_segments = self._get_pulse_segments(
145
- fore_style, back_style, console.color_system, console.no_color, ascii=ascii
146
- )
147
- segment_count = len(pulse_segments)
148
- current_time = (
149
- monotonic() if self.animation_time is None else self.animation_time
150
- )
151
- segments = pulse_segments * (int(width / segment_count) + 2)
152
- offset = int(-current_time * 15) % segment_count
153
- segments = segments[offset : offset + width]
154
- yield from segments
155
-
156
- def __rich_console__(
157
- self, console: Console, options: ConsoleOptions
158
- ) -> RenderResult:
159
- width = min(self.width or options.max_width, options.max_width)
160
- ascii = options.legacy_windows or options.ascii_only
161
- should_pulse = self.pulse or self.total is None
162
- if should_pulse:
163
- yield from self._render_pulse(console, width, ascii=ascii)
164
- return
165
-
166
- completed: Optional[float] = (
167
- min(self.total, max(0, self.completed)) if self.total is not None else None
168
- )
169
-
170
- bar = "-" if ascii else "━"
171
- half_bar_right = " " if ascii else "╸"
172
- half_bar_left = " " if ascii else "╺"
173
- complete_halves = (
174
- int(width * 2 * completed / self.total)
175
- if self.total and completed is not None
176
- else width * 2
177
- )
178
- bar_count = complete_halves // 2
179
- half_bar_count = complete_halves % 2
180
- style = console.get_style(self.style)
181
- is_finished = self.total is None or self.completed >= self.total
182
- complete_style = console.get_style(
183
- self.finished_style if is_finished else self.complete_style
184
- )
185
- _Segment = Segment
186
- if bar_count:
187
- yield _Segment(bar * bar_count, complete_style)
188
- if half_bar_count:
189
- yield _Segment(half_bar_right * half_bar_count, complete_style)
190
-
191
- if not console.no_color:
192
- remaining_bars = width - bar_count - half_bar_count
193
- if remaining_bars and console.color_system is not None:
194
- if not half_bar_count and bar_count:
195
- yield _Segment(half_bar_left, style)
196
- remaining_bars -= 1
197
- if remaining_bars:
198
- yield _Segment(bar * remaining_bars, style)
199
-
200
- def __rich_measure__(
201
- self, console: Console, options: ConsoleOptions
202
- ) -> Measurement:
203
- return (
204
- Measurement(self.width, self.width)
205
- if self.width is not None
206
- else Measurement(4, options.max_width)
207
- )
208
-
209
-
210
- if __name__ == "__main__": # pragma: no cover
211
- console = Console()
212
- bar = ProgressBar(width=50, total=100)
213
-
214
- import time
215
-
216
- console.show_cursor(False)
217
- for n in range(0, 101, 1):
218
- bar.update(n)
219
- console.print(bar)
220
- console.file.write("\r")
221
- time.sleep(0.05)
222
- console.show_cursor(True)
223
- console.print()
@@ -1,400 +0,0 @@
1
- from typing import Any, Generic, List, Optional, TextIO, TypeVar, Union, overload
2
-
3
- from . import get_console
4
- from .console import Console
5
- from .text import Text, TextType
6
-
7
- PromptType = TypeVar("PromptType")
8
- DefaultType = TypeVar("DefaultType")
9
-
10
-
11
- class PromptError(Exception):
12
- """Exception base class for prompt related errors."""
13
-
14
-
15
- class InvalidResponse(PromptError):
16
- """Exception to indicate a response was invalid. Raise this within process_response() to indicate an error
17
- and provide an error message.
18
-
19
- Args:
20
- message (Union[str, Text]): Error message.
21
- """
22
-
23
- def __init__(self, message: TextType) -> None:
24
- self.message = message
25
-
26
- def __rich__(self) -> TextType:
27
- return self.message
28
-
29
-
30
- class PromptBase(Generic[PromptType]):
31
- """Ask the user for input until a valid response is received. This is the base class, see one of
32
- the concrete classes for examples.
33
-
34
- Args:
35
- prompt (TextType, optional): Prompt text. Defaults to "".
36
- console (Console, optional): A Console instance or None to use global console. Defaults to None.
37
- password (bool, optional): Enable password input. Defaults to False.
38
- choices (List[str], optional): A list of valid choices. Defaults to None.
39
- case_sensitive (bool, optional): Matching of choices should be case-sensitive. Defaults to True.
40
- show_default (bool, optional): Show default in prompt. Defaults to True.
41
- show_choices (bool, optional): Show choices in prompt. Defaults to True.
42
- """
43
-
44
- response_type: type = str
45
-
46
- validate_error_message = "[prompt.invalid]Please enter a valid value"
47
- illegal_choice_message = (
48
- "[prompt.invalid.choice]Please select one of the available options"
49
- )
50
- prompt_suffix = ": "
51
-
52
- choices: Optional[List[str]] = None
53
-
54
- def __init__(
55
- self,
56
- prompt: TextType = "",
57
- *,
58
- console: Optional[Console] = None,
59
- password: bool = False,
60
- choices: Optional[List[str]] = None,
61
- case_sensitive: bool = True,
62
- show_default: bool = True,
63
- show_choices: bool = True,
64
- ) -> None:
65
- self.console = console or get_console()
66
- self.prompt = (
67
- Text.from_markup(prompt, style="prompt")
68
- if isinstance(prompt, str)
69
- else prompt
70
- )
71
- self.password = password
72
- if choices is not None:
73
- self.choices = choices
74
- self.case_sensitive = case_sensitive
75
- self.show_default = show_default
76
- self.show_choices = show_choices
77
-
78
- @classmethod
79
- @overload
80
- def ask(
81
- cls,
82
- prompt: TextType = "",
83
- *,
84
- console: Optional[Console] = None,
85
- password: bool = False,
86
- choices: Optional[List[str]] = None,
87
- case_sensitive: bool = True,
88
- show_default: bool = True,
89
- show_choices: bool = True,
90
- default: DefaultType,
91
- stream: Optional[TextIO] = None,
92
- ) -> Union[DefaultType, PromptType]:
93
- ...
94
-
95
- @classmethod
96
- @overload
97
- def ask(
98
- cls,
99
- prompt: TextType = "",
100
- *,
101
- console: Optional[Console] = None,
102
- password: bool = False,
103
- choices: Optional[List[str]] = None,
104
- case_sensitive: bool = True,
105
- show_default: bool = True,
106
- show_choices: bool = True,
107
- stream: Optional[TextIO] = None,
108
- ) -> PromptType:
109
- ...
110
-
111
- @classmethod
112
- def ask(
113
- cls,
114
- prompt: TextType = "",
115
- *,
116
- console: Optional[Console] = None,
117
- password: bool = False,
118
- choices: Optional[List[str]] = None,
119
- case_sensitive: bool = True,
120
- show_default: bool = True,
121
- show_choices: bool = True,
122
- default: Any = ...,
123
- stream: Optional[TextIO] = None,
124
- ) -> Any:
125
- """Shortcut to construct and run a prompt loop and return the result.
126
-
127
- Example:
128
- >>> filename = Prompt.ask("Enter a filename")
129
-
130
- Args:
131
- prompt (TextType, optional): Prompt text. Defaults to "".
132
- console (Console, optional): A Console instance or None to use global console. Defaults to None.
133
- password (bool, optional): Enable password input. Defaults to False.
134
- choices (List[str], optional): A list of valid choices. Defaults to None.
135
- case_sensitive (bool, optional): Matching of choices should be case-sensitive. Defaults to True.
136
- show_default (bool, optional): Show default in prompt. Defaults to True.
137
- show_choices (bool, optional): Show choices in prompt. Defaults to True.
138
- stream (TextIO, optional): Optional text file open for reading to get input. Defaults to None.
139
- """
140
- _prompt = cls(
141
- prompt,
142
- console=console,
143
- password=password,
144
- choices=choices,
145
- case_sensitive=case_sensitive,
146
- show_default=show_default,
147
- show_choices=show_choices,
148
- )
149
- return _prompt(default=default, stream=stream)
150
-
151
- def render_default(self, default: DefaultType) -> Text:
152
- """Turn the supplied default in to a Text instance.
153
-
154
- Args:
155
- default (DefaultType): Default value.
156
-
157
- Returns:
158
- Text: Text containing rendering of default value.
159
- """
160
- return Text(f"({default})", "prompt.default")
161
-
162
- def make_prompt(self, default: DefaultType) -> Text:
163
- """Make prompt text.
164
-
165
- Args:
166
- default (DefaultType): Default value.
167
-
168
- Returns:
169
- Text: Text to display in prompt.
170
- """
171
- prompt = self.prompt.copy()
172
- prompt.end = ""
173
-
174
- if self.show_choices and self.choices:
175
- _choices = "/".join(self.choices)
176
- choices = f"[{_choices}]"
177
- prompt.append(" ")
178
- prompt.append(choices, "prompt.choices")
179
-
180
- if (
181
- default != ...
182
- and self.show_default
183
- and isinstance(default, (str, self.response_type))
184
- ):
185
- prompt.append(" ")
186
- _default = self.render_default(default)
187
- prompt.append(_default)
188
-
189
- prompt.append(self.prompt_suffix)
190
-
191
- return prompt
192
-
193
- @classmethod
194
- def get_input(
195
- cls,
196
- console: Console,
197
- prompt: TextType,
198
- password: bool,
199
- stream: Optional[TextIO] = None,
200
- ) -> str:
201
- """Get input from user.
202
-
203
- Args:
204
- console (Console): Console instance.
205
- prompt (TextType): Prompt text.
206
- password (bool): Enable password entry.
207
-
208
- Returns:
209
- str: String from user.
210
- """
211
- return console.input(prompt, password=password, stream=stream)
212
-
213
- def check_choice(self, value: str) -> bool:
214
- """Check value is in the list of valid choices.
215
-
216
- Args:
217
- value (str): Value entered by user.
218
-
219
- Returns:
220
- bool: True if choice was valid, otherwise False.
221
- """
222
- assert self.choices is not None
223
- if self.case_sensitive:
224
- return value.strip() in self.choices
225
- return value.strip().lower() in [choice.lower() for choice in self.choices]
226
-
227
- def process_response(self, value: str) -> PromptType:
228
- """Process response from user, convert to prompt type.
229
-
230
- Args:
231
- value (str): String typed by user.
232
-
233
- Raises:
234
- InvalidResponse: If ``value`` is invalid.
235
-
236
- Returns:
237
- PromptType: The value to be returned from ask method.
238
- """
239
- value = value.strip()
240
- try:
241
- return_value: PromptType = self.response_type(value)
242
- except ValueError:
243
- raise InvalidResponse(self.validate_error_message)
244
-
245
- if self.choices is not None:
246
- if not self.check_choice(value):
247
- raise InvalidResponse(self.illegal_choice_message)
248
-
249
- if not self.case_sensitive:
250
- # return the original choice, not the lower case version
251
- return_value = self.response_type(
252
- self.choices[
253
- [choice.lower() for choice in self.choices].index(value.lower())
254
- ]
255
- )
256
- return return_value
257
-
258
- def on_validate_error(self, value: str, error: InvalidResponse) -> None:
259
- """Called to handle validation error.
260
-
261
- Args:
262
- value (str): String entered by user.
263
- error (InvalidResponse): Exception instance the initiated the error.
264
- """
265
- self.console.print(error)
266
-
267
- def pre_prompt(self) -> None:
268
- """Hook to display something before the prompt."""
269
-
270
- @overload
271
- def __call__(self, *, stream: Optional[TextIO] = None) -> PromptType:
272
- ...
273
-
274
- @overload
275
- def __call__(
276
- self, *, default: DefaultType, stream: Optional[TextIO] = None
277
- ) -> Union[PromptType, DefaultType]:
278
- ...
279
-
280
- def __call__(self, *, default: Any = ..., stream: Optional[TextIO] = None) -> Any:
281
- """Run the prompt loop.
282
-
283
- Args:
284
- default (Any, optional): Optional default value.
285
-
286
- Returns:
287
- PromptType: Processed value.
288
- """
289
- while True:
290
- self.pre_prompt()
291
- prompt = self.make_prompt(default)
292
- value = self.get_input(self.console, prompt, self.password, stream=stream)
293
- if value == "" and default != ...:
294
- return default
295
- try:
296
- return_value = self.process_response(value)
297
- except InvalidResponse as error:
298
- self.on_validate_error(value, error)
299
- continue
300
- else:
301
- return return_value
302
-
303
-
304
- class Prompt(PromptBase[str]):
305
- """A prompt that returns a str.
306
-
307
- Example:
308
- >>> name = Prompt.ask("Enter your name")
309
-
310
-
311
- """
312
-
313
- response_type = str
314
-
315
-
316
- class IntPrompt(PromptBase[int]):
317
- """A prompt that returns an integer.
318
-
319
- Example:
320
- >>> burrito_count = IntPrompt.ask("How many burritos do you want to order")
321
-
322
- """
323
-
324
- response_type = int
325
- validate_error_message = "[prompt.invalid]Please enter a valid integer number"
326
-
327
-
328
- class FloatPrompt(PromptBase[float]):
329
- """A prompt that returns a float.
330
-
331
- Example:
332
- >>> temperature = FloatPrompt.ask("Enter desired temperature")
333
-
334
- """
335
-
336
- response_type = float
337
- validate_error_message = "[prompt.invalid]Please enter a number"
338
-
339
-
340
- class Confirm(PromptBase[bool]):
341
- """A yes / no confirmation prompt.
342
-
343
- Example:
344
- >>> if Confirm.ask("Continue"):
345
- run_job()
346
-
347
- """
348
-
349
- response_type = bool
350
- validate_error_message = "[prompt.invalid]Please enter Y or N"
351
- choices: List[str] = ["y", "n"]
352
-
353
- def render_default(self, default: DefaultType) -> Text:
354
- """Render the default as (y) or (n) rather than True/False."""
355
- yes, no = self.choices
356
- return Text(f"({yes})" if default else f"({no})", style="prompt.default")
357
-
358
- def process_response(self, value: str) -> bool:
359
- """Convert choices to a bool."""
360
- value = value.strip().lower()
361
- if value not in self.choices:
362
- raise InvalidResponse(self.validate_error_message)
363
- return value == self.choices[0]
364
-
365
-
366
- if __name__ == "__main__": # pragma: no cover
367
- from pip._vendor.rich import print
368
-
369
- if Confirm.ask("Run [i]prompt[/i] tests?", default=True):
370
- while True:
371
- result = IntPrompt.ask(
372
- ":rocket: Enter a number between [b]1[/b] and [b]10[/b]", default=5
373
- )
374
- if result >= 1 and result <= 10:
375
- break
376
- print(":pile_of_poo: [prompt.invalid]Number must be between 1 and 10")
377
- print(f"number={result}")
378
-
379
- while True:
380
- password = Prompt.ask(
381
- "Please enter a password [cyan](must be at least 5 characters)",
382
- password=True,
383
- )
384
- if len(password) >= 5:
385
- break
386
- print("[prompt.invalid]password too short")
387
- print(f"password={password!r}")
388
-
389
- fruit = Prompt.ask("Enter a fruit", choices=["apple", "orange", "pear"])
390
- print(f"fruit={fruit!r}")
391
-
392
- doggie = Prompt.ask(
393
- "What's the best Dog? (Case INSENSITIVE)",
394
- choices=["Border Terrier", "Collie", "Labradoodle"],
395
- case_sensitive=False,
396
- )
397
- print(f"doggie={doggie!r}")
398
-
399
- else:
400
- print("[b]OK :loudly_crying_face:")
@@ -1,42 +0,0 @@
1
- from typing import Any, cast, Set, TYPE_CHECKING
2
- from inspect import isclass
3
-
4
- if TYPE_CHECKING:
5
- from pip._vendor.rich.console import RenderableType
6
-
7
- _GIBBERISH = """aihwerij235234ljsdnp34ksodfipwoe234234jlskjdf"""
8
-
9
-
10
- def is_renderable(check_object: Any) -> bool:
11
- """Check if an object may be rendered by Rich."""
12
- return (
13
- isinstance(check_object, str)
14
- or hasattr(check_object, "__rich__")
15
- or hasattr(check_object, "__rich_console__")
16
- )
17
-
18
-
19
- def rich_cast(renderable: object) -> "RenderableType":
20
- """Cast an object to a renderable by calling __rich__ if present.
21
-
22
- Args:
23
- renderable (object): A potentially renderable object
24
-
25
- Returns:
26
- object: The result of recursively calling __rich__.
27
- """
28
- from pip._vendor.rich.console import RenderableType
29
-
30
- rich_visited_set: Set[type] = set() # Prevent potential infinite loop
31
- while hasattr(renderable, "__rich__") and not isclass(renderable):
32
- # Detect object which claim to have all the attributes
33
- if hasattr(renderable, _GIBBERISH):
34
- return repr(renderable)
35
- cast_method = getattr(renderable, "__rich__")
36
- renderable = cast_method()
37
- renderable_type = type(renderable)
38
- if renderable_type in rich_visited_set:
39
- break
40
- rich_visited_set.add(renderable_type)
41
-
42
- return cast(RenderableType, renderable)
File without changes
@@ -1,10 +0,0 @@
1
- from typing import NamedTuple
2
-
3
-
4
- class Region(NamedTuple):
5
- """Defines a rectangular region of the screen."""
6
-
7
- x: int
8
- y: int
9
- width: int
10
- height: int