Fixed print view

This commit is contained in:
Dimitris Zlatanidis 2020-02-14 12:51:09 +01:00
parent 6c3f50668e
commit 6c026f9023

View file

@ -53,11 +53,10 @@ class BlackList:
def listed(self): def listed(self):
"""Print blacklist packages """Print blacklist packages
""" """
print("\nPackages in the blacklist:\n") print("Packages in the blacklist:\n")
for black in self.get_black(): for black in self.get_black():
if black: if black:
print(f"{self.green}{black}{self.endc}") print(f"{self.green}{black}{self.endc}")
print()
def add(self, pkgs): def add(self, pkgs):
"""Add blacklist packages if not exist """Add blacklist packages if not exist
@ -70,7 +69,6 @@ class BlackList:
if pkg not in blacklist: if pkg not in blacklist:
print(f"{self.green}{pkg}{self.endc}") print(f"{self.green}{pkg}{self.endc}")
black_conf.write(pkg + "\n") black_conf.write(pkg + "\n")
print()
def remove(self, pkgs): def remove(self, pkgs):
"""Remove packages from blacklist """Remove packages from blacklist
@ -81,5 +79,4 @@ class BlackList:
if line not in pkgs: if line not in pkgs:
remove.write(line + "\n") remove.write(line + "\n")
else: else:
print(f"{self.red}{line}{self.endc}") print(f"{self.red}{line}{self.endc}")
print()