mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-29 20:34:22 +01:00
Added total removable size
This commit is contained in:
parent
81ffc164fe
commit
22b0966027
2 changed files with 8 additions and 0 deletions
|
@ -1365,6 +1365,8 @@ enabled from configuration file.
|
|||
| Package Jinja2-2.7.3 removed
|
||||
| Package werkzeug-0.9.4 removed
|
||||
+==============================================================================
|
||||
| Total removable size 6.72 Mb
|
||||
+==============================================================================
|
||||
|
||||
Remove packages with by TAG:
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ class PackageManager(object):
|
|||
self.msg = Msg()
|
||||
self.skip = []
|
||||
self.size = 0
|
||||
self.total_size = 0
|
||||
self.unit = "Kb"
|
||||
|
||||
def install(self, flag):
|
||||
|
@ -202,9 +203,11 @@ class PackageManager(object):
|
|||
if self.size > 1024:
|
||||
self.unit = "Mb"
|
||||
self.size = (self.size / 1024)
|
||||
self.total_size += self.size
|
||||
if self.size > 1024:
|
||||
self.unit = "Gb"
|
||||
self.size = (self.size / 1024)
|
||||
self.total_size += self.size
|
||||
|
||||
def _remove_summary(self):
|
||||
"""Removed packge size summary
|
||||
|
@ -365,6 +368,9 @@ class PackageManager(object):
|
|||
else:
|
||||
print("| Package {0} not found".format(pkg))
|
||||
self.msg.template(78)
|
||||
print("| Total removable size {0} {1}".format(
|
||||
round(self.total_size, 2), self.unit))
|
||||
self.msg.template(78)
|
||||
print("") # new line at end
|
||||
|
||||
def find(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue