mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-18 10:26:29 +01:00
Remove unused
This commit is contained in:
parent
2bcaab8f18
commit
1f40f72834
1 changed files with 3 additions and 10 deletions
|
@ -32,7 +32,6 @@ class BlackList:
|
|||
"""Blacklist class to add, remove or listed packages
|
||||
in blacklist file."""
|
||||
def __init__(self):
|
||||
self.quit = False
|
||||
self.green = _meta_.color["GREEN"]
|
||||
self.red = _meta_.color["RED"]
|
||||
self.endc = _meta_.color["ENDC"]
|
||||
|
@ -58,9 +57,7 @@ class BlackList:
|
|||
for black in self.get_black():
|
||||
if black:
|
||||
print(f"{self.green}{black}{self.endc}")
|
||||
self.quit = True
|
||||
if self.quit:
|
||||
print() # new line at exit
|
||||
print()
|
||||
|
||||
def add(self, pkgs):
|
||||
"""Add blacklist packages if not exist
|
||||
|
@ -73,9 +70,7 @@ class BlackList:
|
|||
if pkg not in blacklist:
|
||||
print(f"{self.green}{pkg}{self.endc}")
|
||||
black_conf.write(pkg + "\n")
|
||||
self.quit = True
|
||||
if self.quit:
|
||||
print() # new line at exit
|
||||
print()
|
||||
|
||||
def remove(self, pkgs):
|
||||
"""Remove packages from blacklist
|
||||
|
@ -87,6 +82,4 @@ class BlackList:
|
|||
remove.write(line + "\n")
|
||||
else:
|
||||
print(f"{self.red}{line}{self.endc}")
|
||||
self.quit = True
|
||||
if self.quit:
|
||||
print() # new line at exit
|
||||
print()
|
Loading…
Reference in a new issue