
    F\hQ                     H    S r / SQrSSKrSSKJr  S rS	S jrS
S jrSS jrg)z1Various types of useful iterators and generators.)body_line_iteratortyped_subpart_iteratorwalk    N)StringIOc              #      #    U v   U R                  5       (       a0  U R                  5        H  nUR                  5        Sh  vN   M     gg N
7f)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subparts     &/usr/lib/python3.13/email/iterators.pyr   r      sE      J'')G||~%% * %s   A AAAc              #      #    U R                  5        H<  nUR                  US9n[        U[        5      (       d  M)  [	        U5       Sh  vN   M>     g N	7f)zIterate 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   payloads       r   r   r       sJ     
 88:%%V%4gs##(((  )s   6AA
A
Ac              #      #    U R                  5        H6  nUR                  5       U:X  d  M  Ub  UR                  5       U:X  d  M2  Uv   M8     g7f)zIterate 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)r   get_content_maintypeget_content_subtype)r   maintypesubtyper   s       r   r   r   +   sB      88:'')X5'"="="?7"J s   &AA	Ac                 B   Uc  [         R                  nSUS-  -  n[        X@R                  5       -   SUS9  U(       a  [        SU R	                  5       -  US9  O	[        US9  U R                  5       (       a(  U R                  5        H  n[        XQUS-   U5        M     gg)	zA handy debugging aidN     )endfilez [%s])r      )sysstdoutprintget_content_typeget_default_typer   r	   
_structure)r   fplevelinclude_defaulttabr   s         r   r$   r$   8   s    	zZZ

C	#$$&
&BR8g,,..R82
(GwE!G_= )     )F)textN)Nr   F)	__doc____all__r   ior   r   r   r   r$    r)   r   <module>r/      s-   
 8  	&)
>r)   