diff -r a1783dab9ba6 -r c98ddd4a9513 gmyth-stream/server/0.2/lib/utils.py --- a/gmyth-stream/server/0.2/lib/utils.py Mon Apr 23 16:06:54 2007 +0100 +++ b/gmyth-stream/server/0.2/lib/utils.py Tue May 15 15:45:34 2007 +0100 @@ -159,3 +159,16 @@ return "HTML format error. Wrong keys: %s" % e # getHTML + +def progress_bar(log, value, max, barsize): + chars = int(value * barsize / float(max)) + percent = int((value / float(max)) * 100) + sys.stdout.write("#" * chars) + sys.stdout.write(" " * (barsize - chars + 2)) + if value >= max: + sys.stdout.write("done. \n\n") + else: + sys.stdout.write("[%3i%%]\r" % (percent)) + sys.stdout.flush() + +# progress_bar by osantana