MCPcopy
hub / github.com/pallets/werkzeug / make_content_range

Method make_content_range

src/werkzeug/datastructures/range.py:85–92  ·  view source on GitHub ↗

Creates a :class:`~werkzeug.datastructures.ContentRange` object from the current range and given content length.

(self, length: int | None)

Source from the content-addressed store, hash-verified

83 return None
84
85 def make_content_range(self, length: int | None) -> ContentRange | None:
86 """Creates a :class:`~werkzeug.datastructures.ContentRange` object
87 from the current range and given content length.
88 """
89 rng = self.range_for_length(length)
90 if rng is not None:
91 return ContentRange(self.units, rng[0], rng[1], length)
92 return None
93
94 def to_header(self) -> str:
95 """Converts the object back into an HTTP header."""

Callers 1

test_rangesFunction · 0.80

Calls 2

range_for_lengthMethod · 0.95
ContentRangeClass · 0.85

Tested by 1

test_rangesFunction · 0.64