mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-29 20:34:22 +01:00
Updated for auto alignment
This commit is contained in:
parent
fa45d494ba
commit
a0e90e2cb7
1 changed files with 4 additions and 1 deletions
|
@ -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. """
|
||||
|
|
Loading…
Add table
Reference in a new issue