mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-15 03:41:16 +01:00
Added for total file size
This commit is contained in:
parent
b3f7ead910
commit
b0110980e9
2 changed files with 8 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
## slpkg - ChangeLog
|
## slpkg - ChangeLog
|
||||||
|
|
||||||
### 5.0.7 - 28/04/2024
|
### 5.0.7 - 01/05/2024
|
||||||
|
|
||||||
- Fixed:
|
- Fixed:
|
||||||
* Fixed raise error message instead toml error message
|
* Fixed raise error message instead toml error message
|
||||||
|
@ -9,6 +9,9 @@
|
||||||
- Updated:
|
- Updated:
|
||||||
* Improved code quality
|
* Improved code quality
|
||||||
|
|
||||||
|
- Added:
|
||||||
|
* Total file size with find command
|
||||||
|
|
||||||
|
|
||||||
### 5.0.6 - 19/04/2024
|
### 5.0.6 - 19/04/2024
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ class FindInstalled(Configs):
|
||||||
|
|
||||||
self.utils = Utilities()
|
self.utils = Utilities()
|
||||||
self.matching: list = []
|
self.matching: list = []
|
||||||
|
self.total_size: int = 0
|
||||||
|
|
||||||
self.option_for_no_case: bool = self.utils.is_option(
|
self.option_for_no_case: bool = self.utils.is_option(
|
||||||
('-m', '--no-case'), flags)
|
('-m', '--no-case'), flags)
|
||||||
|
@ -47,6 +48,7 @@ class FindInstalled(Configs):
|
||||||
name: str = self.utils.split_package(package)['name']
|
name: str = self.utils.split_package(package)['name']
|
||||||
pkg_size: int = self.utils.count_file_size(name)
|
pkg_size: int = self.utils.count_file_size(name)
|
||||||
size: str = self.utils.convert_file_sizes(pkg_size)
|
size: str = self.utils.convert_file_sizes(pkg_size)
|
||||||
|
self.total_size += pkg_size
|
||||||
print(f'{self.cyan}{package}{self.endc} ({size})')
|
print(f'{self.cyan}{package}{self.endc} ({size})')
|
||||||
self.view_summary()
|
self.view_summary()
|
||||||
else:
|
else:
|
||||||
|
@ -55,7 +57,8 @@ class FindInstalled(Configs):
|
||||||
def view_summary(self) -> None:
|
def view_summary(self) -> None:
|
||||||
""" Prints the summary.
|
""" 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:
|
def is_not_case_sensitive(self, package: str, name: str) -> bool:
|
||||||
""" Checks for case sensitive.
|
""" Checks for case sensitive.
|
||||||
|
|
Loading…
Reference in a new issue