XylotrechusZ
U
ʗRe� � @ s< d dl Z d dlmZmZmZ ddlmZ ddlmZ ddl m
Z
ddlmZ ddl
m
Z
e jd krpd d
lmZ nd d
lmZ er�ddlmZmZmZ ed ZG d
d� de�ZG dd� de�Zedk�r8d dl Z d dlmZ d dlmZ edd�Zedd� ee�� �D �dd�Ze� e� e!e j"�dk�r8e�#e j"d � dS )� N)�
TYPE_CHECKING�Optional�Union� )�JupyterMixin)�Segment)�Style)�EMOJI��_emoji_replace)� � )�Literal)�Console�ConsoleOptions�RenderResult)�emoji�textc @ s e Zd ZdZdS )�NoEmojizNo emoji by that name.N)�__name__�
__module__�__qualname__�__doc__� r r ��/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/rich/emoji.pyr s r c @ s� e Zd ZddddgZddd�Zdeeeef ee d d
�dd�Z
eeed
�dd��Zed�dd�Z
ed�dd�Zdddd�dd�Zd S )�Emoji�name�style�_char�variantu ︎u ️)r r �noneN)r r r �returnc C sh || _ || _|| _zt| | _W n" tk
rB td|����Y nX |dk rd| j| j�|d�7 _dS )z�A single emoji character.
Args:
name (str): Name of emoji.
style (Union[str, Style], optional): Optional style. Defaults to None.
Raises:
NoEmoji: If the emoji doesn't exist.
zNo emoji called N� ) r r r r r �KeyErrorr �VARIANTS�get)�selfr r r r r r �__init__ s zEmoji.__init__)r r! c C s t |�S )z�Replace emoji markup with corresponding unicode characters.
Args:
text (str): A string with emojis codes, e.g. "Hello :smiley:!"
Returns:
str: A string with emoji codes replaces with actual emoji.
r
)�clsr r r r �replace9 s
z
Emoji.replace)r! c C s d| j �d�S )Nz<emoji �>)r �r&