mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-13 20:01:48 +01:00
Fixed package and version alignment
This commit is contained in:
parent
137b6c6d46
commit
5bde928311
1 changed files with 4 additions and 3 deletions
|
@ -90,10 +90,11 @@ class AsciiBox(Configs):
|
|||
f"{self.bd_color}{self.vertical_line}{self.endc}")
|
||||
|
||||
def draw_package_line(self, package: str, version: str, size: str, color: str, repo: str) -> None:
|
||||
if len(version) >= 20 and self.columns <= 80:
|
||||
if len(version) >= (self.version_alignment - 5):
|
||||
version: str = f'{version[:self.version_alignment - 5]}...'
|
||||
if len(package) >= 15 and self.columns <= 80:
|
||||
package: str = f'{package[:self.package_alignment - 5]}...'
|
||||
if len(package) >= (self.package_alignment - 4):
|
||||
package: str = f'{package[:self.package_alignment - 4]}...'
|
||||
|
||||
print(f"{self.bd_color}{self.vertical_line} {self.bold}{color}{package:<{self.package_alignment}}{self.endc}"
|
||||
f"{self.bd_color}{version:<{self.version_alignment}}{self.endc}{size:<{self.size_alignment}}{self.blue}"
|
||||
f"{repo:>{self.repo_alignment}}{self.bd_color} {self.vertical_line}{self.endc}")
|
||||
|
|
Loading…
Reference in a new issue