Simple method to update the ranges.
(
self,
start: int | None,
stop: int | None,
length: int | None = None,
units: str | None = "bytes",
)
| 168 | length: int | None = _CallbackProperty() # type: ignore[assignment] |
| 169 | |
| 170 | def set( |
| 171 | self, |
| 172 | start: int | None, |
| 173 | stop: int | None, |
| 174 | length: int | None = None, |
| 175 | units: str | None = "bytes", |
| 176 | ) -> None: |
| 177 | """Simple method to update the ranges.""" |
| 178 | assert http.is_byte_range_valid(start, stop, length), "Bad range provided" |
| 179 | self._units: str | None = units |
| 180 | self._start: int | None = start |
| 181 | self._stop: int | None = stop |
| 182 | self._length: int | None = length |
| 183 | if self.on_update is not None: |
| 184 | self.on_update(self) |
| 185 | |
| 186 | def unset(self) -> None: |
| 187 | """Sets the units to `None` which indicates that the header should |