Concrete classes described in this chapter implement methods defined in
- class b2sdk.v2.AbstractProgressListener
Interface expected by B2Api upload and download methods to report on progress.
This interface just accepts the number of bytes transferred so far. Subclasses will need to know the total size if they want to report a percent done.
- abstract set_total_bytes(total_byte_count)
Always called before __enter__ to set the expected total number of bytes.
May be called more than once if an upload is retried.
total_byte_count (int) – expected total number of bytes
- abstract bytes_completed(byte_count)
Report the given number of bytes that have been transferred so far. This is not a delta, it is the total number of bytes transferred so far.
Transfer can fail and restart from beginning so byte count can decrease between calls.
byte_count (int) – number of bytes have been transferred
Must be called when you’re done with the listener. In well-structured code, should be called only once.
- class b2sdk.v2.TqdmProgressListener(description, *args, **kwargs)
Progress listener based on tqdm library.
- class b2sdk.v2.SimpleProgressListener(description, *args, **kwargs)
Just a simple progress listener which prints info on a console.
- class b2sdk.v2.DoNothingProgressListener
This listener gives no output whatsoever.
- class b2sdk.v2.ProgressListenerForTest(*args, **kwargs)
Capture all of the calls so they can be checked.