mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Fixed alignment in search command
This commit is contained in:
parent
6f3717785f
commit
cb01d0e84f
2 changed files with 8 additions and 1 deletions
|
@ -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:
|
||||
|
|
|
@ -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}')
|
||||
|
|
Loading…
Add table
Reference in a new issue