3 \W ã @ sL d Z dddgZddlZddlmZ dd„ Zdd d„Zddd„Zddd „ZdS )z1Various types of useful iterators and generators.Úbody_line_iteratorÚtyped_subpart_iteratorÚwalké N)ÚStringIOc c s2 | V | j ƒ r.x| jƒ D ]}|jƒ E dH qW dS )z‰Walk over the message tree, yielding each subpart. The walk is performed in depth-first order. This method is a generator. N)Úis_multipartÚget_payloadr )ÚselfÚsubpart© r ú'/usr/lib64/python3.6/email/iterators.pyr s Fc c s: x4| j ƒ D ](}|j|d�}t|tƒr t|ƒE dH q W dS )zŽIterate over the parts, returning string payloads line-by-line. Optional decode (default False) is passed through to .get_payload(). )ÚdecodeN)r r Ú isinstanceÚstrr )Úmsgr r Zpayloadr r r r " s Útextc c s<