+ pakk remove to allow multiple packages at once

This commit is contained in:
OusmBlueNinja 2023-08-26 22:12:05 -05:00
parent cb4d531edc
commit 731b9ff980
3 changed files with 13 additions and 12 deletions

BIN
main.exe Normal file

Binary file not shown.

23
main.py
View File

@ -109,9 +109,9 @@ class packagemanager:
elif args[1] == "install":
self.install(args[2])
elif args[1] == "list":
self.list()
self.List()
elif args[1] == "remove":
self.uninstall(args[2])
self.uninstall(args[2:])
elif args[1] == "available":
self.commands("./packages")
else:
@ -164,17 +164,18 @@ class packagemanager:
def list(self):
def List(self):
print("Installed Packages: \n"+ "\n".join([row[0] for row in Packages.packages]))
def uninstall(self, name:str):
#print(Packages.packages)
print(f"Uninstalling {name}")
for package in Packages.packages:
if name in package[0]:
Packages.packages.remove(package)
Packages.update(Packages.packages)
print(f"{color.green}Sucess:{color.white} Uninstalled {name}.")
def uninstall(self, package: list):
for name in package:
#print(Packages.packages)
print(f"Uninstalling {name}")
for package in Packages.packages:
if name in package[0]:
Packages.packages.remove(package)
Packages.update(Packages.packages)
print(f"{color.green}Sucess:{color.white} Uninstalled {name}.")

View File

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