From bffbeb3b6805f5827af11d117131dae94574a00c Mon Sep 17 00:00:00 2001 From: OusmBlueNinja Date: Sun, 27 Aug 2023 00:02:37 -0500 Subject: [PATCH] bug testing --- helper/helper.py | 2 +- main.py | 2 ++ packages/pakk.conf | 1 - packages/test.py | 24 ------------------------ 4 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 packages/pakk.conf delete mode 100644 packages/test.py diff --git a/helper/helper.py b/helper/helper.py index 3cfcdb1..e14cb34 100644 --- a/helper/helper.py +++ b/helper/helper.py @@ -23,7 +23,7 @@ def install(name:str, Packages:list): try: if name in [row[0] for row in Packages.packages]: - raise Exception("Package already installed") + return with open(("./packages/"+name+".py"), "r") as f: line = f.readline() diff --git a/main.py b/main.py index c0c1e10..aeee772 100644 --- a/main.py +++ b/main.py @@ -139,6 +139,8 @@ class packagemanager: def install(self, name: str) -> int: + if name in [row[0] for row in Packages.packages]: + raise Exception("Package already installed") try: if not os.path.exists(f"./packages/{name}.py"): raise FileNotFoundError(name) diff --git a/packages/pakk.conf b/packages/pakk.conf deleted file mode 100644 index 11ba7f3..0000000 --- a/packages/pakk.conf +++ /dev/null @@ -1 +0,0 @@ -[['builtin', 'packages.builtin', ['echo', 'ls', 'rm', 'clear', 'cd', 'll']], ['netget', 'packages.netget', ['netget']], ['netget', 'packages.netget', ['netget']], ['netget', 'packages.netget', ['netget']]] \ No newline at end of file diff --git a/packages/test.py b/packages/test.py deleted file mode 100644 index 0a1b32c..0000000 --- a/packages/test.py +++ /dev/null @@ -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") - -