mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Added colors
This commit is contained in:
parent
a9c9c66584
commit
232c5a9eb9
1 changed files with 7 additions and 5 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Reference in a new issue