(self, msg)
| 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 |
no test coverage detected