class documentation

class Range:

View In Hierarchy

Represents a Range header. All methods only support only bytes as the unit. Stores a list of ranges if given, but the methods only work if only one range is provided.

Changed in version 0.15: The ranges passed in are validated.
New in version 0.7.
Raises
ValueErrorIf the ranges provided are invalid.
Method __init__ Undocumented
Method __repr__ Undocumented
Method __str__ Undocumented
Method make​_content​_range Creates a ~werkzeug.datastructures.ContentRange object from the current range and given content length.
Method range​_for​_length If the range is for bytes, the length is not None and there is exactly one range and it is satisfiable it returns a (start, stop) tuple, otherwise None.
Method to​_content​_range​_header Converts the object into Content-Range HTTP header, based on given length
Method to​_header Converts the object back into an HTTP header.
Instance Variable ranges Undocumented
Instance Variable units Undocumented
def __init__(self, units, ranges):

Undocumented

def __repr__(self):

Undocumented

def __str__(self):

Undocumented

def make_content_range(self, length):
Creates a ~werkzeug.datastructures.ContentRange object from the current range and given content length.
def range_for_length(self, length):
If the range is for bytes, the length is not None and there is exactly one range and it is satisfiable it returns a (start, stop) tuple, otherwise None.
def to_content_range_header(self, length):
Converts the object into Content-Range HTTP header, based on given length
def to_header(self):
Converts the object back into an HTTP header.
ranges =

Undocumented

units =

Undocumented