Use reverse bar on uninstalls...
This commit is contained in:
parent
a714aae75d
commit
a2fc6a8c2d
devstack
@ -405,7 +405,7 @@ class PkgUninstallComponent(ComponentBase):
|
||||
LOG.info("Potentially removing %s packages (%s)",
|
||||
len(pkg_names), ", ".join(pkg_names))
|
||||
which_removed = set()
|
||||
with utils.progress_bar(UNINSTALL_TITLE, len(pkgs)) as p_bar:
|
||||
with utils.progress_bar(UNINSTALL_TITLE, len(pkgs), reverse=True) as p_bar:
|
||||
for (i, p) in enumerate(pkgs):
|
||||
if self.packager.remove(p):
|
||||
which_removed.add(p['name'])
|
||||
@ -452,7 +452,7 @@ class PythonUninstallComponent(PkgUninstallComponent):
|
||||
if pips:
|
||||
names = set([p['name'] for p in pips])
|
||||
LOG.info("Uninstalling %s python packages (%s)" % (len(names), ", ".join(names)))
|
||||
with utils.progress_bar(UNINSTALL_TITLE, len(pips)) as p_bar:
|
||||
with utils.progress_bar(UNINSTALL_TITLE, len(pips), reverse=True) as p_bar:
|
||||
for (i, p) in enumerate(pips):
|
||||
pip.uninstall(p, self.distro)
|
||||
p_bar.update(i + 1)
|
||||
|
@ -142,12 +142,17 @@ def to_bytes(text):
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def progress_bar(name, max_am):
|
||||
widgets = [
|
||||
'%s: ' % (name), progressbar.Percentage(),
|
||||
' ', progressbar.Bar(),
|
||||
' ', progressbar.ETA(),
|
||||
]
|
||||
def progress_bar(name, max_am, reverse=False):
|
||||
widgets = list()
|
||||
widgets.append('%s: ' % (name))
|
||||
widgets.append(progressbar.Percentage())
|
||||
widgets.append(' ')
|
||||
if reverse:
|
||||
widgets.append(progressbar.ReverseBar())
|
||||
else:
|
||||
widgets.append(progressbar.Bar())
|
||||
widgets.append(' ')
|
||||
widgets.append(progressbar.ETA())
|
||||
p_bar = progressbar.ProgressBar(maxval=max_am, widgets=widgets)
|
||||
p_bar.start()
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user