Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. def body_text(self, obj):
  2. def _body(po):
  3. payload = po.get_payload()
  4. if isinstance(payload, list):
  5. # po.is_multipart() == True
  6. return "<hr/>".join([_body(p) for p in payload])
  7. if isinstance(payload, basestring):
  8. cs = po.get_content_charset() or po.get_charset()
  9. if cs:
  10. return unicode(
  11. po.get_payload(decode=True), cs, "replace")
  12. return payload
  13. return ''
  14. return _body(obj.mailobject())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement