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