diff --git a/horsy.py b/horsy.py index b70c872..831ebce 100644 --- a/horsy.py +++ b/horsy.py @@ -1,9 +1,10 @@ import argparse -import tui as tui -from console import cls -from manager import * -from virustotal import add_to_cfg -from uploader import upload +import os +import modules.tui as tui +from modules.console import cls +from modules.manager import install, uninstall +from modules.virustotal import add_to_cfg +from modules.uploader import upload # Getting the arguments parser = argparse.ArgumentParser(description='horsy - the best package manager') diff --git a/icon.ico b/img/icon.ico similarity index 100% rename from icon.ico rename to img/icon.ico diff --git a/auth.py b/modules/auth.py similarity index 100% rename from auth.py rename to modules/auth.py diff --git a/console.py b/modules/console.py similarity index 100% rename from console.py rename to modules/console.py diff --git a/manager.py b/modules/manager.py similarity index 96% rename from manager.py rename to modules/manager.py index b099b71..afb2d5c 100644 --- a/manager.py +++ b/modules/manager.py @@ -2,16 +2,16 @@ import json import threading from rich import print import requests -import vars +import modules.vars as horsy_vars from tqdm import tqdm import os import zipfile -from virustotal import get_key, scan_file, get_report +from modules.virustotal import get_key, scan_file, get_report def install(package, is_gui=False): horsypath = os.popen('echo %HORSYPATH%').read().replace('\n', '') + '/' - r = requests.get(f"{vars.protocol}{vars.server_url}/packages/json/{package}").text + r = requests.get(f"{horsy_vars.protocol}{horsy_vars.server_url}/packages/json/{package}").text try: r = json.loads(r) except: diff --git a/path.py b/modules/path.py similarity index 100% rename from path.py rename to modules/path.py diff --git a/tui.py b/modules/tui.py similarity index 100% rename from tui.py rename to modules/tui.py diff --git a/uploader.py b/modules/uploader.py similarity index 96% rename from uploader.py rename to modules/uploader.py index 71c21f1..5edd25e 100644 --- a/uploader.py +++ b/modules/uploader.py @@ -2,9 +2,9 @@ import json import time import requests from rich import print -from auth import get_auth, del_auth +from modules.auth import get_auth, del_auth import re -import vars +import modules.vars as horsy_vars import os @@ -105,7 +105,7 @@ def upload(): r = None while r is None: try: - r = requests.post(vars.protocol + vars.server_url + '/packages/new', json=request).text + r = requests.post(horsy_vars.protocol + horsy_vars.server_url + '/packages/new', json=request).text r = json.loads(r) if r['message'] == 'Unauthorized': diff --git a/vars.py b/modules/vars.py similarity index 100% rename from vars.py rename to modules/vars.py diff --git a/virustotal.py b/modules/virustotal.py similarity index 100% rename from virustotal.py rename to modules/virustotal.py