+ pakk remove to allow multiple packages at once
This commit is contained in:
parent
cb4d531edc
commit
731b9ff980
23
main.py
23
main.py
@ -109,9 +109,9 @@ class packagemanager:
|
|||||||
elif args[1] == "install":
|
elif args[1] == "install":
|
||||||
self.install(args[2])
|
self.install(args[2])
|
||||||
elif args[1] == "list":
|
elif args[1] == "list":
|
||||||
self.list()
|
self.List()
|
||||||
elif args[1] == "remove":
|
elif args[1] == "remove":
|
||||||
self.uninstall(args[2])
|
self.uninstall(args[2:])
|
||||||
elif args[1] == "available":
|
elif args[1] == "available":
|
||||||
self.commands("./packages")
|
self.commands("./packages")
|
||||||
else:
|
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]))
|
print("Installed Packages: \n"+ "\n".join([row[0] for row in Packages.packages]))
|
||||||
|
|
||||||
def uninstall(self, name:str):
|
def uninstall(self, package: list):
|
||||||
#print(Packages.packages)
|
for name in package:
|
||||||
print(f"Uninstalling {name}")
|
#print(Packages.packages)
|
||||||
for package in Packages.packages:
|
print(f"Uninstalling {name}")
|
||||||
if name in package[0]:
|
for package in Packages.packages:
|
||||||
Packages.packages.remove(package)
|
if name in package[0]:
|
||||||
Packages.update(Packages.packages)
|
Packages.packages.remove(package)
|
||||||
print(f"{color.green}Sucess:{color.white} Uninstalled {name}.")
|
Packages.update(Packages.packages)
|
||||||
|
print(f"{color.green}Sucess:{color.white} Uninstalled {name}.")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -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']]]
|
Loading…
Reference in New Issue
Block a user