[output] write download progress indicator to stderr

This commit is contained in:
Mike Fährmann
2021-11-28 22:11:16 +01:00
parent 604d5b8bb2
commit da14b3fe9f
3 changed files with 6 additions and 4 deletions

View File

@@ -296,10 +296,10 @@ class TerminalOutput(NullOutput):
bdl = util.format_value(bytes_downloaded)
bps = util.format_value(bytes_per_second)
if bytes_total is None:
print("\r{:>7}B {:>7}B/s ".format(bdl, bps), end="")
sys.stderr.write("\r{:>7}B {:>7}B/s ".format(bdl, bps))
else:
print("\r{:>3}% {:>7}B {:>7}B/s ".format(
bytes_downloaded * 100 // bytes_total, bdl, bps), end="")
sys.stderr.write("\r{:>3}% {:>7}B {:>7}B/s ".format(
bytes_downloaded * 100 // bytes_total, bdl, bps))
class ColorOutput(TerminalOutput):

View File

@@ -6,4 +6,4 @@
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
__version__ = "1.19.3"
__version__ = "1.20.0-dev"