Added disable progress status bar

This commit is contained in:
Dimitris Zlatanidis 2015-07-18 03:34:55 +03:00
parent ed3f5ca56c
commit 242159e17c
4 changed files with 21 additions and 13 deletions

View file

@ -112,3 +112,7 @@ SLACKPKG_LOG=on
# NOTE: This option is not recommended at "on" because it can leave out
# packages required for distribution.
ONLY_INSTALLED=off
# Enable or disable the progress bar. Status bar progress delays the search
# process in package lists. Choose "off" if you need speed. Deafult is "on".
PRG_BAR=on

View file

@ -88,7 +88,7 @@ class MetaData(object):
__all__ = "slpkg"
__author__ = "dslackw"
__version_info__ = (2, 6, 2)
__version_info__ = (2, 6, 3)
__version__ = "{0}.{1}.{2}".format(*__version_info__)
__license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com"
@ -129,7 +129,8 @@ class MetaData(object):
"DOWNDER": "wget",
"DOWNDER_OPTIONS": "-c -N",
"SLACKPKG_LOG": "on",
"ONLY_INSTALLED": "off"
"ONLY_INSTALLED": "off",
"PRG_BAR": "off"
}
default_repositories = ["slack", "sbo", "rlw", "alien", "slacky", "studio",
@ -170,6 +171,7 @@ class MetaData(object):
downder_options = _conf_slpkg["DOWNDER_OPTIONS"]
slackpkg_log = _conf_slpkg["SLACKPKG_LOG"]
only_installed = _conf_slpkg["ONLY_INSTALLED"]
prg_bar = _conf_slpkg["PRG_BAR"]
# Remove any gaps
repositories = [repo.strip() for repo in repositories]

View file

@ -60,7 +60,8 @@ class Config(object):
"DOWNDER",
"DOWNDER_OPTIONS",
"SLACKPKG_LOG",
"ONLY_INSTALLED"
"ONLY_INSTALLED",
"PRG_BAR"
]
read_conf = Utils().read_file(self.config_file)
try:

View file

@ -31,13 +31,14 @@ from __metadata__ import MetaData as _meta_
def status(sec):
"""Toolbar progressive status
"""
try:
syms = ["\\", "|", "/", "-"]
for sym in syms:
sys.stdout.write("\b{0}{1}{2}".format(_meta_.color["GREY"], sym,
_meta_.color["ENDC"]))
sys.stdout.flush()
time.sleep(float(sec))
except KeyboardInterrupt:
print("")
sys.exit(0)
if _meta_.prg_bar in ["on", "ON"]:
try:
syms = ["\\", "|", "/", "-"]
for sym in syms:
sys.stdout.write("\b{0}{1}{2}".format(_meta_.color["GREY"], sym,
_meta_.color["ENDC"]))
sys.stdout.flush()
time.sleep(float(sec))
except KeyboardInterrupt:
print("")
sys.exit(0)