client: Passthrough base_dir to show_select calls

master
Felix Stupp 4 years ago
parent 0af22d5e8e
commit d670b41ff3
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -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'])

Loading…
Cancel
Save