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 import sys
from time import sleep from time import sleep
indicator = ""
binding_up = [ord('k'), curses.KEY_UP] binding_up = [ord('k'), curses.KEY_UP]
binding_down = [ord('j'), curses.KEY_DOWN] binding_down = [ord('j'), curses.KEY_DOWN]
binding_accept = [ord('l'), ord(' '), ord('\n')] binding_accept = [ord('l'), ord(' '), ord('\n')]
@ -30,7 +32,7 @@ def show_select(win, path):
sel = 0 sel = 0
while True: while True:
for y, d in enumerate(dirs): 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() c = win.getch()
if c in binding_up: if c in binding_up:
sel = max(0, sel - 1) sel = max(0, sel - 1)

Loading…
Cancel
Save