Changed file system
This commit is contained in:
11
horsy.py
11
horsy.py
@@ -1,9 +1,10 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import tui as tui
|
import os
|
||||||
from console import cls
|
import modules.tui as tui
|
||||||
from manager import *
|
from modules.console import cls
|
||||||
from virustotal import add_to_cfg
|
from modules.manager import install, uninstall
|
||||||
from uploader import upload
|
from modules.virustotal import add_to_cfg
|
||||||
|
from modules.uploader import upload
|
||||||
|
|
||||||
# Getting the arguments
|
# Getting the arguments
|
||||||
parser = argparse.ArgumentParser(description='horsy - the best package manager')
|
parser = argparse.ArgumentParser(description='horsy - the best package manager')
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
@@ -2,16 +2,16 @@ import json
|
|||||||
import threading
|
import threading
|
||||||
from rich import print
|
from rich import print
|
||||||
import requests
|
import requests
|
||||||
import vars
|
import modules.vars as horsy_vars
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
import os
|
import os
|
||||||
import zipfile
|
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):
|
def install(package, is_gui=False):
|
||||||
horsypath = os.popen('echo %HORSYPATH%').read().replace('\n', '') + '/'
|
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:
|
try:
|
||||||
r = json.loads(r)
|
r = json.loads(r)
|
||||||
except:
|
except:
|
||||||
@@ -2,9 +2,9 @@ import json
|
|||||||
import time
|
import time
|
||||||
import requests
|
import requests
|
||||||
from rich import print
|
from rich import print
|
||||||
from auth import get_auth, del_auth
|
from modules.auth import get_auth, del_auth
|
||||||
import re
|
import re
|
||||||
import vars
|
import modules.vars as horsy_vars
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ def upload():
|
|||||||
r = None
|
r = None
|
||||||
while r is None:
|
while r is None:
|
||||||
try:
|
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)
|
r = json.loads(r)
|
||||||
|
|
||||||
if r['message'] == 'Unauthorized':
|
if r['message'] == 'Unauthorized':
|
||||||
Reference in New Issue
Block a user