mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-18 10:26:29 +01:00
Summary for size of removed package
This commit is contained in:
parent
4168f02298
commit
516aac0355
2 changed files with 17 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
Added:
|
||||
- Support httpie for downloading
|
||||
- Remove packages with by TAG
|
||||
- Summary for size of removed package
|
||||
Fixed:
|
||||
- Resolving dependencies message for sbo repository when search for matching
|
||||
packages
|
||||
|
|
|
@ -142,7 +142,7 @@ class PackageManager(object):
|
|||
def _view_removed(self):
|
||||
"""View packages before removed
|
||||
"""
|
||||
removed = []
|
||||
removed, unit = [], "Kb"
|
||||
print("\nPackages with name matching [ {0}{1}{2} ]\n".format(
|
||||
self.meta.color["CYAN"], ", ".join(self.binary),
|
||||
self.meta.color["ENDC"]))
|
||||
|
@ -154,6 +154,7 @@ class PackageManager(object):
|
|||
self.meta.color["RED"], self.meta.color["ENDC"],
|
||||
pkg))
|
||||
removed.append(split_package(pkg)[0])
|
||||
self._sizes(pkg)
|
||||
if not removed:
|
||||
Msg().pkg_not_found("", tag, "Can't remove", "")
|
||||
else:
|
||||
|
@ -167,10 +168,24 @@ class PackageManager(object):
|
|||
self.meta.color["RED"], self.meta.color["ENDC"],
|
||||
package[0]))
|
||||
removed.append(pkg)
|
||||
self._sizes(package[0])
|
||||
else:
|
||||
Msg().pkg_not_found("", pkg, "Can't remove", "")
|
||||
if self.size > 1024:
|
||||
unit = "Mb"
|
||||
self.size = (self.size / 1024)
|
||||
self._remove_summary(unit)
|
||||
return removed
|
||||
|
||||
def _remove_summary(self, unit):
|
||||
"""Removed packge size summary
|
||||
"""
|
||||
print("\nSummary")
|
||||
print("=" * 79)
|
||||
print("{0}Size of removed packages {1} {2}.{3}".format(
|
||||
self.meta.color["GREY"], round(self.size, 2), unit,
|
||||
self.meta.color["ENDC"]))
|
||||
|
||||
def _view_deps(self, path, package):
|
||||
"""View dependencies for before remove
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue