Skip to content

Commit

Permalink
use importlib-resources instead of legacy import
Browse files Browse the repository at this point in the history
  • Loading branch information
robweber committed Oct 30, 2024
1 parent 83f3b70 commit bf84a44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ classifiers = [
]

dependencies = [
"importlib-resources",
"Pillow>=9.1.0",
"waveshare-epd @ git+https://github.com/waveshareteam/e-Paper.git#subdirectory=RaspberryPi_JetsonNano/python&egg=waveshare-epd",
"inky[rpi]>=1.3.1",
Expand Down
4 changes: 2 additions & 2 deletions src/omni_epd/virtualepd.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import io
import re
import itertools
from importlib import resources
from importlib_resources import path
from PIL import Image, ImageEnhance, ImageColor
from . conf import EPD_CONFIG, IMAGE_DISPLAY, IMAGE_ENHANCEMENTS
from . errors import EPDConfigurationError
Expand Down Expand Up @@ -243,7 +243,7 @@ def _ditherImage(self, image, dither):
# format palette the way didder expects it
palette = [",".join(map(str, x)) for x in colors]
palette = " ".join(palette)
with resources.path("omni_epd", "didder") as p:
with path("omni_epd", "didder") as p:
didder = p

cmd = [didder, "--in", "-", "--out", "-", "--palette", palette]
Expand Down

0 comments on commit bf84a44

Please sign in to comment.