fixed progress

master
Malar Kannan 2017-10-26 16:18:17 +05:30
parent 7a520b79f4
commit a953fa3355
1 changed files with 5 additions and 5 deletions

View File

@ -15,12 +15,12 @@ dest_file = './outputs/' + OUTPUT_NAME + '.csv'
def prog_bar(title): def prog_bar(title):
widgets = [progressbar.FormatLabel( widgets = [title,progressbar.Counter(),'th entry - ', progressbar.FormatLabel(
title), ' [', progressbar.Bar(), '] - ', progressbar.ETA()] ''), ' [', progressbar.Bar(), '] - ', progressbar.ETA()]
prog = progressbar.ProgressBar(widgets=widgets) prog = progressbar.ProgressBar(widgets=widgets)
def update_prog(current): def update_prog(current):
widgets[0] = progressbar.FormatLabel('{} : {}'.format(title, current)) widgets[3] = progressbar.FormatLabel(current)
prog.update() prog.update()
return (update_prog, prog) return (update_prog, prog)
@ -36,7 +36,7 @@ def dest_filename(w, v, r, t):
def dest_path(v, r, n): def dest_path(v, r, n):
rel = v + '/' + str(r) + '/' + n rel = v + '/' + str(r) + '/' + n
return (dest_dir + rel), rels return (dest_dir + rel), rel
def cli_gen_audio(speech_cmd, rate, voice, out_path): def cli_gen_audio(speech_cmd, rate, voice, out_path):
@ -157,7 +157,7 @@ def synth_generator():
def synth_for_words(words, writer): def synth_for_words(words, writer):
# all_synths = [] # all_synths = []
prog_title = "Synthesizing {} words, current word".format(len(words)) prog_title = "Synthesizing {} words : ".format(len(words))
(update, prog) = prog_bar(prog_title) (update, prog) = prog_bar(prog_title)
for w in prog(words): for w in prog(words):
for s in voice_synths: for s in voice_synths: