How to use the demoji._CODE_TO_DESC function in demoji

To help you get started, weโ€™ve selected a few demoji examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bsolomon1124 / demoji / tests / test_demoji.py View on Github external
def test_download():
    assert demoji.download_codes() is None
    assert type(demoji._EMOJI_PAT) == type(re.compile(""))  # noqa
    assert isinstance(demoji._CODE_TO_DESC, dict)
    assert os.path.isfile(demoji.CACHEPATH)
github DiscordWebsite / discord_logview / django_logs / formatter.py View on Github external
def process_unicode_emojis(m):
        e = m.group()
        e = re.sub(r'[\U0000FE00-\U0000FE0F]$', '', e)
        title_e = re.sub(r'[\U0001F3FB-\U0001F3FF]$', '', e)
        if not title_e:
            title_e = e
        title = UNICODE_LIST.get(title_e) or demoji._CODE_TO_DESC[title_e]
        codepoint = "-".join(['%04x' % ord(_c) for _c in e]).lstrip('0')
        return fr'<img alt="{e}" title=":{title}:" class="emoji">'