| Total Complexity | 3 |
| Total Lines | 11 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | #!/usr/bin/env python |
||
| 29 | class ProgressMonitor(object): |
||
| 30 | def __init__(self, count): |
||
| 31 | self.count, self.progress = count, 0 |
||
| 32 | |||
| 33 | def show(self, n=1): |
||
| 34 | self.progress += n |
||
| 35 | text = 'Completed {}/{} tasks'.format(self.progress, self.count) |
||
| 36 | write_and_flush('\b' * 80, '\r', text) |
||
| 37 | |||
| 38 | def done(self): |
||
| 39 | write_and_flush('\n') |
||
| 40 | |||
| 60 |