Commit 863dd770 authored by Giorgos Verigakis's avatar Giorgos Verigakis
Browse files

Switch to progress for progress bars

parent 098ca087
......@@ -80,8 +80,8 @@ from pwd import getpwuid
from sys import argv, exit, stdout, stderr
from clint import args
from clint.textui import progress
from colors import magenta, red, yellow
from import IncrementalBar
from requests.exceptions import ConnectionError
from kamaki import clients
......@@ -102,6 +102,10 @@ GROUPS = {
'astakos': "Astakos API commands"}
class ProgressBar(IncrementalBar):
suffix = '%(percent)d%% - %(eta)ds'
def command(api=None, group=None, name=None, syntax=None):
"""Class decorator that registers a class as a CLI command."""
......@@ -669,13 +673,10 @@ class _store_account_command(object):
"""Return a generator function to be used for progress tracking"""
def progress_gen(n):
msg = message.ljust(MESSAGE_LENGTH)
width = min(n, MAX_PROGRESS_LENGTH)
hide = self.config.get('global', 'silent') or (n < 2)
for i in, msg, width, hide):
for i in ProgressBar(msg).iter(range(n)):
......@@ -52,6 +52,7 @@ setup(
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment