Added for total file size

This commit is contained in:
Dimitris Zlatanidis 2024-05-01 11:01:18 +03:00
parent b3f7ead910
commit b0110980e9
2 changed files with 8 additions and 2 deletions

View file

@ -1,6 +1,6 @@
## slpkg - ChangeLog
### 5.0.7 - 28/04/2024
### 5.0.7 - 01/05/2024
- Fixed:
* Fixed raise error message instead toml error message
@ -9,6 +9,9 @@
- Updated:
* Improved code quality
- Added:
* Total file size with find command
### 5.0.6 - 19/04/2024

View file

@ -18,6 +18,7 @@ class FindInstalled(Configs):
self.utils = Utilities()
self.matching: list = []
self.total_size: int = 0
self.option_for_no_case: bool = self.utils.is_option(
('-m', '--no-case'), flags)
@ -47,6 +48,7 @@ class FindInstalled(Configs):
name: str = self.utils.split_package(package)['name']
pkg_size: int = self.utils.count_file_size(name)
size: str = self.utils.convert_file_sizes(pkg_size)
self.total_size += pkg_size
print(f'{self.cyan}{package}{self.endc} ({size})')
self.view_summary()
else:
@ -55,7 +57,8 @@ class FindInstalled(Configs):
def view_summary(self) -> None:
""" Prints the summary.
"""
print(f'\n{self.grey}Total found {len(self.matching)} packages.{self.endc}')
print(f'\n{self.grey}Total found {len(self.matching)} packages with '
f'{self.utils.convert_file_sizes(self.total_size)} size.{self.endc}')
def is_not_case_sensitive(self, package: str, name: str) -> bool:
""" Checks for case sensitive.