mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-27 09:58:10 +01:00
Fix for binary file size
This commit is contained in:
parent
e4aac99703
commit
cf14800f19
2 changed files with 5 additions and 4 deletions
|
@ -153,7 +153,7 @@ class Utilities(Configs):
|
|||
return count_files
|
||||
|
||||
@staticmethod
|
||||
def convert_file_sizes(byte_size: int) -> str:
|
||||
def convert_file_sizes(byte_size: float) -> str:
|
||||
"""
|
||||
Convert bytes to kb, mb and gb.
|
||||
Args:
|
||||
|
|
|
@ -120,7 +120,8 @@ class View(Configs):
|
|||
upgradable: bool = self.upgrade.is_package_upgradeable(installed)
|
||||
|
||||
if self.repository not in [self.repos.sbo_repo_name, self.repos.ponce_repo_name]:
|
||||
size: str = self.utils.convert_file_sizes(int(self.data[package]['size_comp']))
|
||||
size_comp: float = float(self.data[package]['size_comp']) * 1024
|
||||
size: str = self.utils.convert_file_sizes(size_comp)
|
||||
|
||||
if installed:
|
||||
color: str = self.grey
|
||||
|
@ -170,8 +171,8 @@ class View(Configs):
|
|||
installed: str = self.utils.is_package_installed(pkg)
|
||||
|
||||
if self.repository not in list(self.repos.repositories.keys())[:2] and self.repository is not None:
|
||||
size_comp += int(self.data[pkg]['size_comp'])
|
||||
size_uncomp += int(self.data[pkg]['size_uncomp'])
|
||||
size_comp += float(self.data[pkg]['size_comp']) * 1024
|
||||
size_uncomp += float(self.data[pkg]['size_uncomp']) * 1024
|
||||
|
||||
if installed and option == 'remove':
|
||||
size_rmv += self.utils.count_file_size(pkg)
|
||||
|
|
Loading…
Reference in a new issue