List of apps
This commit is contained in:
7
horsy.py
7
horsy.py
@@ -4,7 +4,7 @@ import sys
|
|||||||
|
|
||||||
import modules.tui as tui
|
import modules.tui as tui
|
||||||
from modules.console import cls
|
from modules.console import cls
|
||||||
from modules.manager import install, uninstall
|
from modules.manager import install, uninstall, apps_list
|
||||||
from modules.virustotal import add_to_cfg
|
from modules.virustotal import add_to_cfg
|
||||||
from modules.uploader import upload
|
from modules.uploader import upload
|
||||||
from modules.source import get_source
|
from modules.source import get_source
|
||||||
@@ -18,7 +18,7 @@ parser.add_argument('option', help='options for horsy (install/i | uninstall/un
|
|||||||
choices=['install', 'i', 'uninstall', 'un', 'source', 's', 'update', 'u', 'list', 'l', 'upload',
|
choices=['install', 'i', 'uninstall', 'un', 'source', 's', 'update', 'u', 'list', 'l', 'upload',
|
||||||
'search', 'info'],
|
'search', 'info'],
|
||||||
nargs='?')
|
nargs='?')
|
||||||
parser.add_argument('app', help='app to install/uninstall/download source', nargs='?')
|
parser.add_argument('app', help='app to do function with', nargs='?')
|
||||||
parser.add_argument('--vt', help='your virustotal api key (account -> api key in VT)', dest='vt_key')
|
parser.add_argument('--vt', help='your virustotal api key (account -> api key in VT)', dest='vt_key')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
@@ -87,5 +87,8 @@ if option in ['search']:
|
|||||||
if option in ['info']:
|
if option in ['info']:
|
||||||
info(app)
|
info(app)
|
||||||
|
|
||||||
|
if option in ['list', 'l']:
|
||||||
|
apps_list()
|
||||||
|
|
||||||
if isNoArgs:
|
if isNoArgs:
|
||||||
input('[EXIT] Press enter to exit horsy...')
|
input('[EXIT] Press enter to exit horsy...')
|
||||||
|
|||||||
@@ -137,3 +137,11 @@ def uninstall(package, is_gui=False):
|
|||||||
print(f"[green][OK] Launch script deleted[/]")
|
print(f"[green][OK] Launch script deleted[/]")
|
||||||
else:
|
else:
|
||||||
print(f"[red]App {package} is not installed or doesn't have launch script[/]")
|
print(f"[red]App {package} is not installed or doesn't have launch script[/]")
|
||||||
|
|
||||||
|
|
||||||
|
def apps_list():
|
||||||
|
if os.path.exists('{0}apps'.format(horsy_vars.horsypath)):
|
||||||
|
print(f"[green]Installed apps:[/]")
|
||||||
|
for file in os.listdir('{0}apps'.format(horsy_vars.horsypath)):
|
||||||
|
if file.endswith(".bat"):
|
||||||
|
print(f"{file.split('.')[0]}")
|
||||||
|
|||||||
Reference in New Issue
Block a user