X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/1a949f7c97dc2f34c135f5cdf088df2927d3d652..410bfa05ee36ed1d99356c443a5f3f6aa3ee9578:/forum/migrations/__init__.py?ds=sidebyside diff --git a/forum/migrations/__init__.py b/forum/migrations/__init__.py index e69de29..01fd2df 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