") t d Z ddlmZ ddlmZ ddlmZ ddlmZ g dZddlZddlm Z d Z
ddZdd
ZddZ
dS )z1Various types of useful iterators and generators. )print_function)unicode_literals)division)absolute_import)body_line_iteratortyped_subpart_iteratorwalkN)StringIOc # K | V | r2| D ]}| D ]}|V dS dS )zWalk over the message tree, yielding each subpart.
The walk is performed in depth-first order. This method is a
generator.
N)is_multipartget_payloadr )selfsubpart
subsubparts r/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/future/backports/email/iterators.pyr r s JJJ !'')) ! !G%llnn
!
!
!! ! ! ! Fc # K | D ]C}| | }t |t rt | D ]}|V DdS )zIterate over the parts, returning string payloads line-by-line.
Optional decode (default False) is passed through to .get_payload().
)decodeN)r r
isinstancestrr
)msgr r payloadlines r r r % st
88:: %%V%44gs## ))
r textc # K | D ]8}| |k r|| |k r|V 9dS )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_maintypeget_content_subtype)r maintypesubtyper s r r r 1 se 88:: ''))X55'"="="?"?7"J"J
r c v |t j }d|dz z }t || z d| |r't d| z | nt | | r,| D ]}t |||dz | dS dS ) zA handy debugging aidN )endfilez [%s])r% )sysstdoutprintget_content_typeget_default_typer r
_structure)r fplevelinclude_defaulttabr s r r, r, > s z
Z
C #$$&&
&BR8888
g,,...R88888
2
>(( > >GwE!G_====> > > >r )F)r N)Nr F)__doc__
__future__r r r r __all__r' ior
r r r r, r r