mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-16 03:41:11 +01:00
Updated for checks
This commit is contained in:
parent
1844b33cf6
commit
cbc81396c5
2 changed files with 4 additions and 5 deletions
|
@ -21,14 +21,14 @@ class Blacklist(Configs):
|
|||
self.cyan: str = self.color['cyan']
|
||||
self.endc: str = self.color['endc']
|
||||
self.bred: str = f'{self.bold}{self.red}'
|
||||
self.blacklist_file_toml = Path(self.etc_path, 'blacklist.toml')
|
||||
|
||||
def packages(self) -> list:
|
||||
""" Reads the blacklist file. """
|
||||
file_toml = Path(self.etc_path, 'blacklist.toml')
|
||||
|
||||
if file_toml.is_file():
|
||||
if self.blacklist_file_toml.is_file():
|
||||
try:
|
||||
with open(file_toml, 'rb') as black:
|
||||
with open(self.blacklist_file_toml, 'rb') as black:
|
||||
return tomli.load(black)['BLACKLIST']['PACKAGES']
|
||||
except (tomli.TOMLDecodeError, KeyError) as error:
|
||||
raise SystemExit(f"\n[{self.bred}Error{self.endc}]: {error}: in the configuration file "
|
||||
|
|
|
@ -79,8 +79,7 @@ class Check(Configs):
|
|||
if packages:
|
||||
raise SystemExit(
|
||||
f"\nThe packages '{self.cyan}{', '.join(packages)}{self.endc}' is blacklisted.\n"
|
||||
f"Please edit the blacklist.toml file in "
|
||||
f"{self.etc_path} folder.\n")
|
||||
f"Please edit the '{self.black.blacklist_file_toml}' file.\n")
|
||||
|
||||
def is_empty_database(self) -> None:
|
||||
""" Checking for empty table """
|
||||
|
|
Loading…
Reference in a new issue