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

Method _dispatch

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

Source from the content-addressed store, hash-verified

204 self._fp.write(sfp.getvalue())
205
206 def _dispatch(self, msg):
207 # Get the Content-Type: for the message, then try to dispatch to
208 # self._handle_<maintype>_<subtype>(). If there's no handler for the
209 # full MIME type, then dispatch to self._handle_<maintype>(). If
210 # that's missing too, then dispatch to self._writeBody().
211 main = msg.get_content_maintype()
212 sub = msg.get_content_subtype()
213 specific = UNDERSCORE.join((main, sub)).replace('-', '_')
214 meth = getattr(self, '_handle_' + specific, None)
215 if meth is None:
216 generic = main.replace('-', '_')
217 meth = getattr(self, '_handle_' + generic, None)
218 if meth is None:
219 meth = self._writeBody
220 meth(msg)
221
222 #
223 # Default handlers

Callers 2

_writeMethod · 0.95
__call__Method · 0.45

Calls 5

methFunction · 0.85
get_content_maintypeMethod · 0.80
get_content_subtypeMethod · 0.80
replaceMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected