Update toolbar status

This commit is contained in:
Dimitris Zlatanidis 2015-07-06 06:15:50 +03:00
parent d4144c1052
commit 2247f5d797
3 changed files with 13 additions and 7 deletions

View file

@ -50,7 +50,7 @@ def pkg_upgrade(repo, skip):
# unsize = data[3]
data = repo_data(PACKAGES_TXT, repo, flag="")
for pkg in installed():
status(0.0003)
status(0.0005)
inst_pkg = split_package(pkg)
for name in data[0]:
if name: # this tips because some pkg_name is empty

View file

@ -40,7 +40,7 @@ def repo_data(PACKAGES_TXT, repo, flag):
rname, rlocation, rsize, runsize) = ([] for i in range(8))
for line in PACKAGES_TXT.splitlines():
if _meta_.rsl_deps in ["on", "ON"] and flag != "--resolve-off":
status(0.000000005)
status(0.000005)
if line.startswith("PACKAGE NAME:"):
name.append(line[15:].strip())
if line.startswith("PACKAGE LOCATION:"):

View file

@ -27,8 +27,14 @@ import time
def status(sec):
syms = ["\\", "|", "/", "-"]
for sym in syms:
sys.stdout.write("\b{0}".format(sym))
sys.stdout.flush()
time.sleep(float(sec))
"""Toolbar progressive status
"""
try:
syms = ["\\", "|", "/", "-"]
for sym in syms:
sys.stdout.write("\b{0}".format(sym))
sys.stdout.flush()
time.sleep(float(sec))
except KeyboardInterrupt:
print("")
sys.exit(0)