MCPcopy
hub / github.com/encode/starlette / on_part_end

Method on_part_end

starlette/formparsers.py:190–203  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

188 self._file_parts_to_write.append((self._current_part, message_bytes))
189
190 def on_part_end(self) -> None:
191 if self._current_part.file is None:
192 self.items.append(
193 (
194 self._current_part.field_name,
195 _user_safe_decode(self._current_part.data, self._charset),
196 )
197 )
198 else:
199 self._file_parts_to_finish.append(self._current_part)
200 # The file can be added to the items right now even though it's not
201 # finished yet, because it will be finished in the `parse()` method, before
202 # self.items is used in the return value.
203 self.items.append((self._current_part.field_name, self._current_part.file))
204
205 def on_header_field(self, data: bytes, start: int, end: int) -> None:
206 self._current_partial_header_name += data[start:end]

Callers

nothing calls this directly

Calls 2

_user_safe_decodeFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected