effigies / BitTornado

UNMAINTAINED - John Hoffman's fork of the original bittorrent
Other
150 stars 44 forks source link

btmakemetafile fills screen #57

Open Unit193 opened 6 years ago

Unit193 commented 6 years ago

Ever since the python 3 port of Bittornado, btmakemetafile now fills the screen rather than simply advancing the progress counter on the same line.

effigies commented 6 years ago

Thanks for the report. TBH, I don't have time to work on this, but if you are able to track down the cause and can propose a fix, please feel free to submit a PR.

Unit193 commented 6 years ago

Heh, wow it turns out to be a super simple fix. Note that while this matches the python 2 version, it returns to a prompt without any final message of completeness.

--- a/btmakemetafile.py  2018-02-20 19:47:44.062818141 -0500
+++ b/btmakemetafile.py   2018-02-20 19:49:11.549887461 -0500
@@ -12,7 +12,7 @@

 def prog(amount):
-    print('%.1f%% complete\r' % (amount * 100))
+    print('%.1f%% complete\r' % (amount * 100, end=""))

 def main(argv):