Skip to content

Commit 19f21a2

Browse files
committed
check for emoji dir and print message about where to download if not exists
1 parent 43037f4 commit 19f21a2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

adafruit_display_emoji_text.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
"""
2626

2727
# imports
28+
import os
29+
2830
import adafruit_imageload
2931
import bitmaptools
3032
import displayio
@@ -81,6 +83,13 @@ def __init__(
8183
# ruff: noqa: PLR0912, PLR0915, PLR1702
8284
# Too many branches, Too many statements, Too many nested blocks
8385
):
86+
try:
87+
os.stat("emoji")
88+
except OSError:
89+
raise RuntimeError(
90+
"You need to download a set of emoji PNG files and place them CIRCUITPY/emoji/."
91+
" The recommended set is available for download here: https://emoji.serenityos.org/"
92+
)
8493
super().__init__(scale=scale)
8594
self.font = ascii_font
8695
self.ascii_palette = displayio.Palette(2)

0 commit comments

Comments
 (0)