mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-02 07:07:18 -04:00
Follow-up to previous merge
Former-commit-id: bd62ed039b6464e3efd1f733e5644a0ab70f3c20 Former-commit-id: 9fa2ac0f23e6235164f0742f8cf6a1850b9d2120
This commit is contained in:
+7
-8
@@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import os
|
|
||||||
from os import chmod, environ, listdir, remove, uname, walk
|
from os import chmod, environ, listdir, remove, uname, walk
|
||||||
from os.path import expanduser
|
from os.path import expanduser, isdir
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from random import randint
|
from random import randint
|
||||||
from shutil import get_terminal_size, move, rmtree
|
from shutil import get_terminal_size, move, rmtree
|
||||||
@@ -467,10 +466,10 @@ def no_arg(): # displays a list of entries and gives an option to select one fo
|
|||||||
if not Path(f"{directory}{_entry_name}.gpg").exists():
|
if not Path(f"{directory}{_entry_name}.gpg").exists():
|
||||||
if not _entry_name:
|
if not _entry_name:
|
||||||
print(f"\n\u001b[38;5;9merror: missing entry name\u001b[0m\n")
|
print(f"\n\u001b[38;5;9merror: missing entry name\u001b[0m\n")
|
||||||
elif os.path.isdir(f"{directory}{_entry_name}"):
|
elif isdir(f"{directory}{_entry_name}"):
|
||||||
print(f"\n\u001b[38;5;9merror: entry ({_entry_name}) is a directory\u001b[0m\n")
|
print(f"\n\u001b[38;5;9merror: entry (/{_entry_name}) is a directory\u001b[0m\n")
|
||||||
else:
|
else:
|
||||||
print(f"\n\u001b[38;5;9merror: entry ({_entry_name}) does not exist\u001b[0m\n")
|
print(f"\n\u001b[38;5;9merror: entry (/{_entry_name}) does not exist\u001b[0m\n")
|
||||||
s_exit(2)
|
s_exit(2)
|
||||||
_shm_folder, _shm_entry = shm_gen()
|
_shm_folder, _shm_entry = shm_gen()
|
||||||
determine_decrypt(directory + _entry_name, _shm_folder, _shm_entry)
|
determine_decrypt(directory + _entry_name, _shm_folder, _shm_entry)
|
||||||
@@ -482,10 +481,10 @@ def read_shortcut(): # shortcut to quickly read an entry
|
|||||||
if not Path(f"{directory}{arguments[0].replace('/', '', 1)}.gpg").exists():
|
if not Path(f"{directory}{arguments[0].replace('/', '', 1)}.gpg").exists():
|
||||||
if not arguments[0].replace('/', '', 1):
|
if not arguments[0].replace('/', '', 1):
|
||||||
print(f"\n\u001b[38;5;9merror: missing entry name\u001b[0m\n")
|
print(f"\n\u001b[38;5;9merror: missing entry name\u001b[0m\n")
|
||||||
elif os.path.isdir(f"{directory}{arguments[0].replace('/', '', 1)}"):
|
elif isdir(f"{directory}{arguments[0].replace('/', '', 1)}"):
|
||||||
print(f"\n\u001b[38;5;9merror: entry ({arguments[0].replace('/', '', 1)}) is a directory\u001b[0m\n")
|
print(f"\n\u001b[38;5;9merror: entry ({arguments[0]}) is a directory\u001b[0m\n")
|
||||||
else:
|
else:
|
||||||
print(f"\n\u001b[38;5;9merror: entry ({arguments[0].replace('/', '', 1)}) does not exist\u001b[0m\n")
|
print(f"\n\u001b[38;5;9merror: entry ({arguments[0]}) does not exist\u001b[0m\n")
|
||||||
s_exit(2)
|
s_exit(2)
|
||||||
_shm_folder, _shm_entry = shm_gen()
|
_shm_folder, _shm_entry = shm_gen()
|
||||||
determine_decrypt(directory + arguments[0].replace('/', '', 1), _shm_folder, _shm_entry)
|
determine_decrypt(directory + arguments[0].replace('/', '', 1), _shm_folder, _shm_entry)
|
||||||
|
|||||||
Reference in New Issue
Block a user