mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-05 16:47:14 -04:00
Fixed inconsistent spacing between items in entry reader
Former-commit-id: 268667df04d1bd7f22733475dc7079c698bba46a Former-commit-id: 160b24686e81f304cb8426aaf043c239c2ab967f
This commit is contained in:
+12
-14
@@ -46,25 +46,25 @@ def entry_list_gen(_directory=f"{home}/.local/share/sshyp/"):
|
|||||||
|
|
||||||
# displays the contents of an entry in a readable format
|
# displays the contents of an entry in a readable format
|
||||||
def entry_reader(_decrypted_entry):
|
def entry_reader(_decrypted_entry):
|
||||||
_entry_lines, _notes_flag = open(_decrypted_entry, 'r').readlines(), 0
|
_entry_lines, _notes_flag = [line.strip() for line in open(_decrypted_entry, 'r').readlines()], 0
|
||||||
if pass_show:
|
if pass_show:
|
||||||
_entry_password = f'\u001b[38;5;10m{_entry_lines[0]}\u001b[0m'
|
_entry_password = f'\u001b[38;5;10m{_entry_lines[0]}\u001b[0m'
|
||||||
else:
|
else:
|
||||||
_entry_password = f'\u001b[38;5;3mend command in "--show" or "-s" to view\u001b[0m\n'
|
_entry_password = f'\u001b[38;5;3mend command in "--show" or "-s" to view\u001b[0m'
|
||||||
print()
|
print()
|
||||||
for _num in range(len(_entry_lines)):
|
for _num in range(len(_entry_lines)):
|
||||||
try:
|
try:
|
||||||
if _num == 0 and _entry_lines[1] != '\n':
|
if _num == 0 and _entry_lines[1] != '':
|
||||||
print(f"\u001b[38;5;15;48;5;238musername:\u001b[0m\n{_entry_lines[1]}")
|
print(f"\u001b[38;5;15;48;5;238musername:\u001b[0m\n{_entry_lines[1]}\n")
|
||||||
elif _num == 1 and _entry_lines[0] != '\n':
|
elif _num == 1 and _entry_lines[0] != '':
|
||||||
print(f"\u001b[38;5;15;48;5;238mpassword:\u001b[0m\n{_entry_password}")
|
print(f"\u001b[38;5;15;48;5;238mpassword:\u001b[0m\n{_entry_password}\n")
|
||||||
elif _num == 2 and _entry_lines[2] != '\n':
|
elif _num == 2 and _entry_lines[2] != '':
|
||||||
print(f"\u001b[38;5;15;48;5;238murl:\u001b[0m\n{_entry_lines[_num]}")
|
print(f"\u001b[38;5;15;48;5;238murl:\u001b[0m\n{_entry_lines[_num]}\n")
|
||||||
elif _num >= 3 and _entry_lines[_num] != '\n' and _notes_flag != 1:
|
elif _num >= 3 and _entry_lines[_num] != '' and _notes_flag != 1:
|
||||||
_notes_flag = 1
|
_notes_flag = 1
|
||||||
print('\u001b[38;5;15;48;5;238mnotes:\u001b[0m\n' + _entry_lines[_num].strip('\n'))
|
print('\u001b[38;5;15;48;5;238mnotes:\u001b[0m\n' + _entry_lines[_num])
|
||||||
elif _num >= 3 and _notes_flag == 1:
|
elif _num >= 3 and _notes_flag == 1:
|
||||||
print(_entry_lines[_num].strip('\n'))
|
print(_entry_lines[_num])
|
||||||
if _notes_flag == 1:
|
if _notes_flag == 1:
|
||||||
try:
|
try:
|
||||||
_line_test = _entry_lines[_num + 1]
|
_line_test = _entry_lines[_num + 1]
|
||||||
@@ -72,9 +72,7 @@ def entry_reader(_decrypted_entry):
|
|||||||
print()
|
print()
|
||||||
except IndexError:
|
except IndexError:
|
||||||
if _num == 0:
|
if _num == 0:
|
||||||
print(f"\u001b[38;5;15;48;5;238mpassword:\u001b[0m\n{_entry_password}")
|
print(f"\u001b[38;5;15;48;5;238mpassword:\u001b[0m\n{_entry_password}\n")
|
||||||
if pass_show:
|
|
||||||
print()
|
|
||||||
|
|
||||||
|
|
||||||
# generates and returns a random string based on input
|
# generates and returns a random string based on input
|
||||||
|
|||||||
Reference in New Issue
Block a user