/opt/imh-python/lib/python3.9/email/__pycache__
NameSizeModeActions
base64mime.cpython-39.opt-1.pyc32480644editdlrm
base64mime.cpython-39.opt-2.pyc14710644editdlrm
base64mime.cpython-39.pyc32480644editdlrm
charset.cpython-39.opt-1.pyc114410644editdlrm
charset.cpython-39.opt-2.pyc51120644editdlrm
charset.cpython-39.pyc114620644editdlrm
contentmanager.cpython-39.opt-1.pyc73690644editdlrm
contentmanager.cpython-39.opt-2.pyc73690644editdlrm
contentmanager.cpython-39.pyc73690644editdlrm
encoders.cpython-39.opt-1.pyc16310644editdlrm
encoders.cpython-39.opt-2.pyc12800644editdlrm
encoders.cpython-39.pyc16310644editdlrm
errors.cpython-39.opt-1.pyc59200644editdlrm
errors.cpython-39.opt-2.pyc44880644editdlrm
errors.cpython-39.pyc59200644editdlrm
feedparser.cpython-39.opt-1.pyc104970644editdlrm
feedparser.cpython-39.opt-2.pyc88340644editdlrm
feedparser.cpython-39.pyc106180644editdlrm
generator.cpython-39.opt-1.pyc125940644editdlrm
generator.cpython-39.opt-2.pyc88950644editdlrm
generator.cpython-39.pyc125940644editdlrm
header.cpython-39.opt-1.pyc164410644editdlrm
header.cpython-39.opt-2.pyc108170644editdlrm
header.cpython-39.pyc164410644editdlrm
headerregistry.cpython-39.opt-1.pyc219390644editdlrm
headerregistry.cpython-39.opt-2.pyc161760644editdlrm
headerregistry.cpython-39.pyc219750644editdlrm
iterators.cpython-39.opt-1.pyc19400644editdlrm
iterators.cpython-39.opt-2.pyc13200644editdlrm
iterators.cpython-39.pyc19400644editdlrm
message.cpython-39.opt-1.pyc378450644editdlrm
message.cpython-39.opt-2.pyc212870644editdlrm
message.cpython-39.pyc378450644editdlrm
parser.cpython-39.opt-1.pyc57550644editdlrm
parser.cpython-39.opt-2.pyc27370644editdlrm
parser.cpython-39.pyc57550644editdlrm
policy.cpython-39.opt-1.pyc96480644editdlrm
policy.cpython-39.opt-2.pyc34330644editdlrm
policy.cpython-39.pyc96480644editdlrm
quoprimime.cpython-39.opt-1.pyc76830644editdlrm
quoprimime.cpython-39.opt-2.pyc42080644editdlrm
quoprimime.cpython-39.pyc76830644editdlrm
utils.cpython-39.opt-1.pyc95960644editdlrm
utils.cpython-39.opt-2.pyc62720644editdlrm
utils.cpython-39.pyc95960644editdlrm
_encoded_words.cpython-39.opt-1.pyc56910644editdlrm
_encoded_words.cpython-39.opt-2.pyc38050644editdlrm
_encoded_words.cpython-39.pyc56910644editdlrm
_header_value_parser.cpython-39.opt-1.pyc797600644editdlrm
_header_value_parser.cpython-39.opt-2.pyc628880644editdlrm
_header_value_parser.cpython-39.pyc797920644editdlrm
_parseaddr.cpython-39.opt-1.pyc123940644editdlrm
_parseaddr.cpython-39.opt-2.pyc94340644editdlrm
_parseaddr.cpython-39.pyc123940644editdlrm
_policybase.cpython-39.opt-1.pyc148170644editdlrm
_policybase.cpython-39.opt-2.pyc59890644editdlrm
_policybase.cpython-39.pyc148170644editdlrm
__init__.cpython-39.opt-1.pyc16760644editdlrm
__init__.cpython-39.opt-2.pyc10510644editdlrm
__init__.cpython-39.pyc16760644editdlrm
Edit: /opt/imh-python/lib/python3.9/email/__pycache__/generator.cpython-39.pyc (12594B)
a cæhäNã@sÊdZgd¢ZddlZddlZddlZddlZddlmZddlm Z m Z ddl m Z dZ dZe d ¡Ze d ej¡ZGd d „d ƒZGd d„deƒZdZGdd„deƒZeeejdƒƒZdeZejZdS)z:Classes to generate plain text from a message object tree.)Ú GeneratorÚDecodedGeneratorÚBytesGeneratoréN)Údeepcopy)ÚStringIOÚBytesIO)Ú_has_surrogatesÚ_Ú z \r\n|\r|\nz^From c@s°eZdZdZd'ddœdd„Zdd„Zd(d d „Zd d „Zd d„Zdd„Z dd„Z dd„Z dd„Z dd„Z dd„ZeZdd„Zdd„Zdd „Zd!d"„Zed)d#d$„ƒZed%d&„ƒZdS)*rzŠGenerates output from a Message object tree. This basic generator writes the message to the given file object as plain text. N©ÚpolicycCs6|dur|durdn|j}||_||_||_||_dS)aõCreate the generator for message flattening. outfp is the output file-like object for writing the message to. It must have a write() method. Optional mangle_from_ is a flag that, when True (the default if policy is not set), escapes From_ lines in the body of the message by putting a `>' in front of them. Optional maxheaderlen specifies the longest length for a non-continued header. When a header line is longer (in characters, with tabs expanded to 8 spaces) than maxheaderlen, the header will split as defined in the Header class. Set maxheaderlen to zero to disable header wrapping. The default is 78, as recommended (but not required) by RFC 2822. The policy keyword specifies a policy object that controls a number of aspects of the generator's operation. If no policy is specified, the policy associated with the Message object passed to the flatten method is used. NT)Ú mangle_from_Ú_fpÚ _mangle_from_Ú maxheaderlenr )ÚselfÚoutfpr rr ©rú0/opt/imh-python/lib/python3.9/email/generator.pyÚ__init__$s zGenerator.__init__cCs|j |¡dS©N)rÚwrite©rÚsrrrrDszGenerator.writeFcCsä|jdur|jn|j}|dur*|j|d}|jdurB|j|jd}|j|_| |j¡|_d|_| |j¡|_|j}|j}zX||_||_|r¸|  ¡}|s¨dt   t   ¡¡}|  ||j¡|  |¡W||_||_n||_||_0dS)aÿPrint the message object tree rooted at msg to the output file specified when the Generator instance was created. unixfrom is a flag that forces the printing of a Unix From_ delimiter before the first object in the message tree. If the original message has no From_ delimiter, a `standard' one is crafted. By default, this is False to inhibit the printing of any From_ delimiter. Note that for subobjects, no From_ line is printed. linesep specifies the characters used to indicate a new line in the output. The default value is determined by the policy specified when the Generator instance was created or, if none was specified, from the policy associated with the msg. N)Úlinesep©Zmax_line_lengthÚz From nobody )r ÚclonerrÚ_NLÚ_encodeÚ _encoded_NLZ_EMPTYÚ_encoded_EMPTYZ get_unixfromÚtimeÚctimerÚ_write)rÚmsgÚunixfromrr Zold_gen_policyZold_msg_policyZufromrrrÚflattenHs0   ÿzGenerator.flattencCs|j||jd|jdS)z1Clone this generator with the exact same options.Nr )Ú __class__rr )rÚfprrrrys ýzGenerator.clonecCstƒSr)r©rrrrÚ _new_bufferszGenerator._new_buffercCs|Srrrrrrr‘szGenerator._encodecCsT|sdSt |¡}|dd…D]}| |¡| |j¡q|drP| |d¡dS)Néÿÿÿÿ)ÚNLCREÚsplitrr)rÚlinesÚlinerrrÚ _write_lines•s  zGenerator._write_linescCsÐ|j}z2d|_| ¡|_}| |¡W||_|j}|`n||_|j}|`0|r”t|ƒ}| d¡durt|d|d<n| d|d¡| d|d¡t|ddƒ}|dur´| |¡n||ƒ|j  |  ¡¡dS)Núcontent-transfer-encodingrúContent-Transfer-Encodingú content-typeéÚ_write_headers) rÚ _munge_cter+Ú _dispatchrÚgetZreplace_headerÚgetattrr6rÚgetvalue)rr%ZoldfpZsfpZ munge_cteÚmethrrrr$¥s,  þ  zGenerator._writecCst| ¡}| ¡}t ||f¡ dd¡}t|d|dƒ}|durh| dd¡}t|d|dƒ}|durh|j}||ƒdS)Nú-r Z_handle_)Úget_content_maintypeÚget_content_subtypeÚ UNDERSCOREÚjoinÚreplacer:Ú _writeBody)rr%ÚmainÚsubZspecificr<Zgenericrrrr8Ìs zGenerator._dispatchcCs6| ¡D]\}}| |j ||¡¡q| |j¡dSr)Ú raw_itemsrr Zfoldr©rr%ÚhÚvrrrr6àszGenerator._write_headerscCsž| ¡}|durdSt|tƒs.tdt|ƒƒ‚t|jƒr~| d¡}|dur~t|ƒ}|d=|  ||¡| ¡}|d|df|_ |j rt   d|¡}| |¡dS)Nzstring payload expected: %sÚcharsetr2r4ú>From )Ú get_payloadÚ isinstanceÚstrÚ TypeErrorÚtyperÚ_payloadZ get_paramrZ set_payloadr7rÚfcrerEr1)rr%ÚpayloadrJrrrÚ _handle_textês$    ÿ zGenerator._handle_textc Csšg}| ¡}|durg}n(t|tƒr2| |¡dSt|tƒsB|g}|D]6}| ¡}| |¡}|j|d|jd|  |  ¡¡qF|  ¡}|sª|j   |¡}| |¡}| |¡|jduræ|jrÊt d|j¡} n|j} | | ¡| |j¡| d||j¡|r|j | d¡¡|D],} | |jd||j¡|j | ¡q| |jd|d|j¡|jdur–|jr†t d|j¡} n|j} | | ¡dS)NF©r&rrKz--r)rLrMrNrÚlistr+rr'rÚappendr;Z get_boundaryr rAÚ_make_boundaryZ set_boundaryÚpreamblerrRrEr1rÚpopÚepilogue) rr%ZmsgtextsZsubpartsÚpartrÚgÚboundaryZalltextrYZ body_partr[rrrÚ_handle_multipartsJ           zGenerator._handle_multipartcCs6|j}|jdd|_z| |¡W||_n||_0dS)Nrr)r rr_)rr%ÚprrrÚ_handle_multipart_signed<s  z"Generator._handle_multipart_signedcCsšg}| ¡D]t}| ¡}| |¡}|j|d|jd| ¡}| |j¡}|rv|d|jkrv|  |j  |dd…¡¡q |  |¡q |j   |j  |¡¡dS)NFrUr,) rLr+rr'rr;r.r r!rWrArr)rr%Zblocksr\rr]Útextr/rrrÚ_handle_message_delivery_statusGs    z)Generator._handle_message_delivery_statuscCs^| ¡}| |¡}|j}t|tƒrD|j| d¡d|jd| ¡}n |  |¡}|j   |¡dS)NrFrU) r+rrQrMrVr'rLrr;rrr)rr%rr]rSrrrÚ_handle_message\s    zGenerator._handle_messagecCsvt tj¡}dt|d}|dur(|S|}d}| dt |¡dtj¡}|  |¡sXqr|dt |ƒ}|d7}q0|S)Nz===============z==rz^--z(--)?$Ú.r5) ÚrandomÚ randrangeÚsysÚmaxsizeÚ_fmtÚ _compile_reÚreÚescapeÚ MULTILINEÚsearchrN)ÚclsrbÚtokenr^ÚbZcounterZcrerrrrXus   zGenerator._make_boundarycCs t ||¡Sr)rlÚcompile©rprÚflagsrrrrk‡szGenerator._compile_re)NN)FN)N)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrr'rr+rr1r$r8r6rTrCr_rarcrdÚ classmethodrXrkrrrrrs. ÿ  1' :  rcsPeZdZdZdd„Zdd„Zdd„Zdd „Z‡fd d „ZeZ e d d „ƒZ ‡Z S)raþGenerates a bytes version of a Message object tree. Functionally identical to the base Generator except that the output is bytes and not string. When surrogates were used in the input to encode bytes, these are decoded back to bytes for output. If the policy has cte_type set to 7bit, then the message is transformed such that the non-ASCII bytes are properly content transfer encoded, using the charset unknown-8bit. The outfp object must accept bytes in its write method. cCs|j | dd¡¡dS)NÚasciiÚsurrogateescape)rrÚencoderrrrr™szBytesGenerator.writecCstƒSr)rr*rrrr+œszBytesGenerator._new_buffercCs | d¡S©Nr{)r}rrrrrŸszBytesGenerator._encodecCs8| ¡D]\}}|j |j ||¡¡q| |j¡dSr)rFrrr Z fold_binaryrrGrrrr6¢szBytesGenerator._write_headerscs\|jdurdSt|jƒrH|jjdksH|jr:t d|j¡|_| |j¡ntt |ƒ  |¡dS)NZ7bitrK) rQrr Zcte_typerrRrEr1ÚsuperrrT)rr%©r(rrrTªs zBytesGenerator._handle_textcCst | d¡|¡Sr~)rlrsr}rtrrrrk¹szBytesGenerator._compile_re) rvrwrxryrr+rr6rTrCrzrkÚ __classcell__rrr€rrŒs  rzD[Non-text (%(type)s) part of message omitted, filename %(filename)s]c@s(eZdZdZdddœdd„Zdd„ZdS) rz±Generates a text representation of a message. Like the Generator base class, except that non-text parts are substituted with a format string representing the part. Nr cCs.tj|||||d|dur$t|_n||_dS)aŒLike Generator.__init__() except that an additional optional argument is allowed. Walks through all subparts of a message. If the subpart is of main type `text', then it prints the decoded payload of the subpart. Otherwise, fmt is a format string that is used instead of the message payload. fmt is expanded with the following keywords (in %(keyword)s format): type : Full MIME type of the non-text part maintype : Main MIME type of the non-text part subtype : Sub-MIME type of the non-text part filename : Filename of the non-text part description: Description associated with the non-text part encoding : Content transfer encoding of the non-text part The default value for fmt is None, meaning [Non-text (%(type)s) part of message omitted, filename %(filename)s] r N)rrÚ_FMTrj)rrr rÚfmtr rrrrÇs  ÿzDecodedGenerator.__init__c Cs„| ¡D]v}| ¡}|dkr2t|jdd|dq|dkrÚprintrLrjZget_content_typer?Ú get_filenamer9)rr%r\r†rrrr8ås( ÿÿù ÷zDecodedGenerator._dispatch)NNN)rvrwrxryrr8rrrrrÁs ÿ rr5z%%0%dd)ryÚ__all__rlrhr"rfÚcopyrÚiorrZ email.utilsrr@ÚNLrsr-rnrRrrr‚rÚlenÚreprriÚ_widthrjrXrrrrÚs*   t3;