From 86224a81511d5b840dc5ca26c5af83b10779fa12 Mon Sep 17 00:00:00 2001 From: Yuxin Wu Date: Sat, 27 Jun 2020 17:34:52 -0700 Subject: [PATCH] update --- common/progress.py | 6 +++--- dump-html.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/progress.py b/common/progress.py index 3f121fc..da7901d 100644 --- a/common/progress.py +++ b/common/progress.py @@ -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() diff --git a/dump-html.py b/dump-html.py index 25855fe..ec727b8 100755 --- a/dump-html.py +++ b/dump-html.py @@ -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()