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 erddlmZmZmZ ed ZG d
d deZG dd deZedkr8d dl Z d dlmZ d dlmZ eddZedd ee D ddZe e e!e j"dkr8e#e j"d dS ) N)
TYPE_CHECKINGOptionalUnion )JupyterMixin)Segment)Style)EMOJI_emoji_replace) )Literal)ConsoleConsoleOptionsRenderResult)emojitextc @ 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 ZddddgZdddZdeeeef ee d d
ddZ
eeed
ddZedddZ
edddZddddddZd S )Emojinamestyle_charvariantu ︎u ️)r r noneN)r r r returnc C sh || _ || _|| _zt| | _W n" tk
rB td|Y nX |dk rd| j| j|d7 _dS )zA 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 VARIANTSget)selfr r r r r r __init__ s zEmoji.__init__)r r! c C s t |S )zReplace 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 dS )Nz