mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-25 09:58:41 +01:00
Removed ponce table
This commit is contained in:
parent
4e82df5076
commit
f774d2ef47
1 changed files with 1 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue