diff options
author | wustho <benawiadha@gmail.com> | 2020-04-17 22:09:23 +0700 |
---|---|---|
committer | wustho <benawiadha@gmail.com> | 2020-04-17 22:17:17 +0700 |
commit | 9541dc4ffa2d12cc1283fb634fd4b7752e583a2d (patch) | |
tree | f6a1759c812f9734c0d29772cd1afc03fb9701c4 /epy.py | |
parent | 1a77fdc1f4f6a5f9b5925ed5cb8d8e1a761784a6 (diff) | |
download | epy-9541dc4ffa2d12cc1283fb634fd4b7752e583a2d.tar.gz |
Added quick shortcut "Yn" if ch_list == ["(Y)es", "(N)o"] in choice_win().
Diffstat (limited to 'epy.py')
-rwxr-xr-x | epy.py | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -534,12 +534,20 @@ def choice_win(allowdel=False): index = totlines - 1 elif key_chwin == ord("d") and allowdel: resp, _ = choice_win()( - lambda: ("Are you sure?", ["Yes", "No"], 0, {ord("n")}) + lambda: ("Delete '{}'?".format( + ch_list[index] + ), ["(Y)es", "(N)o"], 0, {ord("n")}) )() if resp == 0: return (0 if index == 0 else index-1), index chwin.redrawwin() chwin.refresh() + elif key_chwin in {ord(i) for i in ["Y", "y", "N", "n"]}\ + and ch_list == ["(Y)es", "(N)o"]: + if key_chwin in {ord("Y"), ord("y")}: + return 0, None + else: + return 1, None elif key_chwin in WINKEYS - key: return key_chwin, None countstring = "" |