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:
Mike Barela 2019-03-12 10:13:36 -04:00 committed by GitHub
parent 9ceb905526
commit cd1484e2d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,4 @@
import os
import time
import board
import busio
import digitalio
@ -21,8 +20,8 @@ try:
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")
IMAGE_DIRECTORY = "/sd/images"
except:
print("No SD card, will only look on internal memory")
except Exception as e:
print("No SD card, will only look on internal memory, {0}.".format(e.message))
def print_directory(path, tabs=0):
for file in os.listdir(path):
@ -52,8 +51,7 @@ def print_directory(path, tabs=0):
print_directory(IMAGE_DIRECTORY)
# Create the slideshow object that plays through once alphabetically.
slideshow = SlideShow(board.DISPLAY, None,
folder=IMAGE_DIRECTORY, loop=True,
slideshow = SlideShow(board.DISPLAY, None, folder=IMAGE_DIRECTORY, loop=True,
order=PlayBackOrder.ALPHABETICAL, dwell=0)
while True: