Updated for values

This commit is contained in:
Dimitris Zlatanidis 2023-05-08 11:56:06 +03:00
parent 515c3475f7
commit 0878fe38fd

View file

@ -28,7 +28,6 @@ class ViewPackage(Configs):
self.repos.sbo_repo_name: self.repos.sbo_repo_tar_suffix, self.repos.sbo_repo_name: self.repos.sbo_repo_tar_suffix,
self.repos.ponce_repo_name: '' self.repos.ponce_repo_name: ''
} }
repo_tar_suffix: str = repo[self.repository] repo_tar_suffix: str = repo[self.repository]
for sbo in slackbuilds: for sbo in slackbuilds:
@ -44,7 +43,6 @@ class ViewPackage(Configs):
description: str = value[8] description: str = value[8]
if sbo == name or sbo == '*': if sbo == name or sbo == '*':
path = Path(self.repos.repositories[self.repository][1], location, name, 'README') path = Path(self.repos.repositories[self.repository][1], location, name, 'README')
readme = self.utils.read_file(path) readme = self.utils.read_file(path)
@ -91,23 +89,34 @@ class ViewPackage(Configs):
""" View binary packages information. """ """ View binary packages information. """
for package in packages: for package in packages:
for name, value in data.items(): for name, value in data.items():
if package == name or package == '*': version: str = value[0]
binary: str = value[1]
mirror: str = value[2]
location: str = value[3]
size_comp: str = value[4]
size_uncomp: str = value[5]
required: str = value[6]
conflicts: str = value[7]
suggests: str = value[8]
description: str = value[9]
checksum: str = value[10]
deps: str = (', '.join([f'{self.cyan}{pkg}' for pkg in value[6].split()])) if package == name or package == '*':
deps: str = (', '.join([f'{self.cyan}{pkg}' for pkg in required.split()]))
if self.option_for_pkg_version: if self.option_for_pkg_version:
deps: str = (', '.join([f'{self.cyan}{pkg}{self.endc} {self.yellow}{data[pkg][0]}' deps: str = (', '.join([f'{self.cyan}{pkg}{self.endc} {self.yellow}{data[pkg][0]}'
f'{self.green}' for pkg in value[6].split()])) f'{self.green}' for pkg in required.split()]))
print(f'Name: {self.green}{name}{self.endc}\n' print(f'Name: {self.green}{name}{self.endc}\n'
f'Version: {self.green}{value[0]}{self.endc}\n' f'Version: {self.green}{version}{self.endc}\n'
f'Package: {self.cyan}{value[1]}{self.endc}\n' f'Package: {self.cyan}{binary}{self.endc}\n'
f'Download: {self.blue}{value[2]}{value[3]}/{value[1]}{self.endc}\n' f'Download: {self.blue}{mirror}{location}/{binary}{self.endc}\n'
f'Md5sum: {value[10]}\n' f'Md5sum: {checksum}\n'
f'Mirror: {self.blue}{value[2]}{self.endc}\n' f'Mirror: {self.blue}{mirror}{self.endc}\n'
f'Location: {self.red}{value[3]}{self.endc}\n' f'Location: {self.red}{location}{self.endc}\n'
f'Size Comp: {value[4]}\n' f'Size Comp: {size_comp}\n'
f'Size Uncomp: {value[5]}\n' f'Size Uncomp: {size_uncomp}\n'
f'Requires: {self.green}{deps}{self.endc}\n' f'Requires: {self.green}{deps}{self.endc}\n'
f'Conflicts: {value[7]}\n' f'Conflicts: {conflicts}\n'
f'Suggests: {value[8]}\n' f'Suggests: {suggests}\n'
f'Description: {value[9]}\n') f'Description: {description}\n')