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