[Python-checkins] python/dist/src/Lib/email Iterators.py,1.7,1.8

bwarsaw@users.sourceforge.net bwarsaw@users.sourceforge.net
Mon, 08 Jul 2002 19:39:09 -0700


Update of /cvsroot/python/python/dist/src/Lib/email
In directory usw-pr-cvs1:/tmp/cvs-serv12158/email

Modified Files:
	Iterators.py 
Log Message:
_structure(): A handy little debugging aid that I don't (yet) intend
to make public, but that others might still find useful.


Index: Iterators.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/Iterators.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Iterators.py	19 May 2002 23:44:19 -0000	1.7
--- Iterators.py	9 Jul 2002 02:39:07 -0000	1.8
***************
*** 10,11 ****
--- 10,21 ----
      # 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)