]> git.openstreetmap.org Git - osqa.git/blob - forum/migrations/__init__.py
Merge pull request #1 from udacity/add_requirements_file
[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))