Removed ponce table

This commit is contained in:
Dimitris Zlatanidis 2023-03-05 10:57:10 +02:00
parent 4e82df5076
commit f774d2ef47

View file

@ -5,7 +5,6 @@ import tomli
from pathlib import Path
from slpkg.configs import Configs
from slpkg.models.models import PonceTable
from slpkg.models.models import session as Session
@ -18,19 +17,12 @@ class Blacklist(Configs):
def packages(self) -> list:
""" Reads the blacklist file. """
toml_blacks, ponce_blacks = [], []
file_toml = Path(self.etc_path, 'blacklist.toml')
if self.ponce_repo:
sbos: list = self.session.query(PonceTable.name).all() # type: ignore
ponce_blacks: list = [sbo[0] for sbo in sbos]
if file_toml.is_file():
try:
with open(file_toml, 'rb') as black:
toml_blacks = tomli.load(black)['blacklist']['packages']
return tomli.load(black)['blacklist']['packages']
except tomli.TOMLDecodeError as error:
raise SystemExit(f"\nValueError: {error}: in the configuration file "
"'/etc/slpkg/blacklist.toml'\n")
return toml_blacks + ponce_blacks