Update viewmaster.py
fix continuation, attempt fix on except that is labeled by Lint as bare exception. Hopefully cr/lf will fix.
This commit is contained in:
parent
9ceb905526
commit
cd1484e2d9
1 changed files with 4 additions and 6 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
import os
|
import os
|
||||||
import time
|
|
||||||
import board
|
import board
|
||||||
import busio
|
import busio
|
||||||
import digitalio
|
import digitalio
|
||||||
|
|
@ -21,8 +20,8 @@ try:
|
||||||
vfs = storage.VfsFat(sdcard)
|
vfs = storage.VfsFat(sdcard)
|
||||||
storage.mount(vfs, "/sd")
|
storage.mount(vfs, "/sd")
|
||||||
IMAGE_DIRECTORY = "/sd/images"
|
IMAGE_DIRECTORY = "/sd/images"
|
||||||
except:
|
except Exception as e:
|
||||||
print("No SD card, will only look on internal memory")
|
print("No SD card, will only look on internal memory, {0}.".format(e.message))
|
||||||
|
|
||||||
def print_directory(path, tabs=0):
|
def print_directory(path, tabs=0):
|
||||||
for file in os.listdir(path):
|
for file in os.listdir(path):
|
||||||
|
|
@ -52,9 +51,8 @@ def print_directory(path, tabs=0):
|
||||||
print_directory(IMAGE_DIRECTORY)
|
print_directory(IMAGE_DIRECTORY)
|
||||||
|
|
||||||
# Create the slideshow object that plays through once alphabetically.
|
# Create the slideshow object that plays through once alphabetically.
|
||||||
slideshow = SlideShow(board.DISPLAY, None,
|
slideshow = SlideShow(board.DISPLAY, None, folder=IMAGE_DIRECTORY, loop=True,
|
||||||
folder=IMAGE_DIRECTORY, loop=True,
|
order=PlayBackOrder.ALPHABETICAL, dwell=0)
|
||||||
order=PlayBackOrder.ALPHABETICAL, dwell=0)
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
if not switch.value:
|
if not switch.value:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue