X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/1a949f7c97dc2f34c135f5cdf088df2927d3d652..9f1d9b668a5de15e370dc0cd85997f458bbb2c98:/forum/migrations/__init__.py?ds=inline diff --git a/forum/migrations/__init__.py b/forum/migrations/__init__.py index e69de29..99b09c1 100644 --- a/forum/migrations/__init__.py +++ b/forum/migrations/__init__.py @@ -0,0 +1,16 @@ +import sys + +class ProgressBar(object): + def __init__(self, full): + self.full = full + self.count = 0 + + self.print_bar(0) + + def print_bar(self, progress): + sys.stdout.write("[%s%s] %d%%\r" % ('=' * progress, ' ' * (100 - progress), progress)) + sys.stdout.flush() + + def update(self): + self.count += 1 + self.print_bar(int((float(self.count) / float(self.full)) * 100)) \ No newline at end of file