From 0878fe38fd92d67254503f1aac0fbe7e5d238693 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Mon, 8 May 2023 11:56:06 +0300 Subject: [PATCH] Updated for values --- slpkg/views/view_package.py | 41 ++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/slpkg/views/view_package.py b/slpkg/views/view_package.py index 7538cd7b..201f5615 100644 --- a/slpkg/views/view_package.py +++ b/slpkg/views/view_package.py @@ -28,7 +28,6 @@ class ViewPackage(Configs): self.repos.sbo_repo_name: self.repos.sbo_repo_tar_suffix, self.repos.ponce_repo_name: '' } - repo_tar_suffix: str = repo[self.repository] for sbo in slackbuilds: @@ -44,7 +43,6 @@ class ViewPackage(Configs): description: str = value[8] if sbo == name or sbo == '*': - path = Path(self.repos.repositories[self.repository][1], location, name, 'README') readme = self.utils.read_file(path) @@ -91,23 +89,34 @@ class ViewPackage(Configs): """ View binary packages information. """ for package in packages: 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: 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' - f'Version: {self.green}{value[0]}{self.endc}\n' - f'Package: {self.cyan}{value[1]}{self.endc}\n' - f'Download: {self.blue}{value[2]}{value[3]}/{value[1]}{self.endc}\n' - f'Md5sum: {value[10]}\n' - f'Mirror: {self.blue}{value[2]}{self.endc}\n' - f'Location: {self.red}{value[3]}{self.endc}\n' - f'Size Comp: {value[4]}\n' - f'Size Uncomp: {value[5]}\n' + f'Version: {self.green}{version}{self.endc}\n' + f'Package: {self.cyan}{binary}{self.endc}\n' + f'Download: {self.blue}{mirror}{location}/{binary}{self.endc}\n' + f'Md5sum: {checksum}\n' + f'Mirror: {self.blue}{mirror}{self.endc}\n' + f'Location: {self.red}{location}{self.endc}\n' + f'Size Comp: {size_comp}\n' + f'Size Uncomp: {size_uncomp}\n' f'Requires: {self.green}{deps}{self.endc}\n' - f'Conflicts: {value[7]}\n' - f'Suggests: {value[8]}\n' - f'Description: {value[9]}\n') + f'Conflicts: {conflicts}\n' + f'Suggests: {suggests}\n' + f'Description: {description}\n')