2026-1-6
This commit is contained in:
36
venv/Lib/site-packages/emoji/unicode_codes/__init__.py
Normal file
36
venv/Lib/site-packages/emoji/unicode_codes/__init__.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from emoji.unicode_codes.data_dict import *
|
||||
|
||||
__all__ = [
|
||||
'get_emoji_unicode_dict', 'get_aliases_unicode_dict',
|
||||
'EMOJI_DATA', 'STATUS', 'LANGUAGES'
|
||||
]
|
||||
|
||||
|
||||
_EMOJI_UNICODE = {lang: None for lang in LANGUAGES} # Cache for the language dicts
|
||||
|
||||
_ALIASES_UNICODE = {} # Cache for the aliases dict
|
||||
|
||||
|
||||
def get_emoji_unicode_dict(lang):
|
||||
"""Generate dict containing all fully-qualified and component emoji name for a language
|
||||
The dict is only generated once per language and then cached in _EMOJI_UNICODE[lang]"""
|
||||
|
||||
if _EMOJI_UNICODE[lang] is None:
|
||||
_EMOJI_UNICODE[lang] = {data[lang]: emj for emj, data in EMOJI_DATA.items()
|
||||
if lang in data and data['status'] <= STATUS['fully_qualified']}
|
||||
|
||||
return _EMOJI_UNICODE[lang]
|
||||
|
||||
|
||||
def get_aliases_unicode_dict():
|
||||
"""Generate dict containing all fully-qualified and component aliases
|
||||
The dict is only generated once and then cached in _ALIASES_UNICODE"""
|
||||
|
||||
if not _ALIASES_UNICODE:
|
||||
_ALIASES_UNICODE.update(get_emoji_unicode_dict('en'))
|
||||
for emj, data in EMOJI_DATA.items():
|
||||
if 'alias' in data and data['status'] <= STATUS['fully_qualified']:
|
||||
for alias in data['alias']:
|
||||
_ALIASES_UNICODE[alias] = emj
|
||||
|
||||
return _ALIASES_UNICODE
|
||||
6
venv/Lib/site-packages/emoji/unicode_codes/__init__.pyi
Normal file
6
venv/Lib/site-packages/emoji/unicode_codes/__init__.pyi
Normal file
@@ -0,0 +1,6 @@
|
||||
from .data_dict import *
|
||||
|
||||
__all__ = ["get_emoji_unicode_dict", "get_aliases_unicode_dict", "EMOJI_DATA", "STATUS", "LANGUAGES"]
|
||||
|
||||
def get_emoji_unicode_dict(lang: str) -> dict[str, str]: ...
|
||||
def get_aliases_unicode_dict() -> dict[str, str]: ...
|
||||
Binary file not shown.
Binary file not shown.
86978
venv/Lib/site-packages/emoji/unicode_codes/data_dict.py
Normal file
86978
venv/Lib/site-packages/emoji/unicode_codes/data_dict.py
Normal file
File diff suppressed because it is too large
Load Diff
7
venv/Lib/site-packages/emoji/unicode_codes/data_dict.pyi
Normal file
7
venv/Lib/site-packages/emoji/unicode_codes/data_dict.pyi
Normal file
@@ -0,0 +1,7 @@
|
||||
from typing import Any
|
||||
|
||||
__all__ = ["EMOJI_DATA", "STATUS", "LANGUAGES"]
|
||||
|
||||
STATUS: dict[str, int]
|
||||
LANGUAGES: list[str]
|
||||
EMOJI_DATA: dict[str, dict[str, Any]]
|
||||
0
venv/Lib/site-packages/emoji/unicode_codes/py.typed
Normal file
0
venv/Lib/site-packages/emoji/unicode_codes/py.typed
Normal file
Reference in New Issue
Block a user