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.
- cli_ih/__init__.py +1 -0
- cli_ih/asyncClient.py +73 -10
- cli_ih/client.py +63 -18
- cli_ih/utils.py +51 -0
- {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/METADATA +1 -1
- cli_ih-0.7.0.dist-info/RECORD +9 -0
- {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/top_level.txt +0 -1
- cli_ih-0.6.3.1.dist-info/RECORD +0 -425
- venv/Lib/site-packages/__editable___cli_ih_0_6_3_1_finder.py +0 -85
- venv/Lib/site-packages/pip/__init__.py +0 -13
- venv/Lib/site-packages/pip/__main__.py +0 -24
- venv/Lib/site-packages/pip/__pip-runner__.py +0 -50
- venv/Lib/site-packages/pip/_internal/__init__.py +0 -18
- venv/Lib/site-packages/pip/_internal/build_env.py +0 -349
- venv/Lib/site-packages/pip/_internal/cache.py +0 -291
- venv/Lib/site-packages/pip/_internal/cli/__init__.py +0 -3
- venv/Lib/site-packages/pip/_internal/cli/autocompletion.py +0 -184
- venv/Lib/site-packages/pip/_internal/cli/base_command.py +0 -244
- venv/Lib/site-packages/pip/_internal/cli/cmdoptions.py +0 -1138
- venv/Lib/site-packages/pip/_internal/cli/command_context.py +0 -28
- venv/Lib/site-packages/pip/_internal/cli/index_command.py +0 -175
- venv/Lib/site-packages/pip/_internal/cli/main.py +0 -80
- venv/Lib/site-packages/pip/_internal/cli/main_parser.py +0 -134
- venv/Lib/site-packages/pip/_internal/cli/parser.py +0 -298
- venv/Lib/site-packages/pip/_internal/cli/progress_bars.py +0 -151
- venv/Lib/site-packages/pip/_internal/cli/req_command.py +0 -351
- venv/Lib/site-packages/pip/_internal/cli/spinners.py +0 -235
- venv/Lib/site-packages/pip/_internal/cli/status_codes.py +0 -6
- venv/Lib/site-packages/pip/_internal/commands/__init__.py +0 -139
- venv/Lib/site-packages/pip/_internal/commands/cache.py +0 -231
- venv/Lib/site-packages/pip/_internal/commands/check.py +0 -66
- venv/Lib/site-packages/pip/_internal/commands/completion.py +0 -135
- venv/Lib/site-packages/pip/_internal/commands/configuration.py +0 -288
- venv/Lib/site-packages/pip/_internal/commands/debug.py +0 -203
- venv/Lib/site-packages/pip/_internal/commands/download.py +0 -145
- venv/Lib/site-packages/pip/_internal/commands/freeze.py +0 -107
- venv/Lib/site-packages/pip/_internal/commands/hash.py +0 -58
- venv/Lib/site-packages/pip/_internal/commands/help.py +0 -40
- venv/Lib/site-packages/pip/_internal/commands/index.py +0 -159
- venv/Lib/site-packages/pip/_internal/commands/inspect.py +0 -92
- venv/Lib/site-packages/pip/_internal/commands/install.py +0 -798
- venv/Lib/site-packages/pip/_internal/commands/list.py +0 -400
- venv/Lib/site-packages/pip/_internal/commands/lock.py +0 -170
- venv/Lib/site-packages/pip/_internal/commands/search.py +0 -178
- venv/Lib/site-packages/pip/_internal/commands/show.py +0 -231
- venv/Lib/site-packages/pip/_internal/commands/uninstall.py +0 -113
- venv/Lib/site-packages/pip/_internal/commands/wheel.py +0 -181
- venv/Lib/site-packages/pip/_internal/configuration.py +0 -397
- venv/Lib/site-packages/pip/_internal/distributions/__init__.py +0 -21
- venv/Lib/site-packages/pip/_internal/distributions/base.py +0 -55
- venv/Lib/site-packages/pip/_internal/distributions/installed.py +0 -33
- venv/Lib/site-packages/pip/_internal/distributions/sdist.py +0 -165
- venv/Lib/site-packages/pip/_internal/distributions/wheel.py +0 -44
- venv/Lib/site-packages/pip/_internal/exceptions.py +0 -881
- venv/Lib/site-packages/pip/_internal/index/__init__.py +0 -1
- venv/Lib/site-packages/pip/_internal/index/collector.py +0 -489
- venv/Lib/site-packages/pip/_internal/index/package_finder.py +0 -1059
- venv/Lib/site-packages/pip/_internal/index/sources.py +0 -287
- venv/Lib/site-packages/pip/_internal/locations/__init__.py +0 -441
- venv/Lib/site-packages/pip/_internal/locations/_distutils.py +0 -173
- venv/Lib/site-packages/pip/_internal/locations/_sysconfig.py +0 -215
- venv/Lib/site-packages/pip/_internal/locations/base.py +0 -82
- venv/Lib/site-packages/pip/_internal/main.py +0 -12
- venv/Lib/site-packages/pip/_internal/metadata/__init__.py +0 -164
- venv/Lib/site-packages/pip/_internal/metadata/_json.py +0 -87
- venv/Lib/site-packages/pip/_internal/metadata/base.py +0 -685
- venv/Lib/site-packages/pip/_internal/metadata/importlib/__init__.py +0 -6
- venv/Lib/site-packages/pip/_internal/metadata/importlib/_compat.py +0 -87
- venv/Lib/site-packages/pip/_internal/metadata/importlib/_dists.py +0 -223
- venv/Lib/site-packages/pip/_internal/metadata/importlib/_envs.py +0 -143
- venv/Lib/site-packages/pip/_internal/metadata/pkg_resources.py +0 -298
- venv/Lib/site-packages/pip/_internal/models/__init__.py +0 -1
- venv/Lib/site-packages/pip/_internal/models/candidate.py +0 -25
- venv/Lib/site-packages/pip/_internal/models/direct_url.py +0 -227
- venv/Lib/site-packages/pip/_internal/models/format_control.py +0 -78
- venv/Lib/site-packages/pip/_internal/models/index.py +0 -28
- venv/Lib/site-packages/pip/_internal/models/installation_report.py +0 -57
- venv/Lib/site-packages/pip/_internal/models/link.py +0 -613
- venv/Lib/site-packages/pip/_internal/models/pylock.py +0 -188
- venv/Lib/site-packages/pip/_internal/models/scheme.py +0 -25
- venv/Lib/site-packages/pip/_internal/models/search_scope.py +0 -126
- venv/Lib/site-packages/pip/_internal/models/selection_prefs.py +0 -53
- venv/Lib/site-packages/pip/_internal/models/target_python.py +0 -122
- venv/Lib/site-packages/pip/_internal/models/wheel.py +0 -141
- venv/Lib/site-packages/pip/_internal/network/__init__.py +0 -1
- venv/Lib/site-packages/pip/_internal/network/auth.py +0 -564
- venv/Lib/site-packages/pip/_internal/network/cache.py +0 -133
- venv/Lib/site-packages/pip/_internal/network/download.py +0 -342
- venv/Lib/site-packages/pip/_internal/network/lazy_wheel.py +0 -213
- venv/Lib/site-packages/pip/_internal/network/session.py +0 -528
- venv/Lib/site-packages/pip/_internal/network/utils.py +0 -98
- venv/Lib/site-packages/pip/_internal/network/xmlrpc.py +0 -61
- venv/Lib/site-packages/pip/_internal/operations/__init__.py +0 -0
- venv/Lib/site-packages/pip/_internal/operations/build/__init__.py +0 -0
- venv/Lib/site-packages/pip/_internal/operations/build/build_tracker.py +0 -140
- venv/Lib/site-packages/pip/_internal/operations/build/metadata.py +0 -38
- venv/Lib/site-packages/pip/_internal/operations/build/metadata_editable.py +0 -41
- venv/Lib/site-packages/pip/_internal/operations/build/metadata_legacy.py +0 -73
- venv/Lib/site-packages/pip/_internal/operations/build/wheel.py +0 -38
- venv/Lib/site-packages/pip/_internal/operations/build/wheel_editable.py +0 -47
- venv/Lib/site-packages/pip/_internal/operations/build/wheel_legacy.py +0 -119
- venv/Lib/site-packages/pip/_internal/operations/check.py +0 -175
- venv/Lib/site-packages/pip/_internal/operations/freeze.py +0 -259
- venv/Lib/site-packages/pip/_internal/operations/install/__init__.py +0 -1
- venv/Lib/site-packages/pip/_internal/operations/install/editable_legacy.py +0 -48
- venv/Lib/site-packages/pip/_internal/operations/install/wheel.py +0 -746
- venv/Lib/site-packages/pip/_internal/operations/prepare.py +0 -742
- venv/Lib/site-packages/pip/_internal/pyproject.py +0 -182
- venv/Lib/site-packages/pip/_internal/req/__init__.py +0 -105
- venv/Lib/site-packages/pip/_internal/req/constructors.py +0 -562
- venv/Lib/site-packages/pip/_internal/req/req_dependency_group.py +0 -75
- venv/Lib/site-packages/pip/_internal/req/req_file.py +0 -620
- venv/Lib/site-packages/pip/_internal/req/req_install.py +0 -937
- venv/Lib/site-packages/pip/_internal/req/req_set.py +0 -81
- venv/Lib/site-packages/pip/_internal/req/req_uninstall.py +0 -639
- venv/Lib/site-packages/pip/_internal/resolution/__init__.py +0 -0
- venv/Lib/site-packages/pip/_internal/resolution/base.py +0 -20
- venv/Lib/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
- venv/Lib/site-packages/pip/_internal/resolution/legacy/resolver.py +0 -598
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/base.py +0 -142
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/candidates.py +0 -582
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/factory.py +0 -814
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +0 -166
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/provider.py +0 -276
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/reporter.py +0 -85
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/requirements.py +0 -247
- venv/Lib/site-packages/pip/_internal/resolution/resolvelib/resolver.py +0 -336
- venv/Lib/site-packages/pip/_internal/self_outdated_check.py +0 -254
- venv/Lib/site-packages/pip/_internal/utils/__init__.py +0 -0
- venv/Lib/site-packages/pip/_internal/utils/_jaraco_text.py +0 -109
- venv/Lib/site-packages/pip/_internal/utils/_log.py +0 -38
- venv/Lib/site-packages/pip/_internal/utils/appdirs.py +0 -52
- venv/Lib/site-packages/pip/_internal/utils/compat.py +0 -85
- venv/Lib/site-packages/pip/_internal/utils/compatibility_tags.py +0 -201
- venv/Lib/site-packages/pip/_internal/utils/datetime.py +0 -10
- venv/Lib/site-packages/pip/_internal/utils/deprecation.py +0 -126
- venv/Lib/site-packages/pip/_internal/utils/direct_url_helpers.py +0 -87
- venv/Lib/site-packages/pip/_internal/utils/egg_link.py +0 -81
- venv/Lib/site-packages/pip/_internal/utils/entrypoints.py +0 -88
- venv/Lib/site-packages/pip/_internal/utils/filesystem.py +0 -152
- venv/Lib/site-packages/pip/_internal/utils/filetypes.py +0 -24
- venv/Lib/site-packages/pip/_internal/utils/glibc.py +0 -102
- venv/Lib/site-packages/pip/_internal/utils/hashes.py +0 -150
- venv/Lib/site-packages/pip/_internal/utils/logging.py +0 -364
- venv/Lib/site-packages/pip/_internal/utils/misc.py +0 -765
- venv/Lib/site-packages/pip/_internal/utils/packaging.py +0 -44
- venv/Lib/site-packages/pip/_internal/utils/retry.py +0 -45
- venv/Lib/site-packages/pip/_internal/utils/setuptools_build.py +0 -149
- venv/Lib/site-packages/pip/_internal/utils/subprocess.py +0 -248
- venv/Lib/site-packages/pip/_internal/utils/temp_dir.py +0 -294
- venv/Lib/site-packages/pip/_internal/utils/unpacking.py +0 -337
- venv/Lib/site-packages/pip/_internal/utils/urls.py +0 -55
- venv/Lib/site-packages/pip/_internal/utils/virtualenv.py +0 -105
- venv/Lib/site-packages/pip/_internal/utils/wheel.py +0 -132
- venv/Lib/site-packages/pip/_internal/vcs/__init__.py +0 -15
- venv/Lib/site-packages/pip/_internal/vcs/bazaar.py +0 -130
- venv/Lib/site-packages/pip/_internal/vcs/git.py +0 -571
- venv/Lib/site-packages/pip/_internal/vcs/mercurial.py +0 -186
- venv/Lib/site-packages/pip/_internal/vcs/subversion.py +0 -335
- venv/Lib/site-packages/pip/_internal/vcs/versioncontrol.py +0 -693
- venv/Lib/site-packages/pip/_internal/wheel_builder.py +0 -334
- venv/Lib/site-packages/pip/_vendor/__init__.py +0 -117
- venv/Lib/site-packages/pip/_vendor/cachecontrol/__init__.py +0 -29
- venv/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.py +0 -70
- venv/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py +0 -168
- venv/Lib/site-packages/pip/_vendor/cachecontrol/cache.py +0 -75
- venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +0 -8
- venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +0 -145
- venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +0 -48
- venv/Lib/site-packages/pip/_vendor/cachecontrol/controller.py +0 -511
- venv/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.py +0 -119
- venv/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py +0 -157
- venv/Lib/site-packages/pip/_vendor/cachecontrol/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py +0 -146
- venv/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py +0 -43
- venv/Lib/site-packages/pip/_vendor/certifi/__init__.py +0 -4
- venv/Lib/site-packages/pip/_vendor/certifi/__main__.py +0 -12
- venv/Lib/site-packages/pip/_vendor/certifi/core.py +0 -83
- venv/Lib/site-packages/pip/_vendor/certifi/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/dependency_groups/__init__.py +0 -13
- venv/Lib/site-packages/pip/_vendor/dependency_groups/__main__.py +0 -65
- venv/Lib/site-packages/pip/_vendor/dependency_groups/_implementation.py +0 -209
- venv/Lib/site-packages/pip/_vendor/dependency_groups/_lint_dependency_groups.py +0 -59
- venv/Lib/site-packages/pip/_vendor/dependency_groups/_pip_wrapper.py +0 -62
- venv/Lib/site-packages/pip/_vendor/dependency_groups/_toml_compat.py +0 -9
- venv/Lib/site-packages/pip/_vendor/dependency_groups/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/distlib/__init__.py +0 -33
- venv/Lib/site-packages/pip/_vendor/distlib/compat.py +0 -1137
- venv/Lib/site-packages/pip/_vendor/distlib/resources.py +0 -358
- venv/Lib/site-packages/pip/_vendor/distlib/scripts.py +0 -447
- venv/Lib/site-packages/pip/_vendor/distlib/util.py +0 -1984
- venv/Lib/site-packages/pip/_vendor/distro/__init__.py +0 -54
- venv/Lib/site-packages/pip/_vendor/distro/__main__.py +0 -4
- venv/Lib/site-packages/pip/_vendor/distro/distro.py +0 -1403
- venv/Lib/site-packages/pip/_vendor/distro/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/idna/__init__.py +0 -45
- venv/Lib/site-packages/pip/_vendor/idna/codec.py +0 -122
- venv/Lib/site-packages/pip/_vendor/idna/compat.py +0 -15
- venv/Lib/site-packages/pip/_vendor/idna/core.py +0 -437
- venv/Lib/site-packages/pip/_vendor/idna/idnadata.py +0 -4243
- venv/Lib/site-packages/pip/_vendor/idna/intranges.py +0 -57
- venv/Lib/site-packages/pip/_vendor/idna/package_data.py +0 -1
- venv/Lib/site-packages/pip/_vendor/idna/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/idna/uts46data.py +0 -8681
- venv/Lib/site-packages/pip/_vendor/msgpack/__init__.py +0 -55
- venv/Lib/site-packages/pip/_vendor/msgpack/exceptions.py +0 -48
- venv/Lib/site-packages/pip/_vendor/msgpack/ext.py +0 -170
- venv/Lib/site-packages/pip/_vendor/msgpack/fallback.py +0 -929
- venv/Lib/site-packages/pip/_vendor/packaging/__init__.py +0 -15
- venv/Lib/site-packages/pip/_vendor/packaging/_elffile.py +0 -109
- venv/Lib/site-packages/pip/_vendor/packaging/_manylinux.py +0 -262
- venv/Lib/site-packages/pip/_vendor/packaging/_musllinux.py +0 -85
- venv/Lib/site-packages/pip/_vendor/packaging/_parser.py +0 -353
- venv/Lib/site-packages/pip/_vendor/packaging/_structures.py +0 -61
- venv/Lib/site-packages/pip/_vendor/packaging/_tokenizer.py +0 -195
- venv/Lib/site-packages/pip/_vendor/packaging/licenses/__init__.py +0 -145
- venv/Lib/site-packages/pip/_vendor/packaging/licenses/_spdx.py +0 -759
- venv/Lib/site-packages/pip/_vendor/packaging/markers.py +0 -362
- venv/Lib/site-packages/pip/_vendor/packaging/metadata.py +0 -862
- venv/Lib/site-packages/pip/_vendor/packaging/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/packaging/requirements.py +0 -91
- venv/Lib/site-packages/pip/_vendor/packaging/specifiers.py +0 -1019
- venv/Lib/site-packages/pip/_vendor/packaging/tags.py +0 -656
- venv/Lib/site-packages/pip/_vendor/packaging/utils.py +0 -163
- venv/Lib/site-packages/pip/_vendor/packaging/version.py +0 -582
- venv/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py +0 -3676
- venv/Lib/site-packages/pip/_vendor/platformdirs/__init__.py +0 -631
- venv/Lib/site-packages/pip/_vendor/platformdirs/__main__.py +0 -55
- venv/Lib/site-packages/pip/_vendor/platformdirs/android.py +0 -249
- venv/Lib/site-packages/pip/_vendor/platformdirs/api.py +0 -299
- venv/Lib/site-packages/pip/_vendor/platformdirs/macos.py +0 -144
- venv/Lib/site-packages/pip/_vendor/platformdirs/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/platformdirs/unix.py +0 -272
- venv/Lib/site-packages/pip/_vendor/platformdirs/version.py +0 -21
- venv/Lib/site-packages/pip/_vendor/platformdirs/windows.py +0 -272
- venv/Lib/site-packages/pip/_vendor/pygments/__init__.py +0 -82
- venv/Lib/site-packages/pip/_vendor/pygments/__main__.py +0 -17
- venv/Lib/site-packages/pip/_vendor/pygments/console.py +0 -70
- venv/Lib/site-packages/pip/_vendor/pygments/filter.py +0 -70
- venv/Lib/site-packages/pip/_vendor/pygments/filters/__init__.py +0 -940
- venv/Lib/site-packages/pip/_vendor/pygments/formatter.py +0 -129
- venv/Lib/site-packages/pip/_vendor/pygments/formatters/__init__.py +0 -157
- venv/Lib/site-packages/pip/_vendor/pygments/formatters/_mapping.py +0 -23
- venv/Lib/site-packages/pip/_vendor/pygments/lexer.py +0 -963
- venv/Lib/site-packages/pip/_vendor/pygments/lexers/__init__.py +0 -362
- venv/Lib/site-packages/pip/_vendor/pygments/lexers/_mapping.py +0 -602
- venv/Lib/site-packages/pip/_vendor/pygments/lexers/python.py +0 -1201
- venv/Lib/site-packages/pip/_vendor/pygments/modeline.py +0 -43
- venv/Lib/site-packages/pip/_vendor/pygments/plugin.py +0 -72
- venv/Lib/site-packages/pip/_vendor/pygments/regexopt.py +0 -91
- venv/Lib/site-packages/pip/_vendor/pygments/scanner.py +0 -104
- venv/Lib/site-packages/pip/_vendor/pygments/sphinxext.py +0 -247
- venv/Lib/site-packages/pip/_vendor/pygments/style.py +0 -203
- venv/Lib/site-packages/pip/_vendor/pygments/styles/__init__.py +0 -61
- venv/Lib/site-packages/pip/_vendor/pygments/styles/_mapping.py +0 -54
- venv/Lib/site-packages/pip/_vendor/pygments/token.py +0 -214
- venv/Lib/site-packages/pip/_vendor/pygments/unistring.py +0 -153
- venv/Lib/site-packages/pip/_vendor/pygments/util.py +0 -324
- venv/Lib/site-packages/pip/_vendor/pyproject_hooks/__init__.py +0 -31
- venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_impl.py +0 -410
- venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/__init__.py +0 -21
- venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py +0 -389
- venv/Lib/site-packages/pip/_vendor/pyproject_hooks/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/requests/__init__.py +0 -179
- venv/Lib/site-packages/pip/_vendor/requests/__version__.py +0 -14
- venv/Lib/site-packages/pip/_vendor/requests/_internal_utils.py +0 -50
- venv/Lib/site-packages/pip/_vendor/requests/adapters.py +0 -719
- venv/Lib/site-packages/pip/_vendor/requests/api.py +0 -157
- venv/Lib/site-packages/pip/_vendor/requests/auth.py +0 -314
- venv/Lib/site-packages/pip/_vendor/requests/certs.py +0 -17
- venv/Lib/site-packages/pip/_vendor/requests/compat.py +0 -90
- venv/Lib/site-packages/pip/_vendor/requests/cookies.py +0 -561
- venv/Lib/site-packages/pip/_vendor/requests/exceptions.py +0 -151
- venv/Lib/site-packages/pip/_vendor/requests/help.py +0 -127
- venv/Lib/site-packages/pip/_vendor/requests/hooks.py +0 -33
- venv/Lib/site-packages/pip/_vendor/requests/models.py +0 -1039
- venv/Lib/site-packages/pip/_vendor/requests/packages.py +0 -25
- venv/Lib/site-packages/pip/_vendor/requests/sessions.py +0 -831
- venv/Lib/site-packages/pip/_vendor/requests/status_codes.py +0 -128
- venv/Lib/site-packages/pip/_vendor/requests/structures.py +0 -99
- venv/Lib/site-packages/pip/_vendor/requests/utils.py +0 -1086
- venv/Lib/site-packages/pip/_vendor/resolvelib/__init__.py +0 -27
- venv/Lib/site-packages/pip/_vendor/resolvelib/providers.py +0 -196
- venv/Lib/site-packages/pip/_vendor/resolvelib/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/resolvelib/reporters.py +0 -55
- venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/__init__.py +0 -27
- venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/abstract.py +0 -47
- venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/criterion.py +0 -48
- venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/exceptions.py +0 -57
- venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py +0 -622
- venv/Lib/site-packages/pip/_vendor/resolvelib/structs.py +0 -209
- venv/Lib/site-packages/pip/_vendor/rich/__init__.py +0 -177
- venv/Lib/site-packages/pip/_vendor/rich/__main__.py +0 -245
- venv/Lib/site-packages/pip/_vendor/rich/_cell_widths.py +0 -454
- venv/Lib/site-packages/pip/_vendor/rich/_emoji_codes.py +0 -3610
- venv/Lib/site-packages/pip/_vendor/rich/_emoji_replace.py +0 -32
- venv/Lib/site-packages/pip/_vendor/rich/_export_format.py +0 -76
- venv/Lib/site-packages/pip/_vendor/rich/_extension.py +0 -10
- venv/Lib/site-packages/pip/_vendor/rich/_fileno.py +0 -24
- venv/Lib/site-packages/pip/_vendor/rich/_inspect.py +0 -268
- venv/Lib/site-packages/pip/_vendor/rich/_log_render.py +0 -94
- venv/Lib/site-packages/pip/_vendor/rich/_loop.py +0 -43
- venv/Lib/site-packages/pip/_vendor/rich/_null_file.py +0 -69
- venv/Lib/site-packages/pip/_vendor/rich/_palettes.py +0 -309
- venv/Lib/site-packages/pip/_vendor/rich/_pick.py +0 -17
- venv/Lib/site-packages/pip/_vendor/rich/_ratio.py +0 -153
- venv/Lib/site-packages/pip/_vendor/rich/_spinners.py +0 -482
- venv/Lib/site-packages/pip/_vendor/rich/_stack.py +0 -16
- venv/Lib/site-packages/pip/_vendor/rich/_timer.py +0 -19
- venv/Lib/site-packages/pip/_vendor/rich/_win32_console.py +0 -661
- venv/Lib/site-packages/pip/_vendor/rich/_windows.py +0 -71
- venv/Lib/site-packages/pip/_vendor/rich/_windows_renderer.py +0 -56
- venv/Lib/site-packages/pip/_vendor/rich/_wrap.py +0 -93
- venv/Lib/site-packages/pip/_vendor/rich/abc.py +0 -33
- venv/Lib/site-packages/pip/_vendor/rich/align.py +0 -306
- venv/Lib/site-packages/pip/_vendor/rich/ansi.py +0 -241
- venv/Lib/site-packages/pip/_vendor/rich/bar.py +0 -93
- venv/Lib/site-packages/pip/_vendor/rich/box.py +0 -474
- venv/Lib/site-packages/pip/_vendor/rich/cells.py +0 -174
- venv/Lib/site-packages/pip/_vendor/rich/color.py +0 -621
- venv/Lib/site-packages/pip/_vendor/rich/color_triplet.py +0 -38
- venv/Lib/site-packages/pip/_vendor/rich/columns.py +0 -187
- venv/Lib/site-packages/pip/_vendor/rich/console.py +0 -2680
- venv/Lib/site-packages/pip/_vendor/rich/constrain.py +0 -37
- venv/Lib/site-packages/pip/_vendor/rich/containers.py +0 -167
- venv/Lib/site-packages/pip/_vendor/rich/control.py +0 -219
- venv/Lib/site-packages/pip/_vendor/rich/default_styles.py +0 -193
- venv/Lib/site-packages/pip/_vendor/rich/diagnose.py +0 -39
- venv/Lib/site-packages/pip/_vendor/rich/emoji.py +0 -91
- venv/Lib/site-packages/pip/_vendor/rich/errors.py +0 -34
- venv/Lib/site-packages/pip/_vendor/rich/file_proxy.py +0 -57
- venv/Lib/site-packages/pip/_vendor/rich/filesize.py +0 -88
- venv/Lib/site-packages/pip/_vendor/rich/highlighter.py +0 -232
- venv/Lib/site-packages/pip/_vendor/rich/json.py +0 -139
- venv/Lib/site-packages/pip/_vendor/rich/jupyter.py +0 -101
- venv/Lib/site-packages/pip/_vendor/rich/layout.py +0 -442
- venv/Lib/site-packages/pip/_vendor/rich/live.py +0 -400
- venv/Lib/site-packages/pip/_vendor/rich/live_render.py +0 -106
- venv/Lib/site-packages/pip/_vendor/rich/logging.py +0 -297
- venv/Lib/site-packages/pip/_vendor/rich/markup.py +0 -251
- venv/Lib/site-packages/pip/_vendor/rich/measure.py +0 -151
- venv/Lib/site-packages/pip/_vendor/rich/padding.py +0 -141
- venv/Lib/site-packages/pip/_vendor/rich/pager.py +0 -34
- venv/Lib/site-packages/pip/_vendor/rich/palette.py +0 -100
- venv/Lib/site-packages/pip/_vendor/rich/panel.py +0 -317
- venv/Lib/site-packages/pip/_vendor/rich/pretty.py +0 -1016
- venv/Lib/site-packages/pip/_vendor/rich/progress.py +0 -1715
- venv/Lib/site-packages/pip/_vendor/rich/progress_bar.py +0 -223
- venv/Lib/site-packages/pip/_vendor/rich/prompt.py +0 -400
- venv/Lib/site-packages/pip/_vendor/rich/protocol.py +0 -42
- venv/Lib/site-packages/pip/_vendor/rich/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/rich/region.py +0 -10
- venv/Lib/site-packages/pip/_vendor/rich/repr.py +0 -149
- venv/Lib/site-packages/pip/_vendor/rich/rule.py +0 -130
- venv/Lib/site-packages/pip/_vendor/rich/scope.py +0 -86
- venv/Lib/site-packages/pip/_vendor/rich/screen.py +0 -54
- venv/Lib/site-packages/pip/_vendor/rich/segment.py +0 -752
- venv/Lib/site-packages/pip/_vendor/rich/spinner.py +0 -132
- venv/Lib/site-packages/pip/_vendor/rich/status.py +0 -131
- venv/Lib/site-packages/pip/_vendor/rich/style.py +0 -796
- venv/Lib/site-packages/pip/_vendor/rich/styled.py +0 -42
- venv/Lib/site-packages/pip/_vendor/rich/syntax.py +0 -985
- venv/Lib/site-packages/pip/_vendor/rich/table.py +0 -1006
- venv/Lib/site-packages/pip/_vendor/rich/terminal_theme.py +0 -153
- venv/Lib/site-packages/pip/_vendor/rich/text.py +0 -1361
- venv/Lib/site-packages/pip/_vendor/rich/theme.py +0 -115
- venv/Lib/site-packages/pip/_vendor/rich/themes.py +0 -5
- venv/Lib/site-packages/pip/_vendor/rich/traceback.py +0 -899
- venv/Lib/site-packages/pip/_vendor/rich/tree.py +0 -257
- venv/Lib/site-packages/pip/_vendor/tomli/__init__.py +0 -8
- venv/Lib/site-packages/pip/_vendor/tomli/_parser.py +0 -770
- venv/Lib/site-packages/pip/_vendor/tomli/_re.py +0 -112
- venv/Lib/site-packages/pip/_vendor/tomli/_types.py +0 -10
- venv/Lib/site-packages/pip/_vendor/tomli/py.typed +0 -1
- venv/Lib/site-packages/pip/_vendor/tomli_w/__init__.py +0 -4
- venv/Lib/site-packages/pip/_vendor/tomli_w/_writer.py +0 -229
- venv/Lib/site-packages/pip/_vendor/tomli_w/py.typed +0 -1
- venv/Lib/site-packages/pip/_vendor/truststore/__init__.py +0 -36
- venv/Lib/site-packages/pip/_vendor/truststore/_api.py +0 -333
- venv/Lib/site-packages/pip/_vendor/truststore/_macos.py +0 -571
- venv/Lib/site-packages/pip/_vendor/truststore/_openssl.py +0 -66
- venv/Lib/site-packages/pip/_vendor/truststore/_ssl_constants.py +0 -31
- venv/Lib/site-packages/pip/_vendor/truststore/_windows.py +0 -567
- venv/Lib/site-packages/pip/_vendor/truststore/py.typed +0 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/__init__.py +0 -102
- venv/Lib/site-packages/pip/_vendor/urllib3/_collections.py +0 -355
- venv/Lib/site-packages/pip/_vendor/urllib3/_version.py +0 -2
- venv/Lib/site-packages/pip/_vendor/urllib3/connection.py +0 -572
- venv/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py +0 -1140
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +0 -36
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +0 -519
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +0 -397
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/appengine.py +0 -314
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +0 -130
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +0 -518
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +0 -920
- venv/Lib/site-packages/pip/_vendor/urllib3/contrib/socks.py +0 -216
- venv/Lib/site-packages/pip/_vendor/urllib3/exceptions.py +0 -323
- venv/Lib/site-packages/pip/_vendor/urllib3/fields.py +0 -274
- venv/Lib/site-packages/pip/_vendor/urllib3/filepost.py +0 -98
- venv/Lib/site-packages/pip/_vendor/urllib3/packages/__init__.py +0 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
- venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +0 -51
- venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/weakref_finalize.py +0 -155
- venv/Lib/site-packages/pip/_vendor/urllib3/packages/six.py +0 -1076
- venv/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py +0 -540
- venv/Lib/site-packages/pip/_vendor/urllib3/request.py +0 -191
- venv/Lib/site-packages/pip/_vendor/urllib3/response.py +0 -879
- venv/Lib/site-packages/pip/_vendor/urllib3/util/__init__.py +0 -49
- venv/Lib/site-packages/pip/_vendor/urllib3/util/connection.py +0 -149
- venv/Lib/site-packages/pip/_vendor/urllib3/util/proxy.py +0 -57
- venv/Lib/site-packages/pip/_vendor/urllib3/util/queue.py +0 -22
- venv/Lib/site-packages/pip/_vendor/urllib3/util/request.py +0 -137
- venv/Lib/site-packages/pip/_vendor/urllib3/util/response.py +0 -107
- venv/Lib/site-packages/pip/_vendor/urllib3/util/retry.py +0 -622
- venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py +0 -504
- venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +0 -159
- venv/Lib/site-packages/pip/_vendor/urllib3/util/ssltransport.py +0 -221
- venv/Lib/site-packages/pip/_vendor/urllib3/util/timeout.py +0 -271
- venv/Lib/site-packages/pip/_vendor/urllib3/util/url.py +0 -435
- venv/Lib/site-packages/pip/_vendor/urllib3/util/wait.py +0 -152
- venv/Lib/site-packages/pip/py.typed +0 -4
- {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/WHEEL +0 -0
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
from datetime import datetime
|
|
3
|
-
from logging import Handler, LogRecord
|
|
4
|
-
from pathlib import Path
|
|
5
|
-
from types import ModuleType
|
|
6
|
-
from typing import ClassVar, Iterable, List, Optional, Type, Union
|
|
7
|
-
|
|
8
|
-
from pip._vendor.rich._null_file import NullFile
|
|
9
|
-
|
|
10
|
-
from . import get_console
|
|
11
|
-
from ._log_render import FormatTimeCallable, LogRender
|
|
12
|
-
from .console import Console, ConsoleRenderable
|
|
13
|
-
from .highlighter import Highlighter, ReprHighlighter
|
|
14
|
-
from .text import Text
|
|
15
|
-
from .traceback import Traceback
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class RichHandler(Handler):
|
|
19
|
-
"""A logging handler that renders output with Rich. The time / level / message and file are displayed in columns.
|
|
20
|
-
The level is color coded, and the message is syntax highlighted.
|
|
21
|
-
|
|
22
|
-
Note:
|
|
23
|
-
Be careful when enabling console markup in log messages if you have configured logging for libraries not
|
|
24
|
-
under your control. If a dependency writes messages containing square brackets, it may not produce the intended output.
|
|
25
|
-
|
|
26
|
-
Args:
|
|
27
|
-
level (Union[int, str], optional): Log level. Defaults to logging.NOTSET.
|
|
28
|
-
console (:class:`~rich.console.Console`, optional): Optional console instance to write logs.
|
|
29
|
-
Default will use a global console instance writing to stdout.
|
|
30
|
-
show_time (bool, optional): Show a column for the time. Defaults to True.
|
|
31
|
-
omit_repeated_times (bool, optional): Omit repetition of the same time. Defaults to True.
|
|
32
|
-
show_level (bool, optional): Show a column for the level. Defaults to True.
|
|
33
|
-
show_path (bool, optional): Show the path to the original log call. Defaults to True.
|
|
34
|
-
enable_link_path (bool, optional): Enable terminal link of path column to file. Defaults to True.
|
|
35
|
-
highlighter (Highlighter, optional): Highlighter to style log messages, or None to use ReprHighlighter. Defaults to None.
|
|
36
|
-
markup (bool, optional): Enable console markup in log messages. Defaults to False.
|
|
37
|
-
rich_tracebacks (bool, optional): Enable rich tracebacks with syntax highlighting and formatting. Defaults to False.
|
|
38
|
-
tracebacks_width (Optional[int], optional): Number of characters used to render tracebacks, or None for full width. Defaults to None.
|
|
39
|
-
tracebacks_code_width (int, optional): Number of code characters used to render tracebacks, or None for full width. Defaults to 88.
|
|
40
|
-
tracebacks_extra_lines (int, optional): Additional lines of code to render tracebacks, or None for full width. Defaults to None.
|
|
41
|
-
tracebacks_theme (str, optional): Override pygments theme used in traceback.
|
|
42
|
-
tracebacks_word_wrap (bool, optional): Enable word wrapping of long tracebacks lines. Defaults to True.
|
|
43
|
-
tracebacks_show_locals (bool, optional): Enable display of locals in tracebacks. Defaults to False.
|
|
44
|
-
tracebacks_suppress (Sequence[Union[str, ModuleType]]): Optional sequence of modules or paths to exclude from traceback.
|
|
45
|
-
tracebacks_max_frames (int, optional): Optional maximum number of frames returned by traceback.
|
|
46
|
-
locals_max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.
|
|
47
|
-
Defaults to 10.
|
|
48
|
-
locals_max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to 80.
|
|
49
|
-
log_time_format (Union[str, TimeFormatterCallable], optional): If ``log_time`` is enabled, either string for strftime or callable that formats the time. Defaults to "[%x %X] ".
|
|
50
|
-
keywords (List[str], optional): List of words to highlight instead of ``RichHandler.KEYWORDS``.
|
|
51
|
-
"""
|
|
52
|
-
|
|
53
|
-
KEYWORDS: ClassVar[Optional[List[str]]] = [
|
|
54
|
-
"GET",
|
|
55
|
-
"POST",
|
|
56
|
-
"HEAD",
|
|
57
|
-
"PUT",
|
|
58
|
-
"DELETE",
|
|
59
|
-
"OPTIONS",
|
|
60
|
-
"TRACE",
|
|
61
|
-
"PATCH",
|
|
62
|
-
]
|
|
63
|
-
HIGHLIGHTER_CLASS: ClassVar[Type[Highlighter]] = ReprHighlighter
|
|
64
|
-
|
|
65
|
-
def __init__(
|
|
66
|
-
self,
|
|
67
|
-
level: Union[int, str] = logging.NOTSET,
|
|
68
|
-
console: Optional[Console] = None,
|
|
69
|
-
*,
|
|
70
|
-
show_time: bool = True,
|
|
71
|
-
omit_repeated_times: bool = True,
|
|
72
|
-
show_level: bool = True,
|
|
73
|
-
show_path: bool = True,
|
|
74
|
-
enable_link_path: bool = True,
|
|
75
|
-
highlighter: Optional[Highlighter] = None,
|
|
76
|
-
markup: bool = False,
|
|
77
|
-
rich_tracebacks: bool = False,
|
|
78
|
-
tracebacks_width: Optional[int] = None,
|
|
79
|
-
tracebacks_code_width: Optional[int] = 88,
|
|
80
|
-
tracebacks_extra_lines: int = 3,
|
|
81
|
-
tracebacks_theme: Optional[str] = None,
|
|
82
|
-
tracebacks_word_wrap: bool = True,
|
|
83
|
-
tracebacks_show_locals: bool = False,
|
|
84
|
-
tracebacks_suppress: Iterable[Union[str, ModuleType]] = (),
|
|
85
|
-
tracebacks_max_frames: int = 100,
|
|
86
|
-
locals_max_length: int = 10,
|
|
87
|
-
locals_max_string: int = 80,
|
|
88
|
-
log_time_format: Union[str, FormatTimeCallable] = "[%x %X]",
|
|
89
|
-
keywords: Optional[List[str]] = None,
|
|
90
|
-
) -> None:
|
|
91
|
-
super().__init__(level=level)
|
|
92
|
-
self.console = console or get_console()
|
|
93
|
-
self.highlighter = highlighter or self.HIGHLIGHTER_CLASS()
|
|
94
|
-
self._log_render = LogRender(
|
|
95
|
-
show_time=show_time,
|
|
96
|
-
show_level=show_level,
|
|
97
|
-
show_path=show_path,
|
|
98
|
-
time_format=log_time_format,
|
|
99
|
-
omit_repeated_times=omit_repeated_times,
|
|
100
|
-
level_width=None,
|
|
101
|
-
)
|
|
102
|
-
self.enable_link_path = enable_link_path
|
|
103
|
-
self.markup = markup
|
|
104
|
-
self.rich_tracebacks = rich_tracebacks
|
|
105
|
-
self.tracebacks_width = tracebacks_width
|
|
106
|
-
self.tracebacks_extra_lines = tracebacks_extra_lines
|
|
107
|
-
self.tracebacks_theme = tracebacks_theme
|
|
108
|
-
self.tracebacks_word_wrap = tracebacks_word_wrap
|
|
109
|
-
self.tracebacks_show_locals = tracebacks_show_locals
|
|
110
|
-
self.tracebacks_suppress = tracebacks_suppress
|
|
111
|
-
self.tracebacks_max_frames = tracebacks_max_frames
|
|
112
|
-
self.tracebacks_code_width = tracebacks_code_width
|
|
113
|
-
self.locals_max_length = locals_max_length
|
|
114
|
-
self.locals_max_string = locals_max_string
|
|
115
|
-
self.keywords = keywords
|
|
116
|
-
|
|
117
|
-
def get_level_text(self, record: LogRecord) -> Text:
|
|
118
|
-
"""Get the level name from the record.
|
|
119
|
-
|
|
120
|
-
Args:
|
|
121
|
-
record (LogRecord): LogRecord instance.
|
|
122
|
-
|
|
123
|
-
Returns:
|
|
124
|
-
Text: A tuple of the style and level name.
|
|
125
|
-
"""
|
|
126
|
-
level_name = record.levelname
|
|
127
|
-
level_text = Text.styled(
|
|
128
|
-
level_name.ljust(8), f"logging.level.{level_name.lower()}"
|
|
129
|
-
)
|
|
130
|
-
return level_text
|
|
131
|
-
|
|
132
|
-
def emit(self, record: LogRecord) -> None:
|
|
133
|
-
"""Invoked by logging."""
|
|
134
|
-
message = self.format(record)
|
|
135
|
-
traceback = None
|
|
136
|
-
if (
|
|
137
|
-
self.rich_tracebacks
|
|
138
|
-
and record.exc_info
|
|
139
|
-
and record.exc_info != (None, None, None)
|
|
140
|
-
):
|
|
141
|
-
exc_type, exc_value, exc_traceback = record.exc_info
|
|
142
|
-
assert exc_type is not None
|
|
143
|
-
assert exc_value is not None
|
|
144
|
-
traceback = Traceback.from_exception(
|
|
145
|
-
exc_type,
|
|
146
|
-
exc_value,
|
|
147
|
-
exc_traceback,
|
|
148
|
-
width=self.tracebacks_width,
|
|
149
|
-
code_width=self.tracebacks_code_width,
|
|
150
|
-
extra_lines=self.tracebacks_extra_lines,
|
|
151
|
-
theme=self.tracebacks_theme,
|
|
152
|
-
word_wrap=self.tracebacks_word_wrap,
|
|
153
|
-
show_locals=self.tracebacks_show_locals,
|
|
154
|
-
locals_max_length=self.locals_max_length,
|
|
155
|
-
locals_max_string=self.locals_max_string,
|
|
156
|
-
suppress=self.tracebacks_suppress,
|
|
157
|
-
max_frames=self.tracebacks_max_frames,
|
|
158
|
-
)
|
|
159
|
-
message = record.getMessage()
|
|
160
|
-
if self.formatter:
|
|
161
|
-
record.message = record.getMessage()
|
|
162
|
-
formatter = self.formatter
|
|
163
|
-
if hasattr(formatter, "usesTime") and formatter.usesTime():
|
|
164
|
-
record.asctime = formatter.formatTime(record, formatter.datefmt)
|
|
165
|
-
message = formatter.formatMessage(record)
|
|
166
|
-
|
|
167
|
-
message_renderable = self.render_message(record, message)
|
|
168
|
-
log_renderable = self.render(
|
|
169
|
-
record=record, traceback=traceback, message_renderable=message_renderable
|
|
170
|
-
)
|
|
171
|
-
if isinstance(self.console.file, NullFile):
|
|
172
|
-
# Handles pythonw, where stdout/stderr are null, and we return NullFile
|
|
173
|
-
# instance from Console.file. In this case, we still want to make a log record
|
|
174
|
-
# even though we won't be writing anything to a file.
|
|
175
|
-
self.handleError(record)
|
|
176
|
-
else:
|
|
177
|
-
try:
|
|
178
|
-
self.console.print(log_renderable)
|
|
179
|
-
except Exception:
|
|
180
|
-
self.handleError(record)
|
|
181
|
-
|
|
182
|
-
def render_message(self, record: LogRecord, message: str) -> "ConsoleRenderable":
|
|
183
|
-
"""Render message text in to Text.
|
|
184
|
-
|
|
185
|
-
Args:
|
|
186
|
-
record (LogRecord): logging Record.
|
|
187
|
-
message (str): String containing log message.
|
|
188
|
-
|
|
189
|
-
Returns:
|
|
190
|
-
ConsoleRenderable: Renderable to display log message.
|
|
191
|
-
"""
|
|
192
|
-
use_markup = getattr(record, "markup", self.markup)
|
|
193
|
-
message_text = Text.from_markup(message) if use_markup else Text(message)
|
|
194
|
-
|
|
195
|
-
highlighter = getattr(record, "highlighter", self.highlighter)
|
|
196
|
-
if highlighter:
|
|
197
|
-
message_text = highlighter(message_text)
|
|
198
|
-
|
|
199
|
-
if self.keywords is None:
|
|
200
|
-
self.keywords = self.KEYWORDS
|
|
201
|
-
|
|
202
|
-
if self.keywords:
|
|
203
|
-
message_text.highlight_words(self.keywords, "logging.keyword")
|
|
204
|
-
|
|
205
|
-
return message_text
|
|
206
|
-
|
|
207
|
-
def render(
|
|
208
|
-
self,
|
|
209
|
-
*,
|
|
210
|
-
record: LogRecord,
|
|
211
|
-
traceback: Optional[Traceback],
|
|
212
|
-
message_renderable: "ConsoleRenderable",
|
|
213
|
-
) -> "ConsoleRenderable":
|
|
214
|
-
"""Render log for display.
|
|
215
|
-
|
|
216
|
-
Args:
|
|
217
|
-
record (LogRecord): logging Record.
|
|
218
|
-
traceback (Optional[Traceback]): Traceback instance or None for no Traceback.
|
|
219
|
-
message_renderable (ConsoleRenderable): Renderable (typically Text) containing log message contents.
|
|
220
|
-
|
|
221
|
-
Returns:
|
|
222
|
-
ConsoleRenderable: Renderable to display log.
|
|
223
|
-
"""
|
|
224
|
-
path = Path(record.pathname).name
|
|
225
|
-
level = self.get_level_text(record)
|
|
226
|
-
time_format = None if self.formatter is None else self.formatter.datefmt
|
|
227
|
-
log_time = datetime.fromtimestamp(record.created)
|
|
228
|
-
|
|
229
|
-
log_renderable = self._log_render(
|
|
230
|
-
self.console,
|
|
231
|
-
[message_renderable] if not traceback else [message_renderable, traceback],
|
|
232
|
-
log_time=log_time,
|
|
233
|
-
time_format=time_format,
|
|
234
|
-
level=level,
|
|
235
|
-
path=path,
|
|
236
|
-
line_no=record.lineno,
|
|
237
|
-
link_path=record.pathname if self.enable_link_path else None,
|
|
238
|
-
)
|
|
239
|
-
return log_renderable
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
if __name__ == "__main__": # pragma: no cover
|
|
243
|
-
from time import sleep
|
|
244
|
-
|
|
245
|
-
FORMAT = "%(message)s"
|
|
246
|
-
# FORMAT = "%(asctime)-15s - %(levelname)s - %(message)s"
|
|
247
|
-
logging.basicConfig(
|
|
248
|
-
level="NOTSET",
|
|
249
|
-
format=FORMAT,
|
|
250
|
-
datefmt="[%X]",
|
|
251
|
-
handlers=[RichHandler(rich_tracebacks=True, tracebacks_show_locals=True)],
|
|
252
|
-
)
|
|
253
|
-
log = logging.getLogger("rich")
|
|
254
|
-
|
|
255
|
-
log.info("Server starting...")
|
|
256
|
-
log.info("Listening on http://127.0.0.1:8080")
|
|
257
|
-
sleep(1)
|
|
258
|
-
|
|
259
|
-
log.info("GET /index.html 200 1298")
|
|
260
|
-
log.info("GET /imgs/backgrounds/back1.jpg 200 54386")
|
|
261
|
-
log.info("GET /css/styles.css 200 54386")
|
|
262
|
-
log.warning("GET /favicon.ico 404 242")
|
|
263
|
-
sleep(1)
|
|
264
|
-
|
|
265
|
-
log.debug(
|
|
266
|
-
"JSONRPC request\n--> %r\n<-- %r",
|
|
267
|
-
{
|
|
268
|
-
"version": "1.1",
|
|
269
|
-
"method": "confirmFruitPurchase",
|
|
270
|
-
"params": [["apple", "orange", "mangoes", "pomelo"], 1.123],
|
|
271
|
-
"id": "194521489",
|
|
272
|
-
},
|
|
273
|
-
{"version": "1.1", "result": True, "error": None, "id": "194521489"},
|
|
274
|
-
)
|
|
275
|
-
log.debug(
|
|
276
|
-
"Loading configuration file /adasd/asdasd/qeqwe/qwrqwrqwr/sdgsdgsdg/werwerwer/dfgerert/ertertert/ertetert/werwerwer"
|
|
277
|
-
)
|
|
278
|
-
log.error("Unable to find 'pomelo' in database!")
|
|
279
|
-
log.info("POST /jsonrpc/ 200 65532")
|
|
280
|
-
log.info("POST /admin/ 401 42234")
|
|
281
|
-
log.warning("password was rejected for admin site.")
|
|
282
|
-
|
|
283
|
-
def divide() -> None:
|
|
284
|
-
number = 1
|
|
285
|
-
divisor = 0
|
|
286
|
-
foos = ["foo"] * 100
|
|
287
|
-
log.debug("in divide")
|
|
288
|
-
try:
|
|
289
|
-
number / divisor
|
|
290
|
-
except:
|
|
291
|
-
log.exception("An error of some kind occurred!")
|
|
292
|
-
|
|
293
|
-
divide()
|
|
294
|
-
sleep(1)
|
|
295
|
-
log.critical("Out of memory!")
|
|
296
|
-
log.info("Server exited with code=-1")
|
|
297
|
-
log.info("[bold]EXITING...[/bold]", extra=dict(markup=True))
|
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
import re
|
|
2
|
-
from ast import literal_eval
|
|
3
|
-
from operator import attrgetter
|
|
4
|
-
from typing import Callable, Iterable, List, Match, NamedTuple, Optional, Tuple, Union
|
|
5
|
-
|
|
6
|
-
from ._emoji_replace import _emoji_replace
|
|
7
|
-
from .emoji import EmojiVariant
|
|
8
|
-
from .errors import MarkupError
|
|
9
|
-
from .style import Style
|
|
10
|
-
from .text import Span, Text
|
|
11
|
-
|
|
12
|
-
RE_TAGS = re.compile(
|
|
13
|
-
r"""((\\*)\[([a-z#/@][^[]*?)])""",
|
|
14
|
-
re.VERBOSE,
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
RE_HANDLER = re.compile(r"^([\w.]*?)(\(.*?\))?$")
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class Tag(NamedTuple):
|
|
21
|
-
"""A tag in console markup."""
|
|
22
|
-
|
|
23
|
-
name: str
|
|
24
|
-
"""The tag name. e.g. 'bold'."""
|
|
25
|
-
parameters: Optional[str]
|
|
26
|
-
"""Any additional parameters after the name."""
|
|
27
|
-
|
|
28
|
-
def __str__(self) -> str:
|
|
29
|
-
return (
|
|
30
|
-
self.name if self.parameters is None else f"{self.name} {self.parameters}"
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
@property
|
|
34
|
-
def markup(self) -> str:
|
|
35
|
-
"""Get the string representation of this tag."""
|
|
36
|
-
return (
|
|
37
|
-
f"[{self.name}]"
|
|
38
|
-
if self.parameters is None
|
|
39
|
-
else f"[{self.name}={self.parameters}]"
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
_ReStringMatch = Match[str] # regex match object
|
|
44
|
-
_ReSubCallable = Callable[[_ReStringMatch], str] # Callable invoked by re.sub
|
|
45
|
-
_EscapeSubMethod = Callable[[_ReSubCallable, str], str] # Sub method of a compiled re
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def escape(
|
|
49
|
-
markup: str,
|
|
50
|
-
_escape: _EscapeSubMethod = re.compile(r"(\\*)(\[[a-z#/@][^[]*?])").sub,
|
|
51
|
-
) -> str:
|
|
52
|
-
"""Escapes text so that it won't be interpreted as markup.
|
|
53
|
-
|
|
54
|
-
Args:
|
|
55
|
-
markup (str): Content to be inserted in to markup.
|
|
56
|
-
|
|
57
|
-
Returns:
|
|
58
|
-
str: Markup with square brackets escaped.
|
|
59
|
-
"""
|
|
60
|
-
|
|
61
|
-
def escape_backslashes(match: Match[str]) -> str:
|
|
62
|
-
"""Called by re.sub replace matches."""
|
|
63
|
-
backslashes, text = match.groups()
|
|
64
|
-
return f"{backslashes}{backslashes}\\{text}"
|
|
65
|
-
|
|
66
|
-
markup = _escape(escape_backslashes, markup)
|
|
67
|
-
if markup.endswith("\\") and not markup.endswith("\\\\"):
|
|
68
|
-
return markup + "\\"
|
|
69
|
-
|
|
70
|
-
return markup
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
def _parse(markup: str) -> Iterable[Tuple[int, Optional[str], Optional[Tag]]]:
|
|
74
|
-
"""Parse markup in to an iterable of tuples of (position, text, tag).
|
|
75
|
-
|
|
76
|
-
Args:
|
|
77
|
-
markup (str): A string containing console markup
|
|
78
|
-
|
|
79
|
-
"""
|
|
80
|
-
position = 0
|
|
81
|
-
_divmod = divmod
|
|
82
|
-
_Tag = Tag
|
|
83
|
-
for match in RE_TAGS.finditer(markup):
|
|
84
|
-
full_text, escapes, tag_text = match.groups()
|
|
85
|
-
start, end = match.span()
|
|
86
|
-
if start > position:
|
|
87
|
-
yield start, markup[position:start], None
|
|
88
|
-
if escapes:
|
|
89
|
-
backslashes, escaped = _divmod(len(escapes), 2)
|
|
90
|
-
if backslashes:
|
|
91
|
-
# Literal backslashes
|
|
92
|
-
yield start, "\\" * backslashes, None
|
|
93
|
-
start += backslashes * 2
|
|
94
|
-
if escaped:
|
|
95
|
-
# Escape of tag
|
|
96
|
-
yield start, full_text[len(escapes) :], None
|
|
97
|
-
position = end
|
|
98
|
-
continue
|
|
99
|
-
text, equals, parameters = tag_text.partition("=")
|
|
100
|
-
yield start, None, _Tag(text, parameters if equals else None)
|
|
101
|
-
position = end
|
|
102
|
-
if position < len(markup):
|
|
103
|
-
yield position, markup[position:], None
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
def render(
|
|
107
|
-
markup: str,
|
|
108
|
-
style: Union[str, Style] = "",
|
|
109
|
-
emoji: bool = True,
|
|
110
|
-
emoji_variant: Optional[EmojiVariant] = None,
|
|
111
|
-
) -> Text:
|
|
112
|
-
"""Render console markup in to a Text instance.
|
|
113
|
-
|
|
114
|
-
Args:
|
|
115
|
-
markup (str): A string containing console markup.
|
|
116
|
-
style: (Union[str, Style]): The style to use.
|
|
117
|
-
emoji (bool, optional): Also render emoji code. Defaults to True.
|
|
118
|
-
emoji_variant (str, optional): Optional emoji variant, either "text" or "emoji". Defaults to None.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
Raises:
|
|
122
|
-
MarkupError: If there is a syntax error in the markup.
|
|
123
|
-
|
|
124
|
-
Returns:
|
|
125
|
-
Text: A test instance.
|
|
126
|
-
"""
|
|
127
|
-
emoji_replace = _emoji_replace
|
|
128
|
-
if "[" not in markup:
|
|
129
|
-
return Text(
|
|
130
|
-
emoji_replace(markup, default_variant=emoji_variant) if emoji else markup,
|
|
131
|
-
style=style,
|
|
132
|
-
)
|
|
133
|
-
text = Text(style=style)
|
|
134
|
-
append = text.append
|
|
135
|
-
normalize = Style.normalize
|
|
136
|
-
|
|
137
|
-
style_stack: List[Tuple[int, Tag]] = []
|
|
138
|
-
pop = style_stack.pop
|
|
139
|
-
|
|
140
|
-
spans: List[Span] = []
|
|
141
|
-
append_span = spans.append
|
|
142
|
-
|
|
143
|
-
_Span = Span
|
|
144
|
-
_Tag = Tag
|
|
145
|
-
|
|
146
|
-
def pop_style(style_name: str) -> Tuple[int, Tag]:
|
|
147
|
-
"""Pop tag matching given style name."""
|
|
148
|
-
for index, (_, tag) in enumerate(reversed(style_stack), 1):
|
|
149
|
-
if tag.name == style_name:
|
|
150
|
-
return pop(-index)
|
|
151
|
-
raise KeyError(style_name)
|
|
152
|
-
|
|
153
|
-
for position, plain_text, tag in _parse(markup):
|
|
154
|
-
if plain_text is not None:
|
|
155
|
-
# Handle open brace escapes, where the brace is not part of a tag.
|
|
156
|
-
plain_text = plain_text.replace("\\[", "[")
|
|
157
|
-
append(emoji_replace(plain_text) if emoji else plain_text)
|
|
158
|
-
elif tag is not None:
|
|
159
|
-
if tag.name.startswith("/"): # Closing tag
|
|
160
|
-
style_name = tag.name[1:].strip()
|
|
161
|
-
|
|
162
|
-
if style_name: # explicit close
|
|
163
|
-
style_name = normalize(style_name)
|
|
164
|
-
try:
|
|
165
|
-
start, open_tag = pop_style(style_name)
|
|
166
|
-
except KeyError:
|
|
167
|
-
raise MarkupError(
|
|
168
|
-
f"closing tag '{tag.markup}' at position {position} doesn't match any open tag"
|
|
169
|
-
) from None
|
|
170
|
-
else: # implicit close
|
|
171
|
-
try:
|
|
172
|
-
start, open_tag = pop()
|
|
173
|
-
except IndexError:
|
|
174
|
-
raise MarkupError(
|
|
175
|
-
f"closing tag '[/]' at position {position} has nothing to close"
|
|
176
|
-
) from None
|
|
177
|
-
|
|
178
|
-
if open_tag.name.startswith("@"):
|
|
179
|
-
if open_tag.parameters:
|
|
180
|
-
handler_name = ""
|
|
181
|
-
parameters = open_tag.parameters.strip()
|
|
182
|
-
handler_match = RE_HANDLER.match(parameters)
|
|
183
|
-
if handler_match is not None:
|
|
184
|
-
handler_name, match_parameters = handler_match.groups()
|
|
185
|
-
parameters = (
|
|
186
|
-
"()" if match_parameters is None else match_parameters
|
|
187
|
-
)
|
|
188
|
-
|
|
189
|
-
try:
|
|
190
|
-
meta_params = literal_eval(parameters)
|
|
191
|
-
except SyntaxError as error:
|
|
192
|
-
raise MarkupError(
|
|
193
|
-
f"error parsing {parameters!r} in {open_tag.parameters!r}; {error.msg}"
|
|
194
|
-
)
|
|
195
|
-
except Exception as error:
|
|
196
|
-
raise MarkupError(
|
|
197
|
-
f"error parsing {open_tag.parameters!r}; {error}"
|
|
198
|
-
) from None
|
|
199
|
-
|
|
200
|
-
if handler_name:
|
|
201
|
-
meta_params = (
|
|
202
|
-
handler_name,
|
|
203
|
-
meta_params
|
|
204
|
-
if isinstance(meta_params, tuple)
|
|
205
|
-
else (meta_params,),
|
|
206
|
-
)
|
|
207
|
-
|
|
208
|
-
else:
|
|
209
|
-
meta_params = ()
|
|
210
|
-
|
|
211
|
-
append_span(
|
|
212
|
-
_Span(
|
|
213
|
-
start, len(text), Style(meta={open_tag.name: meta_params})
|
|
214
|
-
)
|
|
215
|
-
)
|
|
216
|
-
else:
|
|
217
|
-
append_span(_Span(start, len(text), str(open_tag)))
|
|
218
|
-
|
|
219
|
-
else: # Opening tag
|
|
220
|
-
normalized_tag = _Tag(normalize(tag.name), tag.parameters)
|
|
221
|
-
style_stack.append((len(text), normalized_tag))
|
|
222
|
-
|
|
223
|
-
text_length = len(text)
|
|
224
|
-
while style_stack:
|
|
225
|
-
start, tag = style_stack.pop()
|
|
226
|
-
style = str(tag)
|
|
227
|
-
if style:
|
|
228
|
-
append_span(_Span(start, text_length, style))
|
|
229
|
-
|
|
230
|
-
text.spans = sorted(spans[::-1], key=attrgetter("start"))
|
|
231
|
-
return text
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
if __name__ == "__main__": # pragma: no cover
|
|
235
|
-
MARKUP = [
|
|
236
|
-
"[red]Hello World[/red]",
|
|
237
|
-
"[magenta]Hello [b]World[/b]",
|
|
238
|
-
"[bold]Bold[italic] bold and italic [/bold]italic[/italic]",
|
|
239
|
-
"Click [link=https://www.willmcgugan.com]here[/link] to visit my Blog",
|
|
240
|
-
":warning-emoji: [bold red blink] DANGER![/]",
|
|
241
|
-
]
|
|
242
|
-
|
|
243
|
-
from pip._vendor.rich import print
|
|
244
|
-
from pip._vendor.rich.table import Table
|
|
245
|
-
|
|
246
|
-
grid = Table("Markup", "Result", padding=(0, 1))
|
|
247
|
-
|
|
248
|
-
for markup in MARKUP:
|
|
249
|
-
grid.add_row(Text(markup), markup)
|
|
250
|
-
|
|
251
|
-
print(grid)
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
from operator import itemgetter
|
|
2
|
-
from typing import TYPE_CHECKING, Callable, NamedTuple, Optional, Sequence
|
|
3
|
-
|
|
4
|
-
from . import errors
|
|
5
|
-
from .protocol import is_renderable, rich_cast
|
|
6
|
-
|
|
7
|
-
if TYPE_CHECKING:
|
|
8
|
-
from .console import Console, ConsoleOptions, RenderableType
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class Measurement(NamedTuple):
|
|
12
|
-
"""Stores the minimum and maximum widths (in characters) required to render an object."""
|
|
13
|
-
|
|
14
|
-
minimum: int
|
|
15
|
-
"""Minimum number of cells required to render."""
|
|
16
|
-
maximum: int
|
|
17
|
-
"""Maximum number of cells required to render."""
|
|
18
|
-
|
|
19
|
-
@property
|
|
20
|
-
def span(self) -> int:
|
|
21
|
-
"""Get difference between maximum and minimum."""
|
|
22
|
-
return self.maximum - self.minimum
|
|
23
|
-
|
|
24
|
-
def normalize(self) -> "Measurement":
|
|
25
|
-
"""Get measurement that ensures that minimum <= maximum and minimum >= 0
|
|
26
|
-
|
|
27
|
-
Returns:
|
|
28
|
-
Measurement: A normalized measurement.
|
|
29
|
-
"""
|
|
30
|
-
minimum, maximum = self
|
|
31
|
-
minimum = min(max(0, minimum), maximum)
|
|
32
|
-
return Measurement(max(0, minimum), max(0, max(minimum, maximum)))
|
|
33
|
-
|
|
34
|
-
def with_maximum(self, width: int) -> "Measurement":
|
|
35
|
-
"""Get a RenderableWith where the widths are <= width.
|
|
36
|
-
|
|
37
|
-
Args:
|
|
38
|
-
width (int): Maximum desired width.
|
|
39
|
-
|
|
40
|
-
Returns:
|
|
41
|
-
Measurement: New Measurement object.
|
|
42
|
-
"""
|
|
43
|
-
minimum, maximum = self
|
|
44
|
-
return Measurement(min(minimum, width), min(maximum, width))
|
|
45
|
-
|
|
46
|
-
def with_minimum(self, width: int) -> "Measurement":
|
|
47
|
-
"""Get a RenderableWith where the widths are >= width.
|
|
48
|
-
|
|
49
|
-
Args:
|
|
50
|
-
width (int): Minimum desired width.
|
|
51
|
-
|
|
52
|
-
Returns:
|
|
53
|
-
Measurement: New Measurement object.
|
|
54
|
-
"""
|
|
55
|
-
minimum, maximum = self
|
|
56
|
-
width = max(0, width)
|
|
57
|
-
return Measurement(max(minimum, width), max(maximum, width))
|
|
58
|
-
|
|
59
|
-
def clamp(
|
|
60
|
-
self, min_width: Optional[int] = None, max_width: Optional[int] = None
|
|
61
|
-
) -> "Measurement":
|
|
62
|
-
"""Clamp a measurement within the specified range.
|
|
63
|
-
|
|
64
|
-
Args:
|
|
65
|
-
min_width (int): Minimum desired width, or ``None`` for no minimum. Defaults to None.
|
|
66
|
-
max_width (int): Maximum desired width, or ``None`` for no maximum. Defaults to None.
|
|
67
|
-
|
|
68
|
-
Returns:
|
|
69
|
-
Measurement: New Measurement object.
|
|
70
|
-
"""
|
|
71
|
-
measurement = self
|
|
72
|
-
if min_width is not None:
|
|
73
|
-
measurement = measurement.with_minimum(min_width)
|
|
74
|
-
if max_width is not None:
|
|
75
|
-
measurement = measurement.with_maximum(max_width)
|
|
76
|
-
return measurement
|
|
77
|
-
|
|
78
|
-
@classmethod
|
|
79
|
-
def get(
|
|
80
|
-
cls, console: "Console", options: "ConsoleOptions", renderable: "RenderableType"
|
|
81
|
-
) -> "Measurement":
|
|
82
|
-
"""Get a measurement for a renderable.
|
|
83
|
-
|
|
84
|
-
Args:
|
|
85
|
-
console (~rich.console.Console): Console instance.
|
|
86
|
-
options (~rich.console.ConsoleOptions): Console options.
|
|
87
|
-
renderable (RenderableType): An object that may be rendered with Rich.
|
|
88
|
-
|
|
89
|
-
Raises:
|
|
90
|
-
errors.NotRenderableError: If the object is not renderable.
|
|
91
|
-
|
|
92
|
-
Returns:
|
|
93
|
-
Measurement: Measurement object containing range of character widths required to render the object.
|
|
94
|
-
"""
|
|
95
|
-
_max_width = options.max_width
|
|
96
|
-
if _max_width < 1:
|
|
97
|
-
return Measurement(0, 0)
|
|
98
|
-
if isinstance(renderable, str):
|
|
99
|
-
renderable = console.render_str(
|
|
100
|
-
renderable, markup=options.markup, highlight=False
|
|
101
|
-
)
|
|
102
|
-
renderable = rich_cast(renderable)
|
|
103
|
-
if is_renderable(renderable):
|
|
104
|
-
get_console_width: Optional[
|
|
105
|
-
Callable[["Console", "ConsoleOptions"], "Measurement"]
|
|
106
|
-
] = getattr(renderable, "__rich_measure__", None)
|
|
107
|
-
if get_console_width is not None:
|
|
108
|
-
render_width = (
|
|
109
|
-
get_console_width(console, options)
|
|
110
|
-
.normalize()
|
|
111
|
-
.with_maximum(_max_width)
|
|
112
|
-
)
|
|
113
|
-
if render_width.maximum < 1:
|
|
114
|
-
return Measurement(0, 0)
|
|
115
|
-
return render_width.normalize()
|
|
116
|
-
else:
|
|
117
|
-
return Measurement(0, _max_width)
|
|
118
|
-
else:
|
|
119
|
-
raise errors.NotRenderableError(
|
|
120
|
-
f"Unable to get render width for {renderable!r}; "
|
|
121
|
-
"a str, Segment, or object with __rich_console__ method is required"
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
def measure_renderables(
|
|
126
|
-
console: "Console",
|
|
127
|
-
options: "ConsoleOptions",
|
|
128
|
-
renderables: Sequence["RenderableType"],
|
|
129
|
-
) -> "Measurement":
|
|
130
|
-
"""Get a measurement that would fit a number of renderables.
|
|
131
|
-
|
|
132
|
-
Args:
|
|
133
|
-
console (~rich.console.Console): Console instance.
|
|
134
|
-
options (~rich.console.ConsoleOptions): Console options.
|
|
135
|
-
renderables (Iterable[RenderableType]): One or more renderable objects.
|
|
136
|
-
|
|
137
|
-
Returns:
|
|
138
|
-
Measurement: Measurement object containing range of character widths required to
|
|
139
|
-
contain all given renderables.
|
|
140
|
-
"""
|
|
141
|
-
if not renderables:
|
|
142
|
-
return Measurement(0, 0)
|
|
143
|
-
get_measurement = Measurement.get
|
|
144
|
-
measurements = [
|
|
145
|
-
get_measurement(console, options, renderable) for renderable in renderables
|
|
146
|
-
]
|
|
147
|
-
measured_width = Measurement(
|
|
148
|
-
max(measurements, key=itemgetter(0)).minimum,
|
|
149
|
-
max(measurements, key=itemgetter(1)).maximum,
|
|
150
|
-
)
|
|
151
|
-
return measured_width
|