Skip to content

Commit

Permalink
#17 add func for progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
gingeleski committed Mar 3, 2019
1 parent 5c6d22b commit 1c7d821
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions conspiracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ def console_print(message, level='INFO', line_end='\n'):
for line in split_lines:
print('[Conspiracy] ' + line, end=line_end)

def console_progress_bar(count, total):
bar_length = 60
filled_length = int(round(bar_len * count / float(total)))
percents = round(100.0 * count / float(total), 1)
bar = '=' * filled_length + '-' * (bar_length - filled_length)
sys.stdout.write('[%s] %s%s\r' % (bar, percents, '%'))
sys.stdout.flush()

def log_info(message):
split_lines = message.split('\n')
for line in split_lines:
Expand Down

0 comments on commit 1c7d821

Please sign in to comment.