mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-07 17:24:57 +01:00
Updated for colors
This commit is contained in:
parent
7b8ea29180
commit
b761b04c40
2 changed files with 13 additions and 7 deletions
|
@ -17,6 +17,13 @@ class Check(Configs, Utilities):
|
||||||
super(Utilities, self).__init__()
|
super(Utilities, self).__init__()
|
||||||
|
|
||||||
self.black = Blacklist()
|
self.black = Blacklist()
|
||||||
|
self.color = self.colour()
|
||||||
|
|
||||||
|
self.bold: str = self.color['bold']
|
||||||
|
self.red: str = self.color['red']
|
||||||
|
self.endc: str = self.color['endc']
|
||||||
|
self.byellow: str = f'{self.bold}{self.yellow}'
|
||||||
|
self.bred: str = f'{self.bold}{self.red}'
|
||||||
|
|
||||||
def exists(self, slackbuilds: list) -> list:
|
def exists(self, slackbuilds: list) -> list:
|
||||||
""" Checking if the slackbuild exists in the repository. """
|
""" Checking if the slackbuild exists in the repository. """
|
||||||
|
@ -31,19 +38,18 @@ class Check(Configs, Utilities):
|
||||||
not_packages.append(sbo)
|
not_packages.append(sbo)
|
||||||
|
|
||||||
if not_packages:
|
if not_packages:
|
||||||
raise SystemExit(f'\nError: Packages \'{", ".join(not_packages)}\' '
|
raise SystemExit(f'\n[{self.bred}Error{self.endc}]: Packages \'{", ".join(not_packages)}\' '
|
||||||
'does not exists.\n')
|
'does not exists.\n')
|
||||||
|
|
||||||
return slackbuilds
|
return slackbuilds
|
||||||
|
|
||||||
@staticmethod
|
def unsupported(self, slackbuilds: list) -> None:
|
||||||
def unsupported(slackbuilds: list) -> None:
|
|
||||||
""" Checking for unsupported slackbuilds. """
|
""" Checking for unsupported slackbuilds. """
|
||||||
for sbo in slackbuilds:
|
for sbo in slackbuilds:
|
||||||
sources = SBoQueries(sbo).sources()
|
sources = SBoQueries(sbo).sources()
|
||||||
|
|
||||||
if 'UNSUPPORTED' in sources:
|
if 'UNSUPPORTED' in sources:
|
||||||
raise SystemExit(f"\nError: Package '{sbo}' unsupported by arch.\n")
|
raise SystemExit(f"\n[{self.bred}Error{self.endc}]: Package '{sbo}' unsupported by arch.\n")
|
||||||
|
|
||||||
def installed(self, slackbuilds: list, file_pattern: str) -> list:
|
def installed(self, slackbuilds: list, file_pattern: str) -> list:
|
||||||
""" Checking for installed packages. """
|
""" Checking for installed packages. """
|
||||||
|
@ -58,7 +64,7 @@ class Check(Configs, Utilities):
|
||||||
not_found.append(sbo)
|
not_found.append(sbo)
|
||||||
|
|
||||||
if not_found:
|
if not_found:
|
||||||
raise SystemExit(f'\nError: Not found \'{", ".join(not_found)}\' '
|
raise SystemExit(f'\n[{self.bred}Error{self.endc}]: Not found \'{", ".join(not_found)}\' '
|
||||||
'installed packages.\n')
|
'installed packages.\n')
|
||||||
|
|
||||||
return found
|
return found
|
||||||
|
|
|
@ -152,7 +152,7 @@ class Slackbuilds(Configs):
|
||||||
slackbuild = Path(path_build_package, f'{sbo}.SlackBuild')
|
slackbuild = Path(path_build_package, f'{sbo}.SlackBuild')
|
||||||
os.chmod(slackbuild, 0o775)
|
os.chmod(slackbuild, 0o775)
|
||||||
else:
|
else:
|
||||||
print(f"[{self.red}Error{self.endc}]: package "
|
print(f"[{self.bred}Error{self.endc}]: package "
|
||||||
f"'{self.cyan}{sbo}{self.endc}' not found in the repository.")
|
f"'{self.cyan}{sbo}{self.endc}' not found in the repository.")
|
||||||
self.view_message.question()
|
self.view_message.question()
|
||||||
self.install_order.remove(sbo)
|
self.install_order.remove(sbo)
|
||||||
|
@ -337,7 +337,7 @@ class Slackbuilds(Configs):
|
||||||
def print_error(self) -> None:
|
def print_error(self) -> None:
|
||||||
""" Stop the process and print the error message. """
|
""" Stop the process and print the error message. """
|
||||||
if self.output != 0:
|
if self.output != 0:
|
||||||
raise SystemExit(f"\n[{self.red}FAILED{self.endc}]: {self.output}: {self.process_message}.\n")
|
raise SystemExit(f"\n[{self.bred}FAILED{self.endc}]: {self.output}: {self.process_message}.\n")
|
||||||
|
|
||||||
def choose_dependencies(self, dependencies: list) -> list:
|
def choose_dependencies(self, dependencies: list) -> list:
|
||||||
""" Choose packages for install. """
|
""" Choose packages for install. """
|
||||||
|
|
Loading…
Reference in a new issue