(self, msg)
| 492 | self._fmt = fmt |
| 493 | |
| 494 | def _dispatch(self, msg): |
| 495 | for part in msg.walk(): |
| 496 | maintype = part.get_content_maintype() |
| 497 | if maintype == 'text': |
| 498 | print(part.get_payload(decode=False), file=self) |
| 499 | elif maintype == 'multipart': |
| 500 | # Just skip this |
| 501 | pass |
| 502 | else: |
| 503 | print(self._fmt % { |
| 504 | 'type' : part.get_content_type(), |
| 505 | 'maintype' : part.get_content_maintype(), |
| 506 | 'subtype' : part.get_content_subtype(), |
| 507 | 'filename' : part.get_filename('[no filename]'), |
| 508 | 'description': part.get('Content-Description', |
| 509 | '[no description]'), |
| 510 | 'encoding' : part.get('Content-Transfer-Encoding', |
| 511 | '[no encoding]'), |
| 512 | }, file=self) |
| 513 | |
| 514 | |
| 515 | # Helper used by Generator._make_boundary |
nothing calls this directly
no test coverage detected