b2sdk.stream.progress
Streams with progress reporting¶
-
class
b2sdk.stream.progress.
AbstractStreamWithProgress
(stream, progress_listener, offset=0)[source]¶ Bases:
b2sdk.stream.wrapper.StreamWrapper
Wrap a file-like object and updates a ProgressListener as data is read / written. In the abstract class, read and write methods do not update the progress - child classes shall do it.
-
__init__
(stream, progress_listener, offset=0)[source]¶ - Parameters
stream – the stream to read from or write to
progress_listener (b2sdk.v1.AbstractProgressListener) – the listener that we tell about progress
offset (int) – the starting byte offset in the file
-
-
class
b2sdk.stream.progress.
ReadingStreamWithProgress
(*args, **kwargs)[source]¶ Bases:
b2sdk.stream.progress.AbstractStreamWithProgress
Wrap a file-like object, updates progress while reading.
-
__init__
(*args, **kwargs)[source]¶ - Parameters
stream – the stream to read from or write to
progress_listener (b2sdk.v1.AbstractProgressListener) – the listener that we tell about progress
offset (int) – the starting byte offset in the file
-
-
class
b2sdk.stream.progress.
WritingStreamWithProgress
(stream, progress_listener, offset=0)[source]¶ Bases:
b2sdk.stream.progress.AbstractStreamWithProgress
Wrap a file-like object; updates progress while writing.