From a119544fbf2beb3070fe3d4ccfba8dc611129411 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Mon, 11 Dec 2023 12:40:10 -0500 Subject: [PATCH] Re-implement empty directory notification in entry list --- lib/sshyp.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/sshyp.py b/lib/sshyp.py index e149ad2..b9d75c2 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -19,7 +19,7 @@ home = expanduser('~') def entry_list_gen(_directory=f"{home}/.local/share/sshyp/"): from shutil import get_terminal_size _ran, _width = False, get_terminal_size().columns - print(f"\nfor a list of usable commands, run 'sshyp help'\n\n\u001b[38;5;0;48;5;15msshyp entries ({str(_width)} cols):\u001b[0m", end='') + print("\nfor a list of usable commands, run 'sshyp help'\n\n\u001b[38;5;0;48;5;15msshyp entries:\u001b[0m", end='') for _root, _dirs, _files in sorted(walk(_directory, topdown=True)): _color_alternator = 1 if _ran: @@ -38,6 +38,8 @@ def entry_list_gen(_directory=f"{home}/.local/share/sshyp/"): print() print(_print_string + ' ', end='') _color_alternator = _color_alternator * -1 + if _ran and _char_counter < 1: + print('\u001b[38;5;9m-empty directory-\u001b[0m', end='') _ran = True print('\n')