|
|
|
@ -31,7 +31,7 @@ def search_pictures(win, path):
|
|
|
|
|
files = sorted([str(f) for f in path.iterdir() if f.is_file() and f.suffix.lower() in ['.png', '.jpg', '.jpeg', '.gif']])
|
|
|
|
|
return show_pictures(files)
|
|
|
|
|
|
|
|
|
|
def show_select(win, path):
|
|
|
|
|
def show_select(win, base_dir, path):
|
|
|
|
|
if not path.is_dir():
|
|
|
|
|
raise Exception("'" + str(path) + "' is not a directory!")
|
|
|
|
|
dirs = sorted([d for d in path.iterdir() if d.is_dir()])
|
|
|
|
@ -48,7 +48,7 @@ def show_select(win, path):
|
|
|
|
|
elif c in binding_down:
|
|
|
|
|
sel = min(len(dirs) - 1, sel + 1)
|
|
|
|
|
elif c in binding_accept:
|
|
|
|
|
if not show_select(win, dirs[sel]):
|
|
|
|
|
if not show_select(win, base_dir, dirs[sel]):
|
|
|
|
|
return False
|
|
|
|
|
win.clear()
|
|
|
|
|
elif c in binding_back:
|
|
|
|
@ -58,7 +58,7 @@ def show_select(win, path):
|
|
|
|
|
|
|
|
|
|
def select_ui(win, args):
|
|
|
|
|
curses.curs_set(0)
|
|
|
|
|
while show_select(win, args.dir) and args.kiosk:
|
|
|
|
|
while show_select(win, args.dir, args.dir) and args.kiosk:
|
|
|
|
|
pass
|
|
|
|
|
if args.kiosk:
|
|
|
|
|
subprocess.call(['systemctl', 'poweroff'])
|
|
|
|
|