mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-27 19:58:21 +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}")
|
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:
|
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]}...'
|
version: str = f'{version[:self.version_alignment - 5]}...'
|
||||||
if len(package) >= 15 and self.columns <= 80:
|
if len(package) >= (self.package_alignment - 4):
|
||||||
package: str = f'{package[:self.package_alignment - 5]}...'
|
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}"
|
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"{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}")
|
f"{repo:>{self.repo_alignment}}{self.bd_color} {self.vertical_line}{self.endc}")
|
||||||
|
|
Loading…
Add table
Reference in a new issue