OpenQuizz
Une application de gestion des contenus pédagogiques
_RangeWrapper Class Reference
Inheritance diagram for _RangeWrapper:
Collaboration diagram for _RangeWrapper:

Public Member Functions

def __init__ (self, iterable, start_byte=0, byte_range=None)
 
def __iter__ (self)
 
def __next__ (self)
 
def close (self)
 

Data Fields

 iterable
 
 byte_range
 
 start_byte
 
 end_byte
 
 read_length
 
 seekable
 
 end_reached
 

Detailed Description

This class can be used to convert an iterable object into
an iterable that will only yield a piece of the underlying content.
It yields blocks until the underlying stream range is fully read.
The yielded blocks will have a size that can't exceed the original
iterator defined block size, but that can be smaller.

If you're using this object together with a :class:`BaseResponse` you have
to use the `direct_passthrough` mode.

:param iterable: an iterable object with a :meth:`__next__` method.
:param start_byte: byte from which read will start.
:param byte_range: how many bytes to read.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  iterable,
  start_byte = 0,
  byte_range = None 
)

Member Function Documentation

◆ __iter__()

def __iter__ (   self)

◆ __next__()

def __next__ (   self)

◆ close()

def close (   self)

Field Documentation

◆ byte_range

byte_range

◆ end_byte

end_byte

◆ end_reached

end_reached

◆ iterable

iterable

◆ read_length

read_length

◆ seekable

seekable

◆ start_byte

start_byte

The documentation for this class was generated from the following file: