mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-05 16:47:14 -04:00
Made entry list monochrome
This commit is contained in:
@@ -20,10 +20,10 @@ def entry_list_gen(): # generates and prints a list of all folders and entries
|
|||||||
for _entry in sorted(listdir(path.expanduser('~/.password-pasture'))):
|
for _entry in sorted(listdir(path.expanduser('~/.password-pasture'))):
|
||||||
if Path(path.expanduser(f"~/.password-pasture/{_entry}")).is_file():
|
if Path(path.expanduser(f"~/.password-pasture/{_entry}")).is_file():
|
||||||
if _color_alternator == 1:
|
if _color_alternator == 1:
|
||||||
_entry_list.append(f"\u001b[38;5;195m{_entry.replace('.gpg', '')}\u001b[0m")
|
_entry_list.append(f"\u001b[38;5;255m{_entry.replace('.gpg', '')}\u001b[0m")
|
||||||
_color_alternator = 2
|
_color_alternator = 2
|
||||||
else:
|
else:
|
||||||
_entry_list.append(f"\u001b[38;5;123m{_entry.replace('.gpg', '')}\u001b[0m")
|
_entry_list.append(f"\u001b[38;5;248m{_entry.replace('.gpg', '')}\u001b[0m")
|
||||||
_color_alternator = 1
|
_color_alternator = 1
|
||||||
_real = len(' '.join(_entry_list)) - (15 * len(_entry_list))
|
_real = len(' '.join(_entry_list)) - (15 * len(_entry_list))
|
||||||
if _real <= get_terminal_size()[0]:
|
if _real <= get_terminal_size()[0]:
|
||||||
@@ -37,15 +37,15 @@ def entry_list_gen(): # generates and prints a list of all folders and entries
|
|||||||
for _root, _directories, _files in walk(path.expanduser('~/.password-pasture')):
|
for _root, _directories, _files in walk(path.expanduser('~/.password-pasture')):
|
||||||
for _dir in sorted(_directories):
|
for _dir in sorted(_directories):
|
||||||
_inner_dir = f"{_root.replace(path.expanduser('~/.password-pasture'), '')}/{_dir}"
|
_inner_dir = f"{_root.replace(path.expanduser('~/.password-pasture'), '')}/{_dir}"
|
||||||
print(f"\u001b[38;5;228m{_inner_dir}/\u001b[0m")
|
print(f"\n\u001b[38;5;15;48;5;232m{_inner_dir}/\u001b[0m")
|
||||||
_entry_list, _color_alternator = [], 1
|
_entry_list, _color_alternator = [], 1
|
||||||
for _s_root, _s_directories, _s_files in walk(path.expanduser(f"~/.password-pasture{_inner_dir}")):
|
for _s_root, _s_directories, _s_files in walk(path.expanduser(f"~/.password-pasture{_inner_dir}")):
|
||||||
for _entry in sorted(_s_files):
|
for _entry in sorted(_s_files):
|
||||||
if _color_alternator == 1:
|
if _color_alternator == 1:
|
||||||
_entry_list.append(f"\u001b[38;5;195m{_entry.replace('.gpg', '')}\u001b[0m")
|
_entry_list.append(f"\u001b[38;5;255m{_entry.replace('.gpg', '')}\u001b[0m")
|
||||||
_color_alternator = 2
|
_color_alternator = 2
|
||||||
else:
|
else:
|
||||||
_entry_list.append(f"\u001b[38;5;123m{_entry.replace('.gpg', '')}\u001b[0m")
|
_entry_list.append(f"\u001b[38;5;248m{_entry.replace('.gpg', '')}\u001b[0m")
|
||||||
_color_alternator = 1
|
_color_alternator = 1
|
||||||
_real = len(' '.join(_entry_list)) - (15 * len(_entry_list))
|
_real = len(' '.join(_entry_list)) - (15 * len(_entry_list))
|
||||||
if _real <= get_terminal_size()[0]:
|
if _real <= get_terminal_size()[0]:
|
||||||
|
|||||||
Reference in New Issue
Block a user