Added total removable size

This commit is contained in:
Dimitris Zlatanidis 2015-08-25 05:14:04 +03:00
parent 81ffc164fe
commit 22b0966027
2 changed files with 8 additions and 0 deletions

View file

@ -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:

View file

@ -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):