From d670b41ff3d5d10ae69c7c01d49a4277e99cd45d Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Mon, 26 Oct 2020 13:43:52 +0100 Subject: [PATCH] client: Passthrough base_dir to show_select calls --- playbook/templates/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playbook/templates/client.py b/playbook/templates/client.py index 67baaa3..8d0aabb 100755 --- a/playbook/templates/client.py +++ b/playbook/templates/client.py @@ -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'])