Mercurial > p > roundup > code
comparison test/benchmark.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 | d41f38de578e |
| children | d26921b851c3 |
comparison
equal
deleted
inserted
replaced
| 5375:1ad46057ae4a | 5376:64b05e24dbd8 |
|---|---|
| 1 from __future__ import print_function | |
| 1 import sys, os, time | 2 import sys, os, time |
| 2 | 3 |
| 3 from roundup.hyperdb import String, Password, Link, Multilink, Date, \ | 4 from roundup.hyperdb import String, Password, Link, Multilink, Date, \ |
| 4 Interval, DatabaseError, Boolean, Number | 5 Interval, DatabaseError, Boolean, Number |
| 5 from roundup import date, password | 6 from roundup import date, password |
| 112 if last is None: | 113 if last is None: |
| 113 first = stamp | 114 first = stamp |
| 114 else: | 115 else: |
| 115 sys.stdout.write(' %-6.2f'%(stamp-last)) | 116 sys.stdout.write(' %-6.2f'%(stamp-last)) |
| 116 last = stamp | 117 last = stamp |
| 117 print ' %-6.2f'%(last-first) | 118 print(' %-6.2f'%(last-first)) |
| 118 sys.stdout.flush() | 119 sys.stdout.flush() |
| 119 | 120 |
| 120 if __name__ == '__main__': | 121 if __name__ == '__main__': |
| 121 # 0 1 2 3 4 5 6 | 122 # 0 1 2 3 4 5 6 |
| 122 # 01234567890123456789012345678901234567890123456789012345678901234 | 123 # 01234567890123456789012345678901234567890123456789012345678901234 |
| 123 print 'Test name fetch journl jprops lookup filter filtml TOTAL ' | 124 print('Test name fetch journl jprops lookup filter filtml TOTAL ') |
| 124 for name in 'anydbm metakit sqlite'.split(): | 125 for name in 'anydbm metakit sqlite'.split(): |
| 125 main(name) | 126 main(name) |
| 126 for name in 'anydbm metakit sqlite'.split(): | 127 for name in 'anydbm metakit sqlite'.split(): |
| 127 main(name, numissues=20) | 128 main(name, numissues=20) |
| 128 for name in 'anydbm metakit sqlite'.split(): | 129 for name in 'anydbm metakit sqlite'.split(): |
