mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-18 10:26:29 +01:00
Updated for colors
This commit is contained in:
parent
8bf1234d85
commit
56541dc7ee
1 changed files with 9 additions and 7 deletions
|
@ -21,6 +21,7 @@ class Check(Configs, Utilities):
|
|||
|
||||
self.bold: str = self.color['bold']
|
||||
self.red: str = self.color['red']
|
||||
self.cyan: str = self.color['cyan']
|
||||
self.endc: str = self.color['endc']
|
||||
self.bred: str = f'{self.bold}{self.red}'
|
||||
|
||||
|
@ -37,8 +38,8 @@ class Check(Configs, Utilities):
|
|||
not_packages.append(sbo)
|
||||
|
||||
if not_packages:
|
||||
raise SystemExit(f'\n[{self.bred}Error{self.endc}]: Packages \'{", ".join(not_packages)}\' '
|
||||
'does not exists.\n')
|
||||
raise SystemExit(f"\n[{self.bred}Error{self.endc}]: Packages "
|
||||
f"'{self.cyan}{', '.join(not_packages)}{self.endc}' does not exists.\n")
|
||||
|
||||
return slackbuilds
|
||||
|
||||
|
@ -48,7 +49,8 @@ class Check(Configs, Utilities):
|
|||
sources = SBoQueries(sbo).sources()
|
||||
|
||||
if 'UNSUPPORTED' in sources:
|
||||
raise SystemExit(f"\n[{self.bred}Error{self.endc}]: Package '{sbo}' unsupported by arch.\n")
|
||||
raise SystemExit(f"\n[{self.bred}Error{self.endc}]: Package "
|
||||
f"'{self.cyan}{sbo}{self.endc}' unsupported by arch.\n")
|
||||
|
||||
def installed(self, slackbuilds: list, file_pattern: str) -> list:
|
||||
""" Checking for installed packages. """
|
||||
|
@ -78,13 +80,13 @@ class Check(Configs, Utilities):
|
|||
|
||||
if packages:
|
||||
raise SystemExit(
|
||||
f'\nThe packages \'{", ".join(packages)}\' is blacklisted.\n'
|
||||
f'Please edit the blacklist.toml file in '
|
||||
f'{self.etc_path} folder.\n')
|
||||
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")
|
||||
|
||||
def database(self) -> None:
|
||||
""" Checking for empty table """
|
||||
db = Path(self.db_path, self.database_name)
|
||||
if not SBoQueries('').sbos() or not db.is_file():
|
||||
raise SystemExit('\nYou need to update the package lists first.\n'
|
||||
'Please run slpkg update.\n')
|
||||
"Please run 'slpkg update'.\n")
|
||||
|
|
Loading…
Reference in a new issue