From 22b0966027e853d04f2161da4cb44e4c7c0e4af9 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 25 Aug 2015 05:14:04 +0300 Subject: [PATCH] Added total removable size --- README.rst | 2 ++ slpkg/pkg/manager.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/README.rst b/README.rst index e828a020..cdb1e916 100644 --- a/README.rst +++ b/README.rst @@ -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: diff --git a/slpkg/pkg/manager.py b/slpkg/pkg/manager.py index 04d7ba3f..8c4346d6 100644 --- a/slpkg/pkg/manager.py +++ b/slpkg/pkg/manager.py @@ -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):