MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _dispatch

Method _dispatch

tools/python-3.11.9-amd64/Lib/email/generator.py:203–217  ·  view source on GitHub ↗
(self, msg)

Source from the content-addressed store, hash-verified

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

Callers 1

_writeMethod · 0.95

Calls 4

get_content_maintypeMethod · 0.80
get_content_subtypeMethod · 0.80
replaceMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected