mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
_structure(): A handy little debugging aid that I don't (yet) intend
to make public, but that others might still find useful.
This commit is contained in:
parent
329d3af443
commit
8fa06b55f6
1 changed files with 10 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue