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

Method _dispatch

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

Source from the content-addressed store, hash-verified

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

Callers 2

_writeMethod · 0.95
__call__Method · 0.45

Calls 6

getattrFunction · 0.85
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