Added colors

This commit is contained in:
Dimitris Zlatanidis 2023-01-13 17:56:21 +02:00
parent a9c9c66584
commit 232c5a9eb9

View file

@ -10,12 +10,14 @@ class SearchPackage:
def __init__(self):
self.colors = Configs.colour
self.color = self.colors()
self.yellow = self.color['yellow']
self.cyan = self.color['cyan']
self.endc = self.color['endc']
self.green = self.color['green']
def package(self, packages: list):
""" Searching and print the matched slackbuilds. """
color = self.colors()
cyan = color['cyan']
endc = color['endc']
matching = 0
names = SBoQueries('').sbos()
@ -28,7 +30,7 @@ class SearchPackage:
if package in name:
matching += 1
desc = SBoQueries(name).description().replace(name, '')
print(f'{name}-{SBoQueries(name).version()}'
f'{cyan}{desc}{endc}')
print(f'{self.cyan}{name}{self.endc}-{self.yellow}{SBoQueries(name).version()}{self.endc}'
f'{self.green}{desc}{self.endc}')
if not matching:
print('\nDoes not match any package.\n')