Skip to content

Commit

Permalink
Hard-code emoji file rather than pulling
Browse files Browse the repository at this point in the history
  • Loading branch information
blackary committed Aug 23, 2023
1 parent 0347464 commit cf339d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/st_pages/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import json
from dataclasses import dataclass
from pathlib import Path

Expand All @@ -13,7 +14,6 @@ def _gather_metrics(name, func, *args, **kwargs):
return func


import requests
import streamlit as st
from streamlit.commands.page_config import get_random_emoji
from streamlit.errors import StreamlitAPIException
Expand Down Expand Up @@ -107,8 +107,8 @@ def _add_page_title(

@cache_resource
def get_icons() -> dict[str, str]:
url = "https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json"
return requests.get(url).json()
emoji_path = Path(__file__).parent / "emoji.json"
return json.loads(emoji_path.read_text())


def translate_icon(icon: str) -> str:
Expand Down
Loading

0 comments on commit cf339d9

Please sign in to comment.