New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Progress emulation in Windows 10 (doesnt work) #207
Comments
Not sure how or where it broke, but something is indeed not updating correctly there. I'm investigating the issue :) |
Looking more closely at the code, the issue is that it's using For the time being the code should be fixable by simplifying it a bit: import collections
import time
import progressbar
struct = collections.namedtuple
def get_progress_info():
"""Return a function callback to update the progressbar."""
progressinfo = struct("ProgressInfo", ["callback", "finish"])
if progressbar:
bar = progressbar.ProgressBar(widgets=[
progressbar.Percentage(),
' ', progressbar.Bar(),
' ', progressbar.FileTransferSpeed(),
' ', progressbar.DataSize(), '/', progressbar.DataSize('max_value'),
' ', progressbar.Timer(),
' ', progressbar.AdaptiveETA(),
])
def _callback(total_size, completed):
bar.max_value = total_size
bar.update(completed)
def _finish():
return bar.finish()
return progressinfo(callback=_callback, finish=_finish)
else:
return progressinfo(callback=None, finish=lambda: True)
def upload(progress_callback):
for x in range(0, 300):
time.sleep(1)
progress_callback(300, x)
progress = get_progress_info()
upload(progress.callback) |
Big thanks 👍 🥇 |
I've got a working patch ready on develop, I'm planning to put out a new release within the next couple of days. |
This code not update text in console
All time this:
N/A% | | 0.0 s/B 0.0 B/300.0 B Elapsed Time: 0:00:00 ETA: --:--:--
https://github.com/tokland/youtube-upload/blob/master/youtube_upload/main.py#L63
https://github.com/tokland/youtube-upload/blob/master/youtube_upload/upload_video.py#L22
The text was updated successfully, but these errors were encountered: