diff options
-rw-r--r-- | Lib/email/Iterators.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/email/Iterators.py b/Lib/email/Iterators.py index a6ddceb..5253710 100644 --- a/Lib/email/Iterators.py +++ b/Lib/email/Iterators.py @@ -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) |