Added package size

This commit is contained in:
Dimitris Zlatanidis 2023-03-27 12:09:01 +03:00
parent aee6a38ec1
commit f610a89d38
2 changed files with 9 additions and 6 deletions

View file

@ -66,13 +66,14 @@ class Ascii(Configs):
self.draw_middle_line()
print(f'{self.bgreen}{self.vertical_line}{self.endc} Package:' + ' ' * 27 + 'Version:' +
' ' * (self.columns - 57) + f'Repository{self.bgreen} {self.vertical_line}{self.endc}')
print(f'{self.bgreen}{self.vertical_line}{self.endc} Package:' + ' ' * 22 + 'Version:' +
' ' * (self.columns - 65) + 'Size:' + ' ' * 13 + f'Repo:{self.bgreen} {self.vertical_line}{self.endc}')
def draw_view_package(self, package: str, version: str, color: str, repo: str) -> None:
def draw_view_package(self, package: str, version: str, size: str, color: str, repo: str) -> None:
""" Draw nad print the packages. """
print(f'{self.bgreen}{self.vertical_line} {self.bold}{color}{package}{self.endc}' + ' ' * (35 - len(package)) +
f'{self.bgreen}{version}' + ' ' * ((self.columns - 39) - len(version) - len(repo)) +
print(f'{self.bgreen}{self.vertical_line} {self.bold}{color}{package}{self.endc}' + ' ' * (30 - len(package)) +
f'{self.bgreen}{version}' + ' ' * ((self.columns - 50) - len(version) - len(repo)) +
f'{self.endc}{size}' + ' ' * (16 - len(size)) +
f'{self.blue}{repo} {self.bgreen}{self.vertical_line}{self.endc}')
def draw_log_package(self, package: str) -> None:

View file

@ -45,10 +45,12 @@ class ViewMessage(Configs):
def view_packages(self, package: str, mode: str) -> None:
""" Printing the main packages. """
size: str = ''
color: str = self.red
if self.utils.is_option(self.flag_binary, self.flags):
version: str = BinQueries(package).version()
size: str = BinQueries(package).size_comp()
repo: str = BinQueries(package).repository()
else:
version: str = SBoQueries(package).version()
@ -65,7 +67,7 @@ class ViewMessage(Configs):
if package in self.utils.installed_package_names and mode == 'install':
color = self.grey
self.ascii.draw_view_package(package, version, color, repo)
self.ascii.draw_view_package(package, version, size, color, repo)
def view_skipping_packages(self, package: str, version: str) -> None:
""" Print the skipping packages. """