From 99cf9b7413b7aab2204939f1d8bda4d002ef6a80 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Wed, 1 Mar 2023 19:30:15 -0500 Subject: [PATCH] No longer display empty directory notification on the root Former-commit-id: 86b964901547d3daf607583da762b1e10426cc3a Former-commit-id: da5e860b1e237b82e0a9525ff451f17825c6ac88 --- lib/sshyp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/sshyp.py b/lib/sshyp.py index d501f26..ac40c81 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -19,8 +19,6 @@ def entry_list_gen(_directory=expanduser('~/.local/share/sshyp/')): # generates _entry_list, _color_alternator = [], 1 if _ran: print(f"\u001b[38;5;15;48;5;238m{_root.replace(expanduser('~/.local/share/sshyp'), '', 1)}/\u001b[0m") - else: - _ran = True for filename in sorted(_files): if _color_alternator > 0: _entry_list.append(filename[:-4]) @@ -34,8 +32,10 @@ def entry_list_gen(_directory=expanduser('~/.local/share/sshyp/')): # generates _width = (len(' '.join(_entry_list)) / (_real / get_terminal_size()[0]) - 25) if len(_entry_list) > 0: print(fill(' '.join(_entry_list), width=_width) + '\n') - else: + elif _ran: print('\u001b[38;5;9m-empty directory-\u001b[0m\n') + else: + _ran = True def entry_reader(_decrypted_entry): # displays the contents of an entry in a readable format