projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
329d3af
)
_structure(): A handy little debugging aid that I don't (yet) intend
author
Barry Warsaw
<barry@python.org>
Tue, 9 Jul 2002 02:39:07 +0000
(
02:39
+0000)
committer
Barry Warsaw
<barry@python.org>
Tue, 9 Jul 2002 02:39:07 +0000
(
02:39
+0000)
to make public, but that others might still find useful.
Lib/email/Iterators.py
patch
|
blob
|
history
diff --git
a/Lib/email/Iterators.py
b/Lib/email/Iterators.py
index a6ddceb053d751c44cb5c72010418014672e0ff4..5253710deeeb5566faa88dd94e5548d8ec54d3b3 100644
(file)
--- 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
+
+
+
\f
+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)