bg, tdZddlmZddlmZddlmZddlmZgdZddlZddlm Z d Z dd Z dd Z ddZ 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]}|VdSdS)zWalk 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 )selfsubpart subsubparts q/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/future/backports/email/iterators.pyr r s JJJ !'')) ! !G%llnn ! !       !!! ! !Fc#K|D]C}||}t|trt |D]}|VDdS)zIterate over the parts, returning string payloads line-by-line. Optional decode (default False) is passed through to .get_payload(). )decodeN)r r isinstancestrr )msgrrpayloadlines rrr%st 88::%%V%44 gs # #  ))   rtextc#K|D]8}||kr|||kr|V9dS)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)rmaintypesubtypers rrr1se88::  ' ' ) )X 5 5'"="="?"?7"J"J rcv| tj}d|dzz}t||zd||r'td|z|nt||r,|D]}t|||dz|dSdS) zA handy debugging aidN )endfilez [%s])r%)sysstdoutprintget_content_typeget_default_typer r _structure)rfplevelinclude_defaulttabrs rr,r,>s z Z  C #$$&& &BR8888 g,,...R88888 2 >(( > >G wE!G_ = = = =>> > >r)F)rN)NrF)__doc__ __future__rrrr__all__r'ior r rrr,rrr6s 87%%%%%%''''''&&&&&&     ! ! !         > > > > > >r