]> git.openstreetmap.org Git - osqa.git/blob - forum/migrations/__init__.py
closes OSQA 401 - Wrong page title in search results
[osqa.git] / forum / migrations / __init__.py
1 import sys\r
2 \r
3 class ProgressBar(object):\r
4     def __init__(self, full):\r
5         self.full = full\r
6         self.count = 0\r
7 \r
8         self.print_bar(0)\r
9 \r
10     def print_bar(self, progress):\r
11         sys.stdout.write("[%s%s] %d%%\r" % ('=' * progress, ' ' * (100 - progress), progress))\r
12         sys.stdout.flush()\r
13 \r
14     def update(self):\r
15         self.count += 1\r
16         self.print_bar(int((float(self.count) / float(self.full)) * 100))