]> git.openstreetmap.org Git - osqa.git/blob - forum/migrations/__init__.py
we need to close both dialogs if users selects No on award points confirmation
[osqa.git] / forum / migrations / __init__.py
1 import sys
2
3 class ProgressBar(object):
4     def __init__(self, full):
5         self.full = full
6         self.count = 0
7
8         self.print_bar(0)
9
10     def print_bar(self, progress):
11         sys.stdout.write("[%s%s] %d%%\r" % ('=' * progress, ' ' * (100 - progress), progress))
12         sys.stdout.flush()
13
14     def update(self):
15         self.count += 1
16         self.print_bar(int((float(self.count) / float(self.full)) * 100))