Commit 8fa06b55 authored by Barry Warsaw's avatar Barry Warsaw

_structure(): A handy little debugging aid that I don't (yet) intend

to make public, but that others might still find useful.
parent 329d3af4
......@@ -9,3 +9,13 @@ try:
except SyntaxError:
# Python 2.1 doesn't have generators
from email._compat21 import body_line_iterator, typed_subpart_iterator
def _structure(msg, level=0):
"""A handy debugging aid"""
tab = ' ' * (level * 4)
print tab + msg.get('content-type', msg.get_default_type())
if msg.is_multipart():
for subpart in msg.get_payload():
_structure(subpart, level+1)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment