client.py: Extracted indicator in variable

master
Felix Stupp 4 years ago
parent 1a5cd024d0
commit 5b0bcdad2c
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -6,6 +6,8 @@ import subprocess
import sys
from time import sleep
indicator = ""
binding_up = [ord('k'), curses.KEY_UP]
binding_down = [ord('j'), curses.KEY_DOWN]
binding_accept = [ord('l'), ord(' '), ord('\n')]
@ -30,7 +32,7 @@ def show_select(win, path):
sel = 0
while True:
for y, d in enumerate(dirs):
win.addstr(y, 0, (" " if y == sel else " ") + d.name + (" " * (curses.COLS - 2 - len(d.name))), curses.A_STANDOUT if y == sel else curses.A_NORMAL)
win.addstr(y, 0, (indicator + " " if y == sel else " ") + d.name + (" " * (curses.COLS - 2 - len(d.name))), curses.A_STANDOUT if y == sel else curses.A_NORMAL)
c = win.getch()
if c in binding_up:
sel = max(0, sel - 1)

Loading…
Cancel
Save