Загрузить файлы в «venv/Lib/site-packages/pip/_vendor/rich»
This commit is contained in:
177
venv/Lib/site-packages/pip/_vendor/rich/__init__.py
Normal file
177
venv/Lib/site-packages/pip/_vendor/rich/__init__.py
Normal file
@@ -0,0 +1,177 @@
|
||||
"""Rich text and beautiful formatting in the terminal."""
|
||||
|
||||
import os
|
||||
from typing import IO, TYPE_CHECKING, Any, Callable, Optional, Union
|
||||
|
||||
from ._extension import load_ipython_extension # noqa: F401
|
||||
|
||||
__all__ = ["get_console", "reconfigure", "print", "inspect", "print_json"]
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .console import Console
|
||||
|
||||
# Global console used by alternative print
|
||||
_console: Optional["Console"] = None
|
||||
|
||||
try:
|
||||
_IMPORT_CWD = os.path.abspath(os.getcwd())
|
||||
except FileNotFoundError:
|
||||
# Can happen if the cwd has been deleted
|
||||
_IMPORT_CWD = ""
|
||||
|
||||
|
||||
def get_console() -> "Console":
|
||||
"""Get a global :class:`~rich.console.Console` instance. This function is used when Rich requires a Console,
|
||||
and hasn't been explicitly given one.
|
||||
|
||||
Returns:
|
||||
Console: A console instance.
|
||||
"""
|
||||
global _console
|
||||
if _console is None:
|
||||
from .console import Console
|
||||
|
||||
_console = Console()
|
||||
|
||||
return _console
|
||||
|
||||
|
||||
def reconfigure(*args: Any, **kwargs: Any) -> None:
|
||||
"""Reconfigures the global console by replacing it with another.
|
||||
|
||||
Args:
|
||||
*args (Any): Positional arguments for the replacement :class:`~rich.console.Console`.
|
||||
**kwargs (Any): Keyword arguments for the replacement :class:`~rich.console.Console`.
|
||||
"""
|
||||
from pip._vendor.rich.console import Console
|
||||
|
||||
new_console = Console(*args, **kwargs)
|
||||
_console = get_console()
|
||||
_console.__dict__ = new_console.__dict__
|
||||
|
||||
|
||||
def print(
|
||||
*objects: Any,
|
||||
sep: str = " ",
|
||||
end: str = "\n",
|
||||
file: Optional[IO[str]] = None,
|
||||
flush: bool = False,
|
||||
) -> None:
|
||||
r"""Print object(s) supplied via positional arguments.
|
||||
This function has an identical signature to the built-in print.
|
||||
For more advanced features, see the :class:`~rich.console.Console` class.
|
||||
|
||||
Args:
|
||||
sep (str, optional): Separator between printed objects. Defaults to " ".
|
||||
end (str, optional): Character to write at end of output. Defaults to "\\n".
|
||||
file (IO[str], optional): File to write to, or None for stdout. Defaults to None.
|
||||
flush (bool, optional): Has no effect as Rich always flushes output. Defaults to False.
|
||||
|
||||
"""
|
||||
from .console import Console
|
||||
|
||||
write_console = get_console() if file is None else Console(file=file)
|
||||
return write_console.print(*objects, sep=sep, end=end)
|
||||
|
||||
|
||||
def print_json(
|
||||
json: Optional[str] = None,
|
||||
*,
|
||||
data: Any = None,
|
||||
indent: Union[None, int, str] = 2,
|
||||
highlight: bool = True,
|
||||
skip_keys: bool = False,
|
||||
ensure_ascii: bool = False,
|
||||
check_circular: bool = True,
|
||||
allow_nan: bool = True,
|
||||
default: Optional[Callable[[Any], Any]] = None,
|
||||
sort_keys: bool = False,
|
||||
) -> None:
|
||||
"""Pretty prints JSON. Output will be valid JSON.
|
||||
|
||||
Args:
|
||||
json (str): A string containing JSON.
|
||||
data (Any): If json is not supplied, then encode this data.
|
||||
indent (int, optional): Number of spaces to indent. Defaults to 2.
|
||||
highlight (bool, optional): Enable highlighting of output: Defaults to True.
|
||||
skip_keys (bool, optional): Skip keys not of a basic type. Defaults to False.
|
||||
ensure_ascii (bool, optional): Escape all non-ascii characters. Defaults to False.
|
||||
check_circular (bool, optional): Check for circular references. Defaults to True.
|
||||
allow_nan (bool, optional): Allow NaN and Infinity values. Defaults to True.
|
||||
default (Callable, optional): A callable that converts values that can not be encoded
|
||||
in to something that can be JSON encoded. Defaults to None.
|
||||
sort_keys (bool, optional): Sort dictionary keys. Defaults to False.
|
||||
"""
|
||||
|
||||
get_console().print_json(
|
||||
json,
|
||||
data=data,
|
||||
indent=indent,
|
||||
highlight=highlight,
|
||||
skip_keys=skip_keys,
|
||||
ensure_ascii=ensure_ascii,
|
||||
check_circular=check_circular,
|
||||
allow_nan=allow_nan,
|
||||
default=default,
|
||||
sort_keys=sort_keys,
|
||||
)
|
||||
|
||||
|
||||
def inspect(
|
||||
obj: Any,
|
||||
*,
|
||||
console: Optional["Console"] = None,
|
||||
title: Optional[str] = None,
|
||||
help: bool = False,
|
||||
methods: bool = False,
|
||||
docs: bool = True,
|
||||
private: bool = False,
|
||||
dunder: bool = False,
|
||||
sort: bool = True,
|
||||
all: bool = False,
|
||||
value: bool = True,
|
||||
) -> None:
|
||||
"""Inspect any Python object.
|
||||
|
||||
* inspect(<OBJECT>) to see summarized info.
|
||||
* inspect(<OBJECT>, methods=True) to see methods.
|
||||
* inspect(<OBJECT>, help=True) to see full (non-abbreviated) help.
|
||||
* inspect(<OBJECT>, private=True) to see private attributes (single underscore).
|
||||
* inspect(<OBJECT>, dunder=True) to see attributes beginning with double underscore.
|
||||
* inspect(<OBJECT>, all=True) to see all attributes.
|
||||
|
||||
Args:
|
||||
obj (Any): An object to inspect.
|
||||
title (str, optional): Title to display over inspect result, or None use type. Defaults to None.
|
||||
help (bool, optional): Show full help text rather than just first paragraph. Defaults to False.
|
||||
methods (bool, optional): Enable inspection of callables. Defaults to False.
|
||||
docs (bool, optional): Also render doc strings. Defaults to True.
|
||||
private (bool, optional): Show private attributes (beginning with underscore). Defaults to False.
|
||||
dunder (bool, optional): Show attributes starting with double underscore. Defaults to False.
|
||||
sort (bool, optional): Sort attributes alphabetically. Defaults to True.
|
||||
all (bool, optional): Show all attributes. Defaults to False.
|
||||
value (bool, optional): Pretty print value. Defaults to True.
|
||||
"""
|
||||
_console = console or get_console()
|
||||
from pip._vendor.rich._inspect import Inspect
|
||||
|
||||
# Special case for inspect(inspect)
|
||||
is_inspect = obj is inspect
|
||||
|
||||
_inspect = Inspect(
|
||||
obj,
|
||||
title=title,
|
||||
help=is_inspect or help,
|
||||
methods=is_inspect or methods,
|
||||
docs=is_inspect or docs,
|
||||
private=private,
|
||||
dunder=dunder,
|
||||
sort=sort,
|
||||
all=all,
|
||||
value=value,
|
||||
)
|
||||
_console.print(_inspect)
|
||||
|
||||
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
print("Hello, **World**")
|
||||
245
venv/Lib/site-packages/pip/_vendor/rich/__main__.py
Normal file
245
venv/Lib/site-packages/pip/_vendor/rich/__main__.py
Normal file
@@ -0,0 +1,245 @@
|
||||
import colorsys
|
||||
import io
|
||||
from time import process_time
|
||||
|
||||
from pip._vendor.rich import box
|
||||
from pip._vendor.rich.color import Color
|
||||
from pip._vendor.rich.console import Console, ConsoleOptions, Group, RenderableType, RenderResult
|
||||
from pip._vendor.rich.markdown import Markdown
|
||||
from pip._vendor.rich.measure import Measurement
|
||||
from pip._vendor.rich.pretty import Pretty
|
||||
from pip._vendor.rich.segment import Segment
|
||||
from pip._vendor.rich.style import Style
|
||||
from pip._vendor.rich.syntax import Syntax
|
||||
from pip._vendor.rich.table import Table
|
||||
from pip._vendor.rich.text import Text
|
||||
|
||||
|
||||
class ColorBox:
|
||||
def __rich_console__(
|
||||
self, console: Console, options: ConsoleOptions
|
||||
) -> RenderResult:
|
||||
for y in range(0, 5):
|
||||
for x in range(options.max_width):
|
||||
h = x / options.max_width
|
||||
l = 0.1 + ((y / 5) * 0.7)
|
||||
r1, g1, b1 = colorsys.hls_to_rgb(h, l, 1.0)
|
||||
r2, g2, b2 = colorsys.hls_to_rgb(h, l + 0.7 / 10, 1.0)
|
||||
bgcolor = Color.from_rgb(r1 * 255, g1 * 255, b1 * 255)
|
||||
color = Color.from_rgb(r2 * 255, g2 * 255, b2 * 255)
|
||||
yield Segment("▄", Style(color=color, bgcolor=bgcolor))
|
||||
yield Segment.line()
|
||||
|
||||
def __rich_measure__(
|
||||
self, console: "Console", options: ConsoleOptions
|
||||
) -> Measurement:
|
||||
return Measurement(1, options.max_width)
|
||||
|
||||
|
||||
def make_test_card() -> Table:
|
||||
"""Get a renderable that demonstrates a number of features."""
|
||||
table = Table.grid(padding=1, pad_edge=True)
|
||||
table.title = "Rich features"
|
||||
table.add_column("Feature", no_wrap=True, justify="center", style="bold red")
|
||||
table.add_column("Demonstration")
|
||||
|
||||
color_table = Table(
|
||||
box=None,
|
||||
expand=False,
|
||||
show_header=False,
|
||||
show_edge=False,
|
||||
pad_edge=False,
|
||||
)
|
||||
color_table.add_row(
|
||||
(
|
||||
"✓ [bold green]4-bit color[/]\n"
|
||||
"✓ [bold blue]8-bit color[/]\n"
|
||||
"✓ [bold magenta]Truecolor (16.7 million)[/]\n"
|
||||
"✓ [bold yellow]Dumb terminals[/]\n"
|
||||
"✓ [bold cyan]Automatic color conversion"
|
||||
),
|
||||
ColorBox(),
|
||||
)
|
||||
|
||||
table.add_row("Colors", color_table)
|
||||
|
||||
table.add_row(
|
||||
"Styles",
|
||||
"All ansi styles: [bold]bold[/], [dim]dim[/], [italic]italic[/italic], [underline]underline[/], [strike]strikethrough[/], [reverse]reverse[/], and even [blink]blink[/].",
|
||||
)
|
||||
|
||||
lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque in metus sed sapien ultricies pretium a at justo. Maecenas luctus velit et auctor maximus."
|
||||
lorem_table = Table.grid(padding=1, collapse_padding=True)
|
||||
lorem_table.pad_edge = False
|
||||
lorem_table.add_row(
|
||||
Text(lorem, justify="left", style="green"),
|
||||
Text(lorem, justify="center", style="yellow"),
|
||||
Text(lorem, justify="right", style="blue"),
|
||||
Text(lorem, justify="full", style="red"),
|
||||
)
|
||||
table.add_row(
|
||||
"Text",
|
||||
Group(
|
||||
Text.from_markup(
|
||||
"""Word wrap text. Justify [green]left[/], [yellow]center[/], [blue]right[/] or [red]full[/].\n"""
|
||||
),
|
||||
lorem_table,
|
||||
),
|
||||
)
|
||||
|
||||
def comparison(renderable1: RenderableType, renderable2: RenderableType) -> Table:
|
||||
table = Table(show_header=False, pad_edge=False, box=None, expand=True)
|
||||
table.add_column("1", ratio=1)
|
||||
table.add_column("2", ratio=1)
|
||||
table.add_row(renderable1, renderable2)
|
||||
return table
|
||||
|
||||
table.add_row(
|
||||
"Asian\nlanguage\nsupport",
|
||||
":flag_for_china: 该库支持中文,日文和韩文文本!\n:flag_for_japan: ライブラリは中国語、日本語、韓国語のテキストをサポートしています\n:flag_for_south_korea: 이 라이브러리는 중국어, 일본어 및 한국어 텍스트를 지원합니다",
|
||||
)
|
||||
|
||||
markup_example = (
|
||||
"[bold magenta]Rich[/] supports a simple [i]bbcode[/i]-like [b]markup[/b] for [yellow]color[/], [underline]style[/], and emoji! "
|
||||
":+1: :apple: :ant: :bear: :baguette_bread: :bus: "
|
||||
)
|
||||
table.add_row("Markup", markup_example)
|
||||
|
||||
example_table = Table(
|
||||
show_edge=False,
|
||||
show_header=True,
|
||||
expand=False,
|
||||
row_styles=["none", "dim"],
|
||||
box=box.SIMPLE,
|
||||
)
|
||||
example_table.add_column("[green]Date", style="green", no_wrap=True)
|
||||
example_table.add_column("[blue]Title", style="blue")
|
||||
example_table.add_column(
|
||||
"[cyan]Production Budget",
|
||||
style="cyan",
|
||||
justify="right",
|
||||
no_wrap=True,
|
||||
)
|
||||
example_table.add_column(
|
||||
"[magenta]Box Office",
|
||||
style="magenta",
|
||||
justify="right",
|
||||
no_wrap=True,
|
||||
)
|
||||
example_table.add_row(
|
||||
"Dec 20, 2019",
|
||||
"Star Wars: The Rise of Skywalker",
|
||||
"$275,000,000",
|
||||
"$375,126,118",
|
||||
)
|
||||
example_table.add_row(
|
||||
"May 25, 2018",
|
||||
"[b]Solo[/]: A Star Wars Story",
|
||||
"$275,000,000",
|
||||
"$393,151,347",
|
||||
)
|
||||
example_table.add_row(
|
||||
"Dec 15, 2017",
|
||||
"Star Wars Ep. VIII: The Last Jedi",
|
||||
"$262,000,000",
|
||||
"[bold]$1,332,539,889[/bold]",
|
||||
)
|
||||
example_table.add_row(
|
||||
"May 19, 1999",
|
||||
"Star Wars Ep. [b]I[/b]: [i]The phantom Menace",
|
||||
"$115,000,000",
|
||||
"$1,027,044,677",
|
||||
)
|
||||
|
||||
table.add_row("Tables", example_table)
|
||||
|
||||
code = '''\
|
||||
def iter_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
|
||||
"""Iterate and generate a tuple with a flag for last value."""
|
||||
iter_values = iter(values)
|
||||
try:
|
||||
previous_value = next(iter_values)
|
||||
except StopIteration:
|
||||
return
|
||||
for value in iter_values:
|
||||
yield False, previous_value
|
||||
previous_value = value
|
||||
yield True, previous_value'''
|
||||
|
||||
pretty_data = {
|
||||
"foo": [
|
||||
3.1427,
|
||||
(
|
||||
"Paul Atreides",
|
||||
"Vladimir Harkonnen",
|
||||
"Thufir Hawat",
|
||||
),
|
||||
],
|
||||
"atomic": (False, True, None),
|
||||
}
|
||||
table.add_row(
|
||||
"Syntax\nhighlighting\n&\npretty\nprinting",
|
||||
comparison(
|
||||
Syntax(code, "python3", line_numbers=True, indent_guides=True),
|
||||
Pretty(pretty_data, indent_guides=True),
|
||||
),
|
||||
)
|
||||
|
||||
markdown_example = """\
|
||||
# Markdown
|
||||
|
||||
Supports much of the *markdown* __syntax__!
|
||||
|
||||
- Headers
|
||||
- Basic formatting: **bold**, *italic*, `code`
|
||||
- Block quotes
|
||||
- Lists, and more...
|
||||
"""
|
||||
table.add_row(
|
||||
"Markdown", comparison("[cyan]" + markdown_example, Markdown(markdown_example))
|
||||
)
|
||||
|
||||
table.add_row(
|
||||
"+more!",
|
||||
"""Progress bars, columns, styled logging handler, tracebacks, etc...""",
|
||||
)
|
||||
return table
|
||||
|
||||
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
from pip._vendor.rich.panel import Panel
|
||||
|
||||
console = Console(
|
||||
file=io.StringIO(),
|
||||
force_terminal=True,
|
||||
)
|
||||
test_card = make_test_card()
|
||||
|
||||
# Print once to warm cache
|
||||
start = process_time()
|
||||
console.print(test_card)
|
||||
pre_cache_taken = round((process_time() - start) * 1000.0, 1)
|
||||
|
||||
console.file = io.StringIO()
|
||||
|
||||
start = process_time()
|
||||
console.print(test_card)
|
||||
taken = round((process_time() - start) * 1000.0, 1)
|
||||
|
||||
c = Console(record=True)
|
||||
c.print(test_card)
|
||||
|
||||
console = Console()
|
||||
console.print(f"[dim]rendered in [not dim]{pre_cache_taken}ms[/] (cold cache)")
|
||||
console.print(f"[dim]rendered in [not dim]{taken}ms[/] (warm cache)")
|
||||
console.print()
|
||||
console.print(
|
||||
Panel.fit(
|
||||
"[b magenta]Hope you enjoy using Rich![/]\n\n"
|
||||
"Please consider sponsoring me if you get value from my work.\n\n"
|
||||
"Even the price of a ☕ can brighten my day!\n\n"
|
||||
"https://github.com/sponsors/willmcgugan",
|
||||
border_style="red",
|
||||
title="Help ensure Rich is maintained",
|
||||
)
|
||||
)
|
||||
454
venv/Lib/site-packages/pip/_vendor/rich/_cell_widths.py
Normal file
454
venv/Lib/site-packages/pip/_vendor/rich/_cell_widths.py
Normal file
@@ -0,0 +1,454 @@
|
||||
# Auto generated by make_terminal_widths.py
|
||||
|
||||
CELL_WIDTHS = [
|
||||
(0, 0, 0),
|
||||
(1, 31, -1),
|
||||
(127, 159, -1),
|
||||
(173, 173, 0),
|
||||
(768, 879, 0),
|
||||
(1155, 1161, 0),
|
||||
(1425, 1469, 0),
|
||||
(1471, 1471, 0),
|
||||
(1473, 1474, 0),
|
||||
(1476, 1477, 0),
|
||||
(1479, 1479, 0),
|
||||
(1536, 1541, 0),
|
||||
(1552, 1562, 0),
|
||||
(1564, 1564, 0),
|
||||
(1611, 1631, 0),
|
||||
(1648, 1648, 0),
|
||||
(1750, 1757, 0),
|
||||
(1759, 1764, 0),
|
||||
(1767, 1768, 0),
|
||||
(1770, 1773, 0),
|
||||
(1807, 1807, 0),
|
||||
(1809, 1809, 0),
|
||||
(1840, 1866, 0),
|
||||
(1958, 1968, 0),
|
||||
(2027, 2035, 0),
|
||||
(2045, 2045, 0),
|
||||
(2070, 2073, 0),
|
||||
(2075, 2083, 0),
|
||||
(2085, 2087, 0),
|
||||
(2089, 2093, 0),
|
||||
(2137, 2139, 0),
|
||||
(2192, 2193, 0),
|
||||
(2200, 2207, 0),
|
||||
(2250, 2307, 0),
|
||||
(2362, 2364, 0),
|
||||
(2366, 2383, 0),
|
||||
(2385, 2391, 0),
|
||||
(2402, 2403, 0),
|
||||
(2433, 2435, 0),
|
||||
(2492, 2492, 0),
|
||||
(2494, 2500, 0),
|
||||
(2503, 2504, 0),
|
||||
(2507, 2509, 0),
|
||||
(2519, 2519, 0),
|
||||
(2530, 2531, 0),
|
||||
(2558, 2558, 0),
|
||||
(2561, 2563, 0),
|
||||
(2620, 2620, 0),
|
||||
(2622, 2626, 0),
|
||||
(2631, 2632, 0),
|
||||
(2635, 2637, 0),
|
||||
(2641, 2641, 0),
|
||||
(2672, 2673, 0),
|
||||
(2677, 2677, 0),
|
||||
(2689, 2691, 0),
|
||||
(2748, 2748, 0),
|
||||
(2750, 2757, 0),
|
||||
(2759, 2761, 0),
|
||||
(2763, 2765, 0),
|
||||
(2786, 2787, 0),
|
||||
(2810, 2815, 0),
|
||||
(2817, 2819, 0),
|
||||
(2876, 2876, 0),
|
||||
(2878, 2884, 0),
|
||||
(2887, 2888, 0),
|
||||
(2891, 2893, 0),
|
||||
(2901, 2903, 0),
|
||||
(2914, 2915, 0),
|
||||
(2946, 2946, 0),
|
||||
(3006, 3010, 0),
|
||||
(3014, 3016, 0),
|
||||
(3018, 3021, 0),
|
||||
(3031, 3031, 0),
|
||||
(3072, 3076, 0),
|
||||
(3132, 3132, 0),
|
||||
(3134, 3140, 0),
|
||||
(3142, 3144, 0),
|
||||
(3146, 3149, 0),
|
||||
(3157, 3158, 0),
|
||||
(3170, 3171, 0),
|
||||
(3201, 3203, 0),
|
||||
(3260, 3260, 0),
|
||||
(3262, 3268, 0),
|
||||
(3270, 3272, 0),
|
||||
(3274, 3277, 0),
|
||||
(3285, 3286, 0),
|
||||
(3298, 3299, 0),
|
||||
(3315, 3315, 0),
|
||||
(3328, 3331, 0),
|
||||
(3387, 3388, 0),
|
||||
(3390, 3396, 0),
|
||||
(3398, 3400, 0),
|
||||
(3402, 3405, 0),
|
||||
(3415, 3415, 0),
|
||||
(3426, 3427, 0),
|
||||
(3457, 3459, 0),
|
||||
(3530, 3530, 0),
|
||||
(3535, 3540, 0),
|
||||
(3542, 3542, 0),
|
||||
(3544, 3551, 0),
|
||||
(3570, 3571, 0),
|
||||
(3633, 3633, 0),
|
||||
(3636, 3642, 0),
|
||||
(3655, 3662, 0),
|
||||
(3761, 3761, 0),
|
||||
(3764, 3772, 0),
|
||||
(3784, 3790, 0),
|
||||
(3864, 3865, 0),
|
||||
(3893, 3893, 0),
|
||||
(3895, 3895, 0),
|
||||
(3897, 3897, 0),
|
||||
(3902, 3903, 0),
|
||||
(3953, 3972, 0),
|
||||
(3974, 3975, 0),
|
||||
(3981, 3991, 0),
|
||||
(3993, 4028, 0),
|
||||
(4038, 4038, 0),
|
||||
(4139, 4158, 0),
|
||||
(4182, 4185, 0),
|
||||
(4190, 4192, 0),
|
||||
(4194, 4196, 0),
|
||||
(4199, 4205, 0),
|
||||
(4209, 4212, 0),
|
||||
(4226, 4237, 0),
|
||||
(4239, 4239, 0),
|
||||
(4250, 4253, 0),
|
||||
(4352, 4447, 2),
|
||||
(4448, 4607, 0),
|
||||
(4957, 4959, 0),
|
||||
(5906, 5909, 0),
|
||||
(5938, 5940, 0),
|
||||
(5970, 5971, 0),
|
||||
(6002, 6003, 0),
|
||||
(6068, 6099, 0),
|
||||
(6109, 6109, 0),
|
||||
(6155, 6159, 0),
|
||||
(6277, 6278, 0),
|
||||
(6313, 6313, 0),
|
||||
(6432, 6443, 0),
|
||||
(6448, 6459, 0),
|
||||
(6679, 6683, 0),
|
||||
(6741, 6750, 0),
|
||||
(6752, 6780, 0),
|
||||
(6783, 6783, 0),
|
||||
(6832, 6862, 0),
|
||||
(6912, 6916, 0),
|
||||
(6964, 6980, 0),
|
||||
(7019, 7027, 0),
|
||||
(7040, 7042, 0),
|
||||
(7073, 7085, 0),
|
||||
(7142, 7155, 0),
|
||||
(7204, 7223, 0),
|
||||
(7376, 7378, 0),
|
||||
(7380, 7400, 0),
|
||||
(7405, 7405, 0),
|
||||
(7412, 7412, 0),
|
||||
(7415, 7417, 0),
|
||||
(7616, 7679, 0),
|
||||
(8203, 8207, 0),
|
||||
(8232, 8238, 0),
|
||||
(8288, 8292, 0),
|
||||
(8294, 8303, 0),
|
||||
(8400, 8432, 0),
|
||||
(8986, 8987, 2),
|
||||
(9001, 9002, 2),
|
||||
(9193, 9196, 2),
|
||||
(9200, 9200, 2),
|
||||
(9203, 9203, 2),
|
||||
(9725, 9726, 2),
|
||||
(9748, 9749, 2),
|
||||
(9800, 9811, 2),
|
||||
(9855, 9855, 2),
|
||||
(9875, 9875, 2),
|
||||
(9889, 9889, 2),
|
||||
(9898, 9899, 2),
|
||||
(9917, 9918, 2),
|
||||
(9924, 9925, 2),
|
||||
(9934, 9934, 2),
|
||||
(9940, 9940, 2),
|
||||
(9962, 9962, 2),
|
||||
(9970, 9971, 2),
|
||||
(9973, 9973, 2),
|
||||
(9978, 9978, 2),
|
||||
(9981, 9981, 2),
|
||||
(9989, 9989, 2),
|
||||
(9994, 9995, 2),
|
||||
(10024, 10024, 2),
|
||||
(10060, 10060, 2),
|
||||
(10062, 10062, 2),
|
||||
(10067, 10069, 2),
|
||||
(10071, 10071, 2),
|
||||
(10133, 10135, 2),
|
||||
(10160, 10160, 2),
|
||||
(10175, 10175, 2),
|
||||
(11035, 11036, 2),
|
||||
(11088, 11088, 2),
|
||||
(11093, 11093, 2),
|
||||
(11503, 11505, 0),
|
||||
(11647, 11647, 0),
|
||||
(11744, 11775, 0),
|
||||
(11904, 11929, 2),
|
||||
(11931, 12019, 2),
|
||||
(12032, 12245, 2),
|
||||
(12272, 12329, 2),
|
||||
(12330, 12335, 0),
|
||||
(12336, 12350, 2),
|
||||
(12353, 12438, 2),
|
||||
(12441, 12442, 0),
|
||||
(12443, 12543, 2),
|
||||
(12549, 12591, 2),
|
||||
(12593, 12686, 2),
|
||||
(12688, 12771, 2),
|
||||
(12783, 12830, 2),
|
||||
(12832, 12871, 2),
|
||||
(12880, 19903, 2),
|
||||
(19968, 42124, 2),
|
||||
(42128, 42182, 2),
|
||||
(42607, 42610, 0),
|
||||
(42612, 42621, 0),
|
||||
(42654, 42655, 0),
|
||||
(42736, 42737, 0),
|
||||
(43010, 43010, 0),
|
||||
(43014, 43014, 0),
|
||||
(43019, 43019, 0),
|
||||
(43043, 43047, 0),
|
||||
(43052, 43052, 0),
|
||||
(43136, 43137, 0),
|
||||
(43188, 43205, 0),
|
||||
(43232, 43249, 0),
|
||||
(43263, 43263, 0),
|
||||
(43302, 43309, 0),
|
||||
(43335, 43347, 0),
|
||||
(43360, 43388, 2),
|
||||
(43392, 43395, 0),
|
||||
(43443, 43456, 0),
|
||||
(43493, 43493, 0),
|
||||
(43561, 43574, 0),
|
||||
(43587, 43587, 0),
|
||||
(43596, 43597, 0),
|
||||
(43643, 43645, 0),
|
||||
(43696, 43696, 0),
|
||||
(43698, 43700, 0),
|
||||
(43703, 43704, 0),
|
||||
(43710, 43711, 0),
|
||||
(43713, 43713, 0),
|
||||
(43755, 43759, 0),
|
||||
(43765, 43766, 0),
|
||||
(44003, 44010, 0),
|
||||
(44012, 44013, 0),
|
||||
(44032, 55203, 2),
|
||||
(55216, 55295, 0),
|
||||
(63744, 64255, 2),
|
||||
(64286, 64286, 0),
|
||||
(65024, 65039, 0),
|
||||
(65040, 65049, 2),
|
||||
(65056, 65071, 0),
|
||||
(65072, 65106, 2),
|
||||
(65108, 65126, 2),
|
||||
(65128, 65131, 2),
|
||||
(65279, 65279, 0),
|
||||
(65281, 65376, 2),
|
||||
(65504, 65510, 2),
|
||||
(65529, 65531, 0),
|
||||
(66045, 66045, 0),
|
||||
(66272, 66272, 0),
|
||||
(66422, 66426, 0),
|
||||
(68097, 68099, 0),
|
||||
(68101, 68102, 0),
|
||||
(68108, 68111, 0),
|
||||
(68152, 68154, 0),
|
||||
(68159, 68159, 0),
|
||||
(68325, 68326, 0),
|
||||
(68900, 68903, 0),
|
||||
(69291, 69292, 0),
|
||||
(69373, 69375, 0),
|
||||
(69446, 69456, 0),
|
||||
(69506, 69509, 0),
|
||||
(69632, 69634, 0),
|
||||
(69688, 69702, 0),
|
||||
(69744, 69744, 0),
|
||||
(69747, 69748, 0),
|
||||
(69759, 69762, 0),
|
||||
(69808, 69818, 0),
|
||||
(69821, 69821, 0),
|
||||
(69826, 69826, 0),
|
||||
(69837, 69837, 0),
|
||||
(69888, 69890, 0),
|
||||
(69927, 69940, 0),
|
||||
(69957, 69958, 0),
|
||||
(70003, 70003, 0),
|
||||
(70016, 70018, 0),
|
||||
(70067, 70080, 0),
|
||||
(70089, 70092, 0),
|
||||
(70094, 70095, 0),
|
||||
(70188, 70199, 0),
|
||||
(70206, 70206, 0),
|
||||
(70209, 70209, 0),
|
||||
(70367, 70378, 0),
|
||||
(70400, 70403, 0),
|
||||
(70459, 70460, 0),
|
||||
(70462, 70468, 0),
|
||||
(70471, 70472, 0),
|
||||
(70475, 70477, 0),
|
||||
(70487, 70487, 0),
|
||||
(70498, 70499, 0),
|
||||
(70502, 70508, 0),
|
||||
(70512, 70516, 0),
|
||||
(70709, 70726, 0),
|
||||
(70750, 70750, 0),
|
||||
(70832, 70851, 0),
|
||||
(71087, 71093, 0),
|
||||
(71096, 71104, 0),
|
||||
(71132, 71133, 0),
|
||||
(71216, 71232, 0),
|
||||
(71339, 71351, 0),
|
||||
(71453, 71467, 0),
|
||||
(71724, 71738, 0),
|
||||
(71984, 71989, 0),
|
||||
(71991, 71992, 0),
|
||||
(71995, 71998, 0),
|
||||
(72000, 72000, 0),
|
||||
(72002, 72003, 0),
|
||||
(72145, 72151, 0),
|
||||
(72154, 72160, 0),
|
||||
(72164, 72164, 0),
|
||||
(72193, 72202, 0),
|
||||
(72243, 72249, 0),
|
||||
(72251, 72254, 0),
|
||||
(72263, 72263, 0),
|
||||
(72273, 72283, 0),
|
||||
(72330, 72345, 0),
|
||||
(72751, 72758, 0),
|
||||
(72760, 72767, 0),
|
||||
(72850, 72871, 0),
|
||||
(72873, 72886, 0),
|
||||
(73009, 73014, 0),
|
||||
(73018, 73018, 0),
|
||||
(73020, 73021, 0),
|
||||
(73023, 73029, 0),
|
||||
(73031, 73031, 0),
|
||||
(73098, 73102, 0),
|
||||
(73104, 73105, 0),
|
||||
(73107, 73111, 0),
|
||||
(73459, 73462, 0),
|
||||
(73472, 73473, 0),
|
||||
(73475, 73475, 0),
|
||||
(73524, 73530, 0),
|
||||
(73534, 73538, 0),
|
||||
(78896, 78912, 0),
|
||||
(78919, 78933, 0),
|
||||
(92912, 92916, 0),
|
||||
(92976, 92982, 0),
|
||||
(94031, 94031, 0),
|
||||
(94033, 94087, 0),
|
||||
(94095, 94098, 0),
|
||||
(94176, 94179, 2),
|
||||
(94180, 94180, 0),
|
||||
(94192, 94193, 0),
|
||||
(94208, 100343, 2),
|
||||
(100352, 101589, 2),
|
||||
(101632, 101640, 2),
|
||||
(110576, 110579, 2),
|
||||
(110581, 110587, 2),
|
||||
(110589, 110590, 2),
|
||||
(110592, 110882, 2),
|
||||
(110898, 110898, 2),
|
||||
(110928, 110930, 2),
|
||||
(110933, 110933, 2),
|
||||
(110948, 110951, 2),
|
||||
(110960, 111355, 2),
|
||||
(113821, 113822, 0),
|
||||
(113824, 113827, 0),
|
||||
(118528, 118573, 0),
|
||||
(118576, 118598, 0),
|
||||
(119141, 119145, 0),
|
||||
(119149, 119170, 0),
|
||||
(119173, 119179, 0),
|
||||
(119210, 119213, 0),
|
||||
(119362, 119364, 0),
|
||||
(121344, 121398, 0),
|
||||
(121403, 121452, 0),
|
||||
(121461, 121461, 0),
|
||||
(121476, 121476, 0),
|
||||
(121499, 121503, 0),
|
||||
(121505, 121519, 0),
|
||||
(122880, 122886, 0),
|
||||
(122888, 122904, 0),
|
||||
(122907, 122913, 0),
|
||||
(122915, 122916, 0),
|
||||
(122918, 122922, 0),
|
||||
(123023, 123023, 0),
|
||||
(123184, 123190, 0),
|
||||
(123566, 123566, 0),
|
||||
(123628, 123631, 0),
|
||||
(124140, 124143, 0),
|
||||
(125136, 125142, 0),
|
||||
(125252, 125258, 0),
|
||||
(126980, 126980, 2),
|
||||
(127183, 127183, 2),
|
||||
(127374, 127374, 2),
|
||||
(127377, 127386, 2),
|
||||
(127488, 127490, 2),
|
||||
(127504, 127547, 2),
|
||||
(127552, 127560, 2),
|
||||
(127568, 127569, 2),
|
||||
(127584, 127589, 2),
|
||||
(127744, 127776, 2),
|
||||
(127789, 127797, 2),
|
||||
(127799, 127868, 2),
|
||||
(127870, 127891, 2),
|
||||
(127904, 127946, 2),
|
||||
(127951, 127955, 2),
|
||||
(127968, 127984, 2),
|
||||
(127988, 127988, 2),
|
||||
(127992, 127994, 2),
|
||||
(127995, 127999, 0),
|
||||
(128000, 128062, 2),
|
||||
(128064, 128064, 2),
|
||||
(128066, 128252, 2),
|
||||
(128255, 128317, 2),
|
||||
(128331, 128334, 2),
|
||||
(128336, 128359, 2),
|
||||
(128378, 128378, 2),
|
||||
(128405, 128406, 2),
|
||||
(128420, 128420, 2),
|
||||
(128507, 128591, 2),
|
||||
(128640, 128709, 2),
|
||||
(128716, 128716, 2),
|
||||
(128720, 128722, 2),
|
||||
(128725, 128727, 2),
|
||||
(128732, 128735, 2),
|
||||
(128747, 128748, 2),
|
||||
(128756, 128764, 2),
|
||||
(128992, 129003, 2),
|
||||
(129008, 129008, 2),
|
||||
(129292, 129338, 2),
|
||||
(129340, 129349, 2),
|
||||
(129351, 129535, 2),
|
||||
(129648, 129660, 2),
|
||||
(129664, 129672, 2),
|
||||
(129680, 129725, 2),
|
||||
(129727, 129733, 2),
|
||||
(129742, 129755, 2),
|
||||
(129760, 129768, 2),
|
||||
(129776, 129784, 2),
|
||||
(131072, 196605, 2),
|
||||
(196608, 262141, 2),
|
||||
(917505, 917505, 0),
|
||||
(917536, 917631, 0),
|
||||
(917760, 917999, 0),
|
||||
]
|
||||
3610
venv/Lib/site-packages/pip/_vendor/rich/_emoji_codes.py
Normal file
3610
venv/Lib/site-packages/pip/_vendor/rich/_emoji_codes.py
Normal file
File diff suppressed because it is too large
Load Diff
32
venv/Lib/site-packages/pip/_vendor/rich/_emoji_replace.py
Normal file
32
venv/Lib/site-packages/pip/_vendor/rich/_emoji_replace.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from typing import Callable, Match, Optional
|
||||
import re
|
||||
|
||||
from ._emoji_codes import EMOJI
|
||||
|
||||
|
||||
_ReStringMatch = Match[str] # regex match object
|
||||
_ReSubCallable = Callable[[_ReStringMatch], str] # Callable invoked by re.sub
|
||||
_EmojiSubMethod = Callable[[_ReSubCallable, str], str] # Sub method of a compiled re
|
||||
|
||||
|
||||
def _emoji_replace(
|
||||
text: str,
|
||||
default_variant: Optional[str] = None,
|
||||
_emoji_sub: _EmojiSubMethod = re.compile(r"(:(\S*?)(?:(?:\-)(emoji|text))?:)").sub,
|
||||
) -> str:
|
||||
"""Replace emoji code in text."""
|
||||
get_emoji = EMOJI.__getitem__
|
||||
variants = {"text": "\uFE0E", "emoji": "\uFE0F"}
|
||||
get_variant = variants.get
|
||||
default_variant_code = variants.get(default_variant, "") if default_variant else ""
|
||||
|
||||
def do_replace(match: Match[str]) -> str:
|
||||
emoji_code, emoji_name, variant = match.groups()
|
||||
try:
|
||||
return get_emoji(emoji_name.lower()) + get_variant(
|
||||
variant, default_variant_code
|
||||
)
|
||||
except KeyError:
|
||||
return emoji_code
|
||||
|
||||
return _emoji_sub(do_replace, text)
|
||||
Reference in New Issue
Block a user