Updated for auto alignment

This commit is contained in:
Dimitris Zlatanidis 2023-05-11 22:54:17 +03:00
parent fa45d494ba
commit a0e90e2cb7

View file

@ -11,6 +11,7 @@ class Ascii(Configs):
def __init__(self):
super(Configs, self).__init__()
self.columns, self.rows = shutil.get_terminal_size()
self.auto_alignment: int = (self.columns - 80) + 30
self.vertical_line: str = '|'
self.horizontal_line: str = '='
@ -51,7 +52,9 @@ class Ascii(Configs):
self.draw_middle_line()
print(f'{self.bgreen}{self.vertical_line}{self.endc} Package:' + ' ' * 22 + 'Version:' + ' ' * (self.columns - 66) + 'Size:' + ' ' * 14 + f'Repo:{self.bgreen} {self.vertical_line}{self.endc}')
print(f"{self.bgreen}{self.vertical_line}{self.endc} {'Package:':<{self.auto_alignment}}{'Version:':<22}{'Size:':<14}{'Repo:':>10} {self.bgreen}{self.vertical_line}{self.endc}")
exit()
def draw_package_line(self, package: str, version: str, size: str, color: str, repo: str) -> None:
""" Draw nad print the packages. """