MCPcopy Index your code
hub / github.com/python/cpython / _dispatch

Method _dispatch

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

Source from the content-addressed store, hash-verified

502 self._fmt = fmt
503
504 def _dispatch(self, msg):
505 for part in msg.walk():
506 maintype = part.get_content_maintype()
507 if maintype == 'text':
508 print(part.get_payload(decode=False), file=self)
509 elif maintype == 'multipart':
510 # Just skip this
511 pass
512 else:
513 print(self._fmt % {
514 'type' : part.get_content_type(),
515 'maintype' : part.get_content_maintype(),
516 'subtype' : part.get_content_subtype(),
517 'filename' : part.get_filename('[no filename]'),
518 'description': part.get('Content-Description',
519 '[no description]'),
520 'encoding' : part.get('Content-Transfer-Encoding',
521 '[no encoding]'),
522 }, file=self)
523
524
525# Helper used by Generator._make_boundary

Callers

nothing calls this directly

Calls 7

get_content_maintypeMethod · 0.80
get_payloadMethod · 0.80
get_content_typeMethod · 0.80
get_content_subtypeMethod · 0.80
walkMethod · 0.45
get_filenameMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected