bug testing

This commit is contained in:
OusmBlueNinja 2023-08-27 00:02:37 -05:00
parent f773f3fa91
commit bffbeb3b68
4 changed files with 3 additions and 26 deletions

View File

@ -23,7 +23,7 @@ def install(name:str, Packages:list):
try: try:
if name in [row[0] for row in Packages.packages]: if name in [row[0] for row in Packages.packages]:
raise Exception("Package already installed") return
with open(("./packages/"+name+".py"), "r") as f: with open(("./packages/"+name+".py"), "r") as f:
line = f.readline() line = f.readline()

View File

@ -139,6 +139,8 @@ class packagemanager:
def install(self, name: str) -> int: def install(self, name: str) -> int:
if name in [row[0] for row in Packages.packages]:
raise Exception("Package already installed")
try: try:
if not os.path.exists(f"./packages/{name}.py"): if not os.path.exists(f"./packages/{name}.py"):
raise FileNotFoundError(name) raise FileNotFoundError(name)

View File

@ -1 +0,0 @@
[['builtin', 'packages.builtin', ['echo', 'ls', 'rm', 'clear', 'cd', 'll']], ['netget', 'packages.netget', ['netget']], ['netget', 'packages.netget', ['netget']], ['netget', 'packages.netget', ['netget']]]

View File

@ -1,24 +0,0 @@
#["netget", "packages.netget", ["netget"]]
# Made By OusmeBlueNinja
import os, sys
def netget(command: list):
print(command, len(command))
if len(command) != 2:
print("comand requires [ url ] [ path ]")
return
url = command[0]
location = command[1]
try:
import wget
wget.download(url, location)
except ImportError:
os.system(f"wget {url} -O {location}")
except:
print("cannot download")