Fixed alignment in search command

This commit is contained in:
Dimitris Zlatanidis 2024-04-07 21:45:16 +03:00
parent 6f3717785f
commit cb01d0e84f
2 changed files with 8 additions and 1 deletions

View file

@ -6,6 +6,7 @@
- Updated:
* Updated to exclude packages from slack_extra repository (Thanks to Marav)
* Fixed alignment in search command
### 5.0.4 - 04/04/2024
- Updated:

View file

@ -55,13 +55,19 @@ class SearchPackage(Configs):
}
def summary_of_searching(self) -> None:
try:
repo_length: int = max(len(repo['repository']) for repo in self.data_dict.values())
except ValueError:
repo_length: int = 1
try:
name_length: int = max(len(name['name']) for name in self.data_dict.values())
except ValueError:
name_length: int = 1
if self.matching:
for item in self.data_dict.values():
print(f"{item['repository']}: {self.cyan}{item['name']:<{name_length}}{self.endc} "
print(f"{item['repository']:<{repo_length}}: {self.cyan}{item['name']:<{name_length}}{self.endc} "
f"{self.yellow}{item['version']}{self.endc}")
print(f'\n{self.grey}Total found {self.matching} packages.{self.endc}')