Fixed for searching

This commit is contained in:
Dimitris Zlatanidis 2023-03-28 08:06:59 +03:00
parent 2a02e51ea2
commit 38f2678247
2 changed files with 7 additions and 7 deletions

View file

@ -443,7 +443,7 @@ class Argparse(Configs):
if self.binary_repo == '*':
repo_ver: str = ''
choices += [(pr[0], repo_ver, False, f'Package: {pr[0]}-{repo_ver} > {pr[1]}')]
choices += [(pr[0], repo_ver, False, f'Package: {pr[0]} {repo_ver} > {pr[1]}')]
else:
for pkg in packages:

View file

@ -9,7 +9,7 @@ from slpkg.binaries.queries import BinQueries
class SearchPackage(Configs):
""" Search slackbuilds from the repository. """
""" Search packages from the repositories. """
def __init__(self, flags=None):
super(Configs, self).__init__()
@ -30,6 +30,7 @@ class SearchPackage(Configs):
def package(self, packages: list, repo='*') -> None:
""" Searching and print the matched slackbuilds. """
matching: int = 0
repository: str = ''
print(f'The list below shows the repo '
f'packages that contains \'{", ".join([p for p in packages])}\':\n')
@ -47,7 +48,10 @@ class SearchPackage(Configs):
desc: str = BinQueries(pr[0], pr[1]).description()
version: str = BinQueries(pr[0], pr[1]).version()
print(f'{pr[1]}: {self.cyan}{pr[0]}{self.endc}-{self.yellow}{version}{self.endc}'
if repo == '*':
repository: str = f'{pr[1]}: '
print(f'{repository}{self.cyan}{pr[0]}{self.endc}-{self.yellow}{version}{self.endc}'
f'{self.green}{desc}{self.endc}')
else:
# Searching for slackbuilds.
@ -61,10 +65,6 @@ class SearchPackage(Configs):
desc: str = SBoQueries(name).description().replace(name, '')
version: str = SBoQueries(name).version()
if self.utils.is_option(self.flag_bin_repository, self.flags):
desc: str = BinQueries(name, repo).description()
version: str = BinQueries(name, repo).version()
print(f'{self.repos.sbo_enabled_repository}: {self.cyan}{name}{self.endc}-{self.yellow}'
f'{version}{self.endc}{self.green}{desc}{self.endc}')