Plan 9 from Bell Labs’s /usr/web/sources/contrib/stallion/root/sys/lib/python2.7/email/iterators.pyo

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�`^c@skdZdddgZddlZddlmZd�Zed�Zd	dd
�Z	dded�Z
dS(
s1Various types of useful iterators and generators.tbody_line_iteratorttyped_subpart_iteratortwalki�N(tStringIOccsK|V|j�rGx3|j�D]"}x|j�D]}|Vq1WqWndS(s�Walk over the message tree, yielding each subpart.

    The walk is performed in depth-first order.  This method is a
    generator.
    N(tis_multiparttget_payloadR(tselftsubpartt
subsubpart((s%/sys/lib/python2.7/email/iterators.pyRs
ccs[xT|j�D]F}|jd|�}t|t�r
xt|�D]}|VqAWq
q
WdS(s�Iterate over the parts, returning string payloads line-by-line.

    Optional decode (default False) is passed through to .get_payload().
    tdecodeN(RRt
isinstancet
basestringR(tmsgR	Rtpayloadtline((s%/sys/lib/python2.7/email/iterators.pyR#s
ttextccsVxO|j�D]A}|j�|kr
|dksC|j�|krN|VqNq
q
WdS(s�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(Rtget_content_maintypetNonetget_content_subtype(RtmaintypetsubtypeR((s%/sys/lib/python2.7/email/iterators.pyR/sicCs�|dkrtj}nd|d}|||j�I|rW|d|j�IJn|J|j�r�x.|j�D]}t|||d|�qtWndS(sA handy debugging aidt is[%s]iN(Rtsyststdouttget_content_typetget_default_typeRRt
_structure(Rtfptleveltinclude_defaultttabR((s%/sys/lib/python2.7/email/iterators.pyR=s(t__doc__t__all__Rt	cStringIORRtFalseRRRR(((s%/sys/lib/python2.7/email/iterators.pyt<module>s		

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].