Mercurial > p > roundup > code
comparison roundup/support.py @ 5376:64b05e24dbd8
Python 3 preparation: convert print to a function.
Tool-assisted patch. It is possible that some "from __future__ import
print_function" are not in fact needed, if a file only uses print()
with a single string as an argument and so would work fine in Python 2
without that import.
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Tue, 24 Jul 2018 09:54:52 +0000 |
| parents | ac0c117cd24c |
| children | 0942fe89e82e |
comparison
equal
deleted
inserted
replaced
| 5375:1ad46057ae4a | 5376:64b05e24dbd8 |
|---|---|
| 1 """Implements various support classes and functions used in a number of | 1 """Implements various support classes and functions used in a number of |
| 2 places in Roundup code. | 2 places in Roundup code. |
| 3 """ | 3 """ |
| 4 | 4 |
| 5 from __future__ import print_function | |
| 5 __docformat__ = 'restructuredtext' | 6 __docformat__ = 'restructuredtext' |
| 6 | 7 |
| 7 import os, time, sys, re | 8 import os, time, sys, re |
| 8 | 9 |
| 9 class TruthDict: | 10 class TruthDict: |
| 77 | 78 |
| 78 def next(self): | 79 def next(self): |
| 79 self.num += 1 | 80 self.num += 1 |
| 80 | 81 |
| 81 if self.num > self.total: | 82 if self.num > self.total: |
| 82 print self.info, 'done', ' '*(75-len(self.info)-6) | 83 print(self.info, 'done', ' '*(75-len(self.info)-6)) |
| 83 sys.stdout.flush() | 84 sys.stdout.flush() |
| 84 return self.sequence.next() | 85 return self.sequence.next() |
| 85 | 86 |
| 86 if self.num % self.stepsize: | 87 if self.num % self.stepsize: |
| 87 return self.sequence.next() | 88 return self.sequence.next() |
