diff --git a/slpkg/repo_info.py b/slpkg/repo_info.py index 362419f3..5f270ce8 100644 --- a/slpkg/repo_info.py +++ b/slpkg/repo_info.py @@ -22,7 +22,7 @@ class RepoInfo(Configs): self.utils = Utilities() self.repos = Repositories() self.columns, self.rows = shutil.get_terminal_size() - self.name_alignment: int = (self.columns - 80) + 18 + self.name_alignment: int = self.columns - 62 if self.name_alignment < 1: self.name_alignment: int = 1 diff --git a/slpkg/views/ascii.py b/slpkg/views/ascii.py index 47cb2fcd..763fbfe0 100644 --- a/slpkg/views/ascii.py +++ b/slpkg/views/ascii.py @@ -11,8 +11,8 @@ class Ascii(Configs): def __init__(self): super(Configs, self).__init__() self.columns, self.rows = shutil.get_terminal_size() - self.package_alignment: int = (self.columns - 80) + 25 - self.version_alignment: int = 27 + self.package_alignment: int = self.columns - 61 + self.version_alignment: int = 33 self.size_alignment: int = 14 self.repo_alignment: int = 10 @@ -53,17 +53,15 @@ class Ascii(Configs): print(f"{self.vertical_line} {self.endc}{message.ljust(self.columns - 3, ' ')}" f"{self.bgreen}{self.vertical_line}") self.draw_middle_line() - print(f"{self.bgreen}{self.vertical_line}{self.endc} {'Package:':<{self.package_alignment}}" f"{'Version:':<{self.version_alignment}}{'Size:':<{self.size_alignment}}{'Repo:':>{self.repo_alignment}} " f"{self.bgreen}{self.vertical_line}{self.endc}") def draw_package_line(self, package: str, version: str, size: str, color: str, repo: str) -> None: - if len(version) >= 11 and self.columns <= 80: + if len(version) >= 20 and self.columns <= 80: version: str = f'{version[:self.version_alignment - 5]}...' - if len(package) >= 20 and self.columns <= 80: + if len(package) >= 15 and self.columns <= 80: package: str = f'{package[:self.package_alignment - 5]}...' - print(f"{self.bgreen}{self.vertical_line} {self.bold}{color}{package:<{self.package_alignment}}{self.endc}" f"{self.bgreen}{version:<{self.version_alignment}}{self.endc}{size:<{self.size_alignment}}{self.blue}" f"{repo:>{self.repo_alignment}}{self.bgreen} {self.vertical_line}{self.endc}")