This commit is contained in:
Yuxin Wu
2020-06-27 17:34:52 -07:00
parent 1395351755
commit 86224a8151
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -32,12 +32,12 @@ class ProgressReporter(object):
self._prev_report_time = now
dt = now - self._start_time
if self._total and self._cnt > 0:
eta_msg = '{}/{} ETA: {:.2f}'.format(self._cnt, self._total,
eta_msg = '{}/{} ETA: {:.1f}'.format(self._cnt, self._total,
(self._total-self._cnt)*dt/self._cnt)
else:
eta_msg = '{} done'.format(self._cnt)
self._fout.write(u'{}: avg {:.3f}/sec'
u', passed {:.3f}sec, {} {} \r'.format(
self._fout.write(u'{}: avg {:.1f}/sec'
u', passed {:.1f}sec, {} {} \r'.format(
self._name, self._cnt / dt, dt, eta_msg, extra_msg))
self._fout.flush()
+1 -1
View File
@@ -52,6 +52,6 @@ if __name__ == '__main__':
assert output_file.endswith(".html")
basename = output_file[:-5]
for idx, html in enumerate(htmls):
with open(basename + '.{}'.format(idx) + '.html', 'w') as f:
with open(basename + f'{idx:02d}.html', 'w') as f:
f.write(html)
res.emoji_cache.flush()