adafruit / Adafruit_CircuitPython_Slideshow

CircuitPython helper library for displaying a slideshow of images on a board with a built-in display.
MIT License
4 stars 11 forks source link

Not all boards have json, so gracefully fallback if not present #28

Closed hamslabs closed 3 years ago

hamslabs commented 3 years ago

adafruit_slideshow.py imports json and it isn't defined anywhere in circuitpython or the bundle.

dhalbert commented 3 years ago

json is built into most but not all builds of CIrcuitPython. There is not a separate library. So you may be using a small build that doesn't have room, or an old build (it used to be called ujson).

dhalbert commented 3 years ago

The text file support assumes the json module exists, which isn't true on SAMD21 builds. The code should fall back gracefully if import json fails. The OP was trying to use a CPX with a TFT Gizmo. @FoamyGuy

FoamyGuy commented 3 years ago

I can make this change tonight. I will catch the ImportError and add a note indicating text slides require json