MCPcopy Index your code
hub / github.com/RustPython/RustPython / _handle_message_delivery_status

Method _handle_message_delivery_status

Lib/email/generator.py:337–356  ·  view source on GitHub ↗
(self, msg)

Source from the content-addressed store, hash-verified

335 self.policy = p
336
337 def _handle_message_delivery_status(self, msg):
338 # We can't just write the headers directly to self's file object
339 # because this will leave an extra newline between the last header
340 # block and the boundary. Sigh.
341 blocks = []
342 for part in msg.get_payload():
343 s = self._new_buffer()
344 g = self.clone(s)
345 g.flatten(part, unixfrom=False, linesep=self._NL)
346 text = s.getvalue()
347 lines = text.split(self._encoded_NL)
348 # Strip off the unnecessary trailing empty line
349 if lines and lines[-1] == self._encoded_EMPTY:
350 blocks.append(self._encoded_NL.join(lines[:-1]))
351 else:
352 blocks.append(text)
353 # Now join all the blocks with an empty line. This has the lovely
354 # effect of separating each block with an empty line, but not adding
355 # an extra one after the last one.
356 self._fp.write(self._encoded_NL.join(blocks))
357
358 def _handle_message(self, msg):
359 s = self._new_buffer()

Callers

nothing calls this directly

Calls 9

_new_bufferMethod · 0.95
cloneMethod · 0.95
get_payloadMethod · 0.80
flattenMethod · 0.45
getvalueMethod · 0.45
splitMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected