
    9i,	                     x    S r SSKJr  SSKJr  SSKJr  SSKJ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.    )print_function)unicode_literals)division)absolute_import)body_line_iteratortyped_subpart_iteratorwalkN)StringIOc              #      #    U v   U R                  5       (       a3  U R                  5        H  nUR                  5        H  nUv   M	     M      gg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subpart
subsubparts      `/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/future/backports/email/iterators.pyr	   r	      sI      J'')G%lln
   - * s   AAc              #      #    U R                  5        H?  nUR                  US9n[        U[        5      (       d  M)  [	        U5       H  nUv   M	     MA     g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   payloadlines        r   r   r   %   sK     
 88:%%V%4gs## )
 * s
   6A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   1   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*   >   s    	zZZ

C	#$$&
&BR8g,,..R82
(GwE!G_= )     )F)textN)Nr   F)__doc__
__future__r   r   r   r   __all__r%   ior
   r	   r   r   r*    r/   r   <module>r6      s9   
 8 % '  &  
!	
>r/   