Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def body_text(self, obj):
- def _body(po):
- payload = po.get_payload()
- if isinstance(payload, list):
- # po.is_multipart() == True
- return "<hr/>".join([_body(p) for p in payload])
- if isinstance(payload, basestring):
- cs = po.get_content_charset() or po.get_charset()
- if cs:
- return unicode(
- po.get_payload(decode=True), cs, "replace")
- return payload
- return ''
- return _body(obj.mailobject())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement