Ĥ˙f c @ sw d Z d d d g Z d d l Z d d l m Z d d Z d
d d Z d d d
d Z d d d
d d Z
d S( u1 Various types of useful iterators and generators.u body_line_iteratoru typed_subpart_iteratoru walki N( u StringIOc c sK | V| j rG x3 | j D]" } x | j D] } | Vq1 Wq Wn d S( u Walk over the message tree, yielding each subpart.
The walk is performed in depth-first order. This method is a
generator.
N( u is_multipartu get_payloadu walk( u selfu subpartu
subsubpart( ( u4 /opt/alt/python33/lib64/python3.3/email/iterators.pyu walk s
c c s[ xT | j D]F } | j d | } t | t r
x t | D] } | VqA Wq
q
Wd S( u Iterate over the parts, returning string payloads line-by-line.
Optional decode (default False) is passed through to .get_payload().
u decodeN( u walku get_payloadu
isinstanceu stru StringIO( u msgu decodeu subpartu payloadu line( ( u4 /opt/alt/python33/lib64/python3.3/email/iterators.pyu body_line_iterator# s
u textc c sV xO | j D]A } | j | k r
| d k sC | j | k rN | VqN q
q
Wd S( uĝ Iterate over the subparts with a given MIME type.
Use `maintype' as the main MIME type to match against; this defaults to
"text". Optional `subtype' is the MIME subtype to match against; if
omitted, only the main type is matched.
N( u walku get_content_maintypeu Noneu get_content_subtype( u msgu maintypeu subtypeu subpart( ( u4 /opt/alt/python33/lib64/python3.3/email/iterators.pyu typed_subpart_iterator/ s c C s· | d k r t j } n d | d } t | | j d d d | | ri t d | j d | n
t d | | j r³ x. | j D] } t | | | d | q Wn d S( u A handy debugging aidu i u endu u fileu [%s]i N( u Noneu sysu stdoutu printu get_content_typeu get_default_typeu is_multipartu get_payloadu
_structure( u msgu fpu levelu include_defaultu tabu subpart( ( u4 /opt/alt/python33/lib64/python3.3/email/iterators.pyu
_structure= s
u
_structureF( u __doc__u __all__u sysu iou StringIOu walku Falseu body_line_iteratoru Noneu typed_subpart_iteratoru
_structure( ( ( u4 /opt/alt/python33/lib64/python3.3/email/iterators.pyu