python (3.12.0)
ˑeQ B d Z g dZddlZddlmZ d Zd dZd
dZddZy)z1Various types of useful iterators and generators.)body_line_iteratortyped_subpart_iteratorwalk N)StringIOc # K | | j r.| j D ] }|j E d{ yy7 w)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 )selfsubparts C/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/email/iterators.pyr r sH J'') &G||~%% & %s ;AA Ac # K | j D ]8 }|j | }t |t s&t | E d{ : y7 w)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 payloads r r r sM
88: )%%V%4gs#((()
)s 6AAAAc # K | j D ]0 }|j |k( s||j |k( s-| 2 yw)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 + sH 88: '')X5'"="="?7"J
s 'AA Ac > |t j }d|dz z }t || j z d| |rt d| j z | nt | | j r'| j
D ] }t |||dz | yy) zA handy debugging aidN )endfilez [%s])r )sysstdoutprintget_content_typeget_default_typer r
_structure)r fplevelinclude_defaulttabr s r r$ r$ 8 s z
ZZ
C #$$&
&BR8
g,,..R8
2
( >GwE!G_= > )F)textN)Nr F) __doc____all__r ior r r r r$ r) r <module>r/ s-
8 &)
>r)