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,661 +0,0 @@
1
- """Light wrapper around the Win32 Console API - this module should only be imported on Windows
2
-
3
- The API that this module wraps is documented at https://docs.microsoft.com/en-us/windows/console/console-functions
4
- """
5
-
6
- import ctypes
7
- import sys
8
- from typing import Any
9
-
10
- windll: Any = None
11
- if sys.platform == "win32":
12
- windll = ctypes.LibraryLoader(ctypes.WinDLL)
13
- else:
14
- raise ImportError(f"{__name__} can only be imported on Windows")
15
-
16
- import time
17
- from ctypes import Structure, byref, wintypes
18
- from typing import IO, NamedTuple, Type, cast
19
-
20
- from pip._vendor.rich.color import ColorSystem
21
- from pip._vendor.rich.style import Style
22
-
23
- STDOUT = -11
24
- ENABLE_VIRTUAL_TERMINAL_PROCESSING = 4
25
-
26
- COORD = wintypes._COORD
27
-
28
-
29
- class LegacyWindowsError(Exception):
30
- pass
31
-
32
-
33
- class WindowsCoordinates(NamedTuple):
34
- """Coordinates in the Windows Console API are (y, x), not (x, y).
35
- This class is intended to prevent that confusion.
36
- Rows and columns are indexed from 0.
37
- This class can be used in place of wintypes._COORD in arguments and argtypes.
38
- """
39
-
40
- row: int
41
- col: int
42
-
43
- @classmethod
44
- def from_param(cls, value: "WindowsCoordinates") -> COORD:
45
- """Converts a WindowsCoordinates into a wintypes _COORD structure.
46
- This classmethod is internally called by ctypes to perform the conversion.
47
-
48
- Args:
49
- value (WindowsCoordinates): The input coordinates to convert.
50
-
51
- Returns:
52
- wintypes._COORD: The converted coordinates struct.
53
- """
54
- return COORD(value.col, value.row)
55
-
56
-
57
- class CONSOLE_SCREEN_BUFFER_INFO(Structure):
58
- _fields_ = [
59
- ("dwSize", COORD),
60
- ("dwCursorPosition", COORD),
61
- ("wAttributes", wintypes.WORD),
62
- ("srWindow", wintypes.SMALL_RECT),
63
- ("dwMaximumWindowSize", COORD),
64
- ]
65
-
66
-
67
- class CONSOLE_CURSOR_INFO(ctypes.Structure):
68
- _fields_ = [("dwSize", wintypes.DWORD), ("bVisible", wintypes.BOOL)]
69
-
70
-
71
- _GetStdHandle = windll.kernel32.GetStdHandle
72
- _GetStdHandle.argtypes = [
73
- wintypes.DWORD,
74
- ]
75
- _GetStdHandle.restype = wintypes.HANDLE
76
-
77
-
78
- def GetStdHandle(handle: int = STDOUT) -> wintypes.HANDLE:
79
- """Retrieves a handle to the specified standard device (standard input, standard output, or standard error).
80
-
81
- Args:
82
- handle (int): Integer identifier for the handle. Defaults to -11 (stdout).
83
-
84
- Returns:
85
- wintypes.HANDLE: The handle
86
- """
87
- return cast(wintypes.HANDLE, _GetStdHandle(handle))
88
-
89
-
90
- _GetConsoleMode = windll.kernel32.GetConsoleMode
91
- _GetConsoleMode.argtypes = [wintypes.HANDLE, wintypes.LPDWORD]
92
- _GetConsoleMode.restype = wintypes.BOOL
93
-
94
-
95
- def GetConsoleMode(std_handle: wintypes.HANDLE) -> int:
96
- """Retrieves the current input mode of a console's input buffer
97
- or the current output mode of a console screen buffer.
98
-
99
- Args:
100
- std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
101
-
102
- Raises:
103
- LegacyWindowsError: If any error occurs while calling the Windows console API.
104
-
105
- Returns:
106
- int: Value representing the current console mode as documented at
107
- https://docs.microsoft.com/en-us/windows/console/getconsolemode#parameters
108
- """
109
-
110
- console_mode = wintypes.DWORD()
111
- success = bool(_GetConsoleMode(std_handle, console_mode))
112
- if not success:
113
- raise LegacyWindowsError("Unable to get legacy Windows Console Mode")
114
- return console_mode.value
115
-
116
-
117
- _FillConsoleOutputCharacterW = windll.kernel32.FillConsoleOutputCharacterW
118
- _FillConsoleOutputCharacterW.argtypes = [
119
- wintypes.HANDLE,
120
- ctypes.c_char,
121
- wintypes.DWORD,
122
- cast(Type[COORD], WindowsCoordinates),
123
- ctypes.POINTER(wintypes.DWORD),
124
- ]
125
- _FillConsoleOutputCharacterW.restype = wintypes.BOOL
126
-
127
-
128
- def FillConsoleOutputCharacter(
129
- std_handle: wintypes.HANDLE,
130
- char: str,
131
- length: int,
132
- start: WindowsCoordinates,
133
- ) -> int:
134
- """Writes a character to the console screen buffer a specified number of times, beginning at the specified coordinates.
135
-
136
- Args:
137
- std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
138
- char (str): The character to write. Must be a string of length 1.
139
- length (int): The number of times to write the character.
140
- start (WindowsCoordinates): The coordinates to start writing at.
141
-
142
- Returns:
143
- int: The number of characters written.
144
- """
145
- character = ctypes.c_char(char.encode())
146
- num_characters = wintypes.DWORD(length)
147
- num_written = wintypes.DWORD(0)
148
- _FillConsoleOutputCharacterW(
149
- std_handle,
150
- character,
151
- num_characters,
152
- start,
153
- byref(num_written),
154
- )
155
- return num_written.value
156
-
157
-
158
- _FillConsoleOutputAttribute = windll.kernel32.FillConsoleOutputAttribute
159
- _FillConsoleOutputAttribute.argtypes = [
160
- wintypes.HANDLE,
161
- wintypes.WORD,
162
- wintypes.DWORD,
163
- cast(Type[COORD], WindowsCoordinates),
164
- ctypes.POINTER(wintypes.DWORD),
165
- ]
166
- _FillConsoleOutputAttribute.restype = wintypes.BOOL
167
-
168
-
169
- def FillConsoleOutputAttribute(
170
- std_handle: wintypes.HANDLE,
171
- attributes: int,
172
- length: int,
173
- start: WindowsCoordinates,
174
- ) -> int:
175
- """Sets the character attributes for a specified number of character cells,
176
- beginning at the specified coordinates in a screen buffer.
177
-
178
- Args:
179
- std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
180
- attributes (int): Integer value representing the foreground and background colours of the cells.
181
- length (int): The number of cells to set the output attribute of.
182
- start (WindowsCoordinates): The coordinates of the first cell whose attributes are to be set.
183
-
184
- Returns:
185
- int: The number of cells whose attributes were actually set.
186
- """
187
- num_cells = wintypes.DWORD(length)
188
- style_attrs = wintypes.WORD(attributes)
189
- num_written = wintypes.DWORD(0)
190
- _FillConsoleOutputAttribute(
191
- std_handle, style_attrs, num_cells, start, byref(num_written)
192
- )
193
- return num_written.value
194
-
195
-
196
- _SetConsoleTextAttribute = windll.kernel32.SetConsoleTextAttribute
197
- _SetConsoleTextAttribute.argtypes = [
198
- wintypes.HANDLE,
199
- wintypes.WORD,
200
- ]
201
- _SetConsoleTextAttribute.restype = wintypes.BOOL
202
-
203
-
204
- def SetConsoleTextAttribute(
205
- std_handle: wintypes.HANDLE, attributes: wintypes.WORD
206
- ) -> bool:
207
- """Set the colour attributes for all text written after this function is called.
208
-
209
- Args:
210
- std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
211
- attributes (int): Integer value representing the foreground and background colours.
212
-
213
-
214
- Returns:
215
- bool: True if the attribute was set successfully, otherwise False.
216
- """
217
- return bool(_SetConsoleTextAttribute(std_handle, attributes))
218
-
219
-
220
- _GetConsoleScreenBufferInfo = windll.kernel32.GetConsoleScreenBufferInfo
221
- _GetConsoleScreenBufferInfo.argtypes = [
222
- wintypes.HANDLE,
223
- ctypes.POINTER(CONSOLE_SCREEN_BUFFER_INFO),
224
- ]
225
- _GetConsoleScreenBufferInfo.restype = wintypes.BOOL
226
-
227
-
228
- def GetConsoleScreenBufferInfo(
229
- std_handle: wintypes.HANDLE,
230
- ) -> CONSOLE_SCREEN_BUFFER_INFO:
231
- """Retrieves information about the specified console screen buffer.
232
-
233
- Args:
234
- std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
235
-
236
- Returns:
237
- CONSOLE_SCREEN_BUFFER_INFO: A CONSOLE_SCREEN_BUFFER_INFO ctype struct contain information about
238
- screen size, cursor position, colour attributes, and more."""
239
- console_screen_buffer_info = CONSOLE_SCREEN_BUFFER_INFO()
240
- _GetConsoleScreenBufferInfo(std_handle, byref(console_screen_buffer_info))
241
- return console_screen_buffer_info
242
-
243
-
244
- _SetConsoleCursorPosition = windll.kernel32.SetConsoleCursorPosition
245
- _SetConsoleCursorPosition.argtypes = [
246
- wintypes.HANDLE,
247
- cast(Type[COORD], WindowsCoordinates),
248
- ]
249
- _SetConsoleCursorPosition.restype = wintypes.BOOL
250
-
251
-
252
- def SetConsoleCursorPosition(
253
- std_handle: wintypes.HANDLE, coords: WindowsCoordinates
254
- ) -> bool:
255
- """Set the position of the cursor in the console screen
256
-
257
- Args:
258
- std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
259
- coords (WindowsCoordinates): The coordinates to move the cursor to.
260
-
261
- Returns:
262
- bool: True if the function succeeds, otherwise False.
263
- """
264
- return bool(_SetConsoleCursorPosition(std_handle, coords))
265
-
266
-
267
- _GetConsoleCursorInfo = windll.kernel32.GetConsoleCursorInfo
268
- _GetConsoleCursorInfo.argtypes = [
269
- wintypes.HANDLE,
270
- ctypes.POINTER(CONSOLE_CURSOR_INFO),
271
- ]
272
- _GetConsoleCursorInfo.restype = wintypes.BOOL
273
-
274
-
275
- def GetConsoleCursorInfo(
276
- std_handle: wintypes.HANDLE, cursor_info: CONSOLE_CURSOR_INFO
277
- ) -> bool:
278
- """Get the cursor info - used to get cursor visibility and width
279
-
280
- Args:
281
- std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
282
- cursor_info (CONSOLE_CURSOR_INFO): CONSOLE_CURSOR_INFO ctype struct that receives information
283
- about the console's cursor.
284
-
285
- Returns:
286
- bool: True if the function succeeds, otherwise False.
287
- """
288
- return bool(_GetConsoleCursorInfo(std_handle, byref(cursor_info)))
289
-
290
-
291
- _SetConsoleCursorInfo = windll.kernel32.SetConsoleCursorInfo
292
- _SetConsoleCursorInfo.argtypes = [
293
- wintypes.HANDLE,
294
- ctypes.POINTER(CONSOLE_CURSOR_INFO),
295
- ]
296
- _SetConsoleCursorInfo.restype = wintypes.BOOL
297
-
298
-
299
- def SetConsoleCursorInfo(
300
- std_handle: wintypes.HANDLE, cursor_info: CONSOLE_CURSOR_INFO
301
- ) -> bool:
302
- """Set the cursor info - used for adjusting cursor visibility and width
303
-
304
- Args:
305
- std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
306
- cursor_info (CONSOLE_CURSOR_INFO): CONSOLE_CURSOR_INFO ctype struct containing the new cursor info.
307
-
308
- Returns:
309
- bool: True if the function succeeds, otherwise False.
310
- """
311
- return bool(_SetConsoleCursorInfo(std_handle, byref(cursor_info)))
312
-
313
-
314
- _SetConsoleTitle = windll.kernel32.SetConsoleTitleW
315
- _SetConsoleTitle.argtypes = [wintypes.LPCWSTR]
316
- _SetConsoleTitle.restype = wintypes.BOOL
317
-
318
-
319
- def SetConsoleTitle(title: str) -> bool:
320
- """Sets the title of the current console window
321
-
322
- Args:
323
- title (str): The new title of the console window.
324
-
325
- Returns:
326
- bool: True if the function succeeds, otherwise False.
327
- """
328
- return bool(_SetConsoleTitle(title))
329
-
330
-
331
- class LegacyWindowsTerm:
332
- """This class allows interaction with the legacy Windows Console API. It should only be used in the context
333
- of environments where virtual terminal processing is not available. However, if it is used in a Windows environment,
334
- the entire API should work.
335
-
336
- Args:
337
- file (IO[str]): The file which the Windows Console API HANDLE is retrieved from, defaults to sys.stdout.
338
- """
339
-
340
- BRIGHT_BIT = 8
341
-
342
- # Indices are ANSI color numbers, values are the corresponding Windows Console API color numbers
343
- ANSI_TO_WINDOWS = [
344
- 0, # black The Windows colours are defined in wincon.h as follows:
345
- 4, # red define FOREGROUND_BLUE 0x0001 -- 0000 0001
346
- 2, # green define FOREGROUND_GREEN 0x0002 -- 0000 0010
347
- 6, # yellow define FOREGROUND_RED 0x0004 -- 0000 0100
348
- 1, # blue define FOREGROUND_INTENSITY 0x0008 -- 0000 1000
349
- 5, # magenta define BACKGROUND_BLUE 0x0010 -- 0001 0000
350
- 3, # cyan define BACKGROUND_GREEN 0x0020 -- 0010 0000
351
- 7, # white define BACKGROUND_RED 0x0040 -- 0100 0000
352
- 8, # bright black (grey) define BACKGROUND_INTENSITY 0x0080 -- 1000 0000
353
- 12, # bright red
354
- 10, # bright green
355
- 14, # bright yellow
356
- 9, # bright blue
357
- 13, # bright magenta
358
- 11, # bright cyan
359
- 15, # bright white
360
- ]
361
-
362
- def __init__(self, file: "IO[str]") -> None:
363
- handle = GetStdHandle(STDOUT)
364
- self._handle = handle
365
- default_text = GetConsoleScreenBufferInfo(handle).wAttributes
366
- self._default_text = default_text
367
-
368
- self._default_fore = default_text & 7
369
- self._default_back = (default_text >> 4) & 7
370
- self._default_attrs = self._default_fore | (self._default_back << 4)
371
-
372
- self._file = file
373
- self.write = file.write
374
- self.flush = file.flush
375
-
376
- @property
377
- def cursor_position(self) -> WindowsCoordinates:
378
- """Returns the current position of the cursor (0-based)
379
-
380
- Returns:
381
- WindowsCoordinates: The current cursor position.
382
- """
383
- coord: COORD = GetConsoleScreenBufferInfo(self._handle).dwCursorPosition
384
- return WindowsCoordinates(row=coord.Y, col=coord.X)
385
-
386
- @property
387
- def screen_size(self) -> WindowsCoordinates:
388
- """Returns the current size of the console screen buffer, in character columns and rows
389
-
390
- Returns:
391
- WindowsCoordinates: The width and height of the screen as WindowsCoordinates.
392
- """
393
- screen_size: COORD = GetConsoleScreenBufferInfo(self._handle).dwSize
394
- return WindowsCoordinates(row=screen_size.Y, col=screen_size.X)
395
-
396
- def write_text(self, text: str) -> None:
397
- """Write text directly to the terminal without any modification of styles
398
-
399
- Args:
400
- text (str): The text to write to the console
401
- """
402
- self.write(text)
403
- self.flush()
404
-
405
- def write_styled(self, text: str, style: Style) -> None:
406
- """Write styled text to the terminal.
407
-
408
- Args:
409
- text (str): The text to write
410
- style (Style): The style of the text
411
- """
412
- color = style.color
413
- bgcolor = style.bgcolor
414
- if style.reverse:
415
- color, bgcolor = bgcolor, color
416
-
417
- if color:
418
- fore = color.downgrade(ColorSystem.WINDOWS).number
419
- fore = fore if fore is not None else 7 # Default to ANSI 7: White
420
- if style.bold:
421
- fore = fore | self.BRIGHT_BIT
422
- if style.dim:
423
- fore = fore & ~self.BRIGHT_BIT
424
- fore = self.ANSI_TO_WINDOWS[fore]
425
- else:
426
- fore = self._default_fore
427
-
428
- if bgcolor:
429
- back = bgcolor.downgrade(ColorSystem.WINDOWS).number
430
- back = back if back is not None else 0 # Default to ANSI 0: Black
431
- back = self.ANSI_TO_WINDOWS[back]
432
- else:
433
- back = self._default_back
434
-
435
- assert fore is not None
436
- assert back is not None
437
-
438
- SetConsoleTextAttribute(
439
- self._handle, attributes=ctypes.c_ushort(fore | (back << 4))
440
- )
441
- self.write_text(text)
442
- SetConsoleTextAttribute(self._handle, attributes=self._default_text)
443
-
444
- def move_cursor_to(self, new_position: WindowsCoordinates) -> None:
445
- """Set the position of the cursor
446
-
447
- Args:
448
- new_position (WindowsCoordinates): The WindowsCoordinates representing the new position of the cursor.
449
- """
450
- if new_position.col < 0 or new_position.row < 0:
451
- return
452
- SetConsoleCursorPosition(self._handle, coords=new_position)
453
-
454
- def erase_line(self) -> None:
455
- """Erase all content on the line the cursor is currently located at"""
456
- screen_size = self.screen_size
457
- cursor_position = self.cursor_position
458
- cells_to_erase = screen_size.col
459
- start_coordinates = WindowsCoordinates(row=cursor_position.row, col=0)
460
- FillConsoleOutputCharacter(
461
- self._handle, " ", length=cells_to_erase, start=start_coordinates
462
- )
463
- FillConsoleOutputAttribute(
464
- self._handle,
465
- self._default_attrs,
466
- length=cells_to_erase,
467
- start=start_coordinates,
468
- )
469
-
470
- def erase_end_of_line(self) -> None:
471
- """Erase all content from the cursor position to the end of that line"""
472
- cursor_position = self.cursor_position
473
- cells_to_erase = self.screen_size.col - cursor_position.col
474
- FillConsoleOutputCharacter(
475
- self._handle, " ", length=cells_to_erase, start=cursor_position
476
- )
477
- FillConsoleOutputAttribute(
478
- self._handle,
479
- self._default_attrs,
480
- length=cells_to_erase,
481
- start=cursor_position,
482
- )
483
-
484
- def erase_start_of_line(self) -> None:
485
- """Erase all content from the cursor position to the start of that line"""
486
- row, col = self.cursor_position
487
- start = WindowsCoordinates(row, 0)
488
- FillConsoleOutputCharacter(self._handle, " ", length=col, start=start)
489
- FillConsoleOutputAttribute(
490
- self._handle, self._default_attrs, length=col, start=start
491
- )
492
-
493
- def move_cursor_up(self) -> None:
494
- """Move the cursor up a single cell"""
495
- cursor_position = self.cursor_position
496
- SetConsoleCursorPosition(
497
- self._handle,
498
- coords=WindowsCoordinates(
499
- row=cursor_position.row - 1, col=cursor_position.col
500
- ),
501
- )
502
-
503
- def move_cursor_down(self) -> None:
504
- """Move the cursor down a single cell"""
505
- cursor_position = self.cursor_position
506
- SetConsoleCursorPosition(
507
- self._handle,
508
- coords=WindowsCoordinates(
509
- row=cursor_position.row + 1,
510
- col=cursor_position.col,
511
- ),
512
- )
513
-
514
- def move_cursor_forward(self) -> None:
515
- """Move the cursor forward a single cell. Wrap to the next line if required."""
516
- row, col = self.cursor_position
517
- if col == self.screen_size.col - 1:
518
- row += 1
519
- col = 0
520
- else:
521
- col += 1
522
- SetConsoleCursorPosition(
523
- self._handle, coords=WindowsCoordinates(row=row, col=col)
524
- )
525
-
526
- def move_cursor_to_column(self, column: int) -> None:
527
- """Move cursor to the column specified by the zero-based column index, staying on the same row
528
-
529
- Args:
530
- column (int): The zero-based column index to move the cursor to.
531
- """
532
- row, _ = self.cursor_position
533
- SetConsoleCursorPosition(self._handle, coords=WindowsCoordinates(row, column))
534
-
535
- def move_cursor_backward(self) -> None:
536
- """Move the cursor backward a single cell. Wrap to the previous line if required."""
537
- row, col = self.cursor_position
538
- if col == 0:
539
- row -= 1
540
- col = self.screen_size.col - 1
541
- else:
542
- col -= 1
543
- SetConsoleCursorPosition(
544
- self._handle, coords=WindowsCoordinates(row=row, col=col)
545
- )
546
-
547
- def hide_cursor(self) -> None:
548
- """Hide the cursor"""
549
- current_cursor_size = self._get_cursor_size()
550
- invisible_cursor = CONSOLE_CURSOR_INFO(dwSize=current_cursor_size, bVisible=0)
551
- SetConsoleCursorInfo(self._handle, cursor_info=invisible_cursor)
552
-
553
- def show_cursor(self) -> None:
554
- """Show the cursor"""
555
- current_cursor_size = self._get_cursor_size()
556
- visible_cursor = CONSOLE_CURSOR_INFO(dwSize=current_cursor_size, bVisible=1)
557
- SetConsoleCursorInfo(self._handle, cursor_info=visible_cursor)
558
-
559
- def set_title(self, title: str) -> None:
560
- """Set the title of the terminal window
561
-
562
- Args:
563
- title (str): The new title of the console window
564
- """
565
- assert len(title) < 255, "Console title must be less than 255 characters"
566
- SetConsoleTitle(title)
567
-
568
- def _get_cursor_size(self) -> int:
569
- """Get the percentage of the character cell that is filled by the cursor"""
570
- cursor_info = CONSOLE_CURSOR_INFO()
571
- GetConsoleCursorInfo(self._handle, cursor_info=cursor_info)
572
- return int(cursor_info.dwSize)
573
-
574
-
575
- if __name__ == "__main__":
576
- handle = GetStdHandle()
577
-
578
- from pip._vendor.rich.console import Console
579
-
580
- console = Console()
581
-
582
- term = LegacyWindowsTerm(sys.stdout)
583
- term.set_title("Win32 Console Examples")
584
-
585
- style = Style(color="black", bgcolor="red")
586
-
587
- heading = Style.parse("black on green")
588
-
589
- # Check colour output
590
- console.rule("Checking colour output")
591
- console.print("[on red]on red!")
592
- console.print("[blue]blue!")
593
- console.print("[yellow]yellow!")
594
- console.print("[bold yellow]bold yellow!")
595
- console.print("[bright_yellow]bright_yellow!")
596
- console.print("[dim bright_yellow]dim bright_yellow!")
597
- console.print("[italic cyan]italic cyan!")
598
- console.print("[bold white on blue]bold white on blue!")
599
- console.print("[reverse bold white on blue]reverse bold white on blue!")
600
- console.print("[bold black on cyan]bold black on cyan!")
601
- console.print("[black on green]black on green!")
602
- console.print("[blue on green]blue on green!")
603
- console.print("[white on black]white on black!")
604
- console.print("[black on white]black on white!")
605
- console.print("[#1BB152 on #DA812D]#1BB152 on #DA812D!")
606
-
607
- # Check cursor movement
608
- console.rule("Checking cursor movement")
609
- console.print()
610
- term.move_cursor_backward()
611
- term.move_cursor_backward()
612
- term.write_text("went back and wrapped to prev line")
613
- time.sleep(1)
614
- term.move_cursor_up()
615
- term.write_text("we go up")
616
- time.sleep(1)
617
- term.move_cursor_down()
618
- term.write_text("and down")
619
- time.sleep(1)
620
- term.move_cursor_up()
621
- term.move_cursor_backward()
622
- term.move_cursor_backward()
623
- term.write_text("we went up and back 2")
624
- time.sleep(1)
625
- term.move_cursor_down()
626
- term.move_cursor_backward()
627
- term.move_cursor_backward()
628
- term.write_text("we went down and back 2")
629
- time.sleep(1)
630
-
631
- # Check erasing of lines
632
- term.hide_cursor()
633
- console.print()
634
- console.rule("Checking line erasing")
635
- console.print("\n...Deleting to the start of the line...")
636
- term.write_text("The red arrow shows the cursor location, and direction of erase")
637
- time.sleep(1)
638
- term.move_cursor_to_column(16)
639
- term.write_styled("<", Style.parse("black on red"))
640
- term.move_cursor_backward()
641
- time.sleep(1)
642
- term.erase_start_of_line()
643
- time.sleep(1)
644
-
645
- console.print("\n\n...And to the end of the line...")
646
- term.write_text("The red arrow shows the cursor location, and direction of erase")
647
- time.sleep(1)
648
-
649
- term.move_cursor_to_column(16)
650
- term.write_styled(">", Style.parse("black on red"))
651
- time.sleep(1)
652
- term.erase_end_of_line()
653
- time.sleep(1)
654
-
655
- console.print("\n\n...Now the whole line will be erased...")
656
- term.write_styled("I'm going to disappear!", style=Style.parse("black on cyan"))
657
- time.sleep(1)
658
- term.erase_line()
659
-
660
- term.show_cursor()
661
- print("\n")