| 551 | |
| 552 | |
| 553 | def format_mime(self, bundle): |
| 554 | |
| 555 | text_plain = bundle['text/plain'] |
| 556 | |
| 557 | text = '' |
| 558 | heads, bodies = list(zip(*text_plain)) |
| 559 | _len = max(len(h) for h in heads) |
| 560 | |
| 561 | for head, body in zip(heads, bodies): |
| 562 | body = body.strip('\n') |
| 563 | delim = '\n' if '\n' in body else ' ' |
| 564 | text += self.__head(head+':') + (_len - len(head))*' ' +delim + body +'\n' |
| 565 | |
| 566 | bundle['text/plain'] = text |
| 567 | return bundle |
| 568 | |
| 569 | def _get_info(self, obj, oname='', formatter=None, info=None, detail_level=0): |
| 570 | """Retrieve an info dict and format it. |