tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
W\¬Qc@súdZddgZddlZddlZddlZddlZddlZddlmZddl    m
Z
dZ dZ ej d    ejƒZd
„Zdfd „ƒYZd Zdefd „ƒYZeeejdƒƒZdeZed„ZdS(s:Classes to generate plain text from a message object tree.t    GeneratortDecodedGeneratoriÿÿÿÿN(tStringIO(tHeadert_s
s^From cCs<t|tƒr8yt|dƒWq8tk
r4tSXntS(Nsus-ascii(t
isinstancetstrtunicodet UnicodeErrortTruetFalse(ts((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pyt _is8bitstrings  cBs‰eZdZedd„Zd„Zed„Zd„Zd„Z    d„Z
d„Z d    „Z e Z d
„Zd „Zd „Zd „ZRS(sŠGenerates output from a Message object tree.
 
    This basic generator writes the message to the given file object as plain
    text.
    iNcCs||_||_||_dS(sá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), 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.
        N(t_fpt _mangle_from_t _maxheaderlen(tselftoutfpt mangle_from_t maxheaderlen((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pyt__init__*s        cCs|jj|ƒdS(N(R twrite(RR ((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pyR?scCsU|rD|jƒ}|s4dtjtjƒƒ}n|j|IJn|j|ƒdS(sì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.
        s From nobody N(t get_unixfromttimetctimeR t_write(Rtmsgtunixfromtufrom((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pytflattenCs  cCs|j||j|jƒS(s1Clone this generator with the exact same options.(t    __class__RR(Rtfp((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pytcloneUscCs‰|j}z!tƒ|_}|j|ƒWd||_Xt|ddƒ}|dkre|j|ƒn
||ƒ|jj|jƒƒdS(Nt_write_headers(R Rt    _dispatchtgetattrtNoneR!Rtgetvalue(RRtoldfptsfptmeth((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pyR]s    
 
cCs¬|jƒ}|jƒ}tj||fƒjddƒ}t|d|dƒ}|dkrž|jddƒ}t|d|dƒ}|dkrž|j}qžn||ƒdS(Nt-Rt_handle_(tget_content_maintypetget_content_subtypet
UNDERSCOREtjointreplaceR#R$t
_writeBody(RRtmaintsubtspecificR(tgeneric((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pyR"xs  !  c    CsÁx³|jƒD]¥\}}|jd|I|jdkrI|j|IJq t|tƒrn|j|jƒIJq t|ƒrŠ|j|IJq |jt|d|jd|ƒjƒIJq W|jJdS(Ns%s:it
maxlinelent header_name(titemsR RRRtencodeR (RRthtv((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pyR!Œs 
"cCsv|jƒ}|dkrdSt|tƒsDtdt|ƒƒ‚n|jrbtjd|ƒ}n|j    j
|ƒdS(Nsstring payload expected: %ss>From ( t get_payloadR$Rt
basestringt    TypeErrorttypeRtfcreR2R R(RRtpayload((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pyt _handle_text¬s      c Csg}|jƒ}|dkr'g}n>t|tƒrJ|jj|ƒdSt|tƒse|g}nxL|D]D}tƒ}|j|ƒ}|j    |dt
ƒ|j |j ƒƒqlW|j ƒ}|sñtj|ƒ}t|ƒ}|j|ƒn|jdk    r:|jr!tjd|jƒ}    n    |j}    |j|    IJn|jd|IJ|rm|jj|jdƒƒnx/|D]'}
|jd|IJ|jj|
ƒqtW|jjd|dƒ|jdk    r
|jJ|jrîtjd|jƒ} n    |j} |jj| ƒndS(NRs>From s--is
--(R;R$RR<R RtlistRR RR
tappendR%t get_boundarytNLR.t_make_boundaryt set_boundarytpreambleRR?R2tpoptepilogue( RRtmsgtextstsubpartstpartR tgtboundarytalltextRHt    body_partRJ((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pyt_handle_multipart¹sJ                               cCs4|j}zd|_|j|ƒWd||_XdS(Ni(RRR(RRtold_maxheaderlen((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pyt_handle_multipart_signedós
        cCsÀg}xš|jƒD]Œ}tƒ}|j|ƒ}|j|dtƒ|jƒ}|jdƒ}|r’|ddkr’|jtj    |d ƒƒq|j|ƒqW|j
j tj    |ƒƒdS(NRs
iÿÿÿÿt( R;RR RR
R%tsplitRCRER.R R(RRtblocksRMR RNttexttlines((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pyt_handle_message_delivery_statusþs     cCsrtƒ}|j|ƒ}|jƒ}t|tƒr^|j|jdƒdtƒ|jƒ}n|jj    |ƒdS(NiR(
RR R;RRBRR
R%R R(RRR RNR@((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pyt_handle_messages    
(t__name__t
__module__t__doc__R    RRR
RR RR"R!RAR0RRRTRZR[(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pyR s                               :        sD[Non-text (%(type)s) part of message omitted, filename %(filename)s]cBs)eZdZeddd„Zd„ZRS(s±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.
    iNcCs;tj||||ƒ|dkr.t|_n    ||_dS(sŒ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]
        N(RRR$t_FMTt_fmt(RRRRtfmt((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pyR/s  cCsÉxÂ|jƒD]´}|jƒ}|dkrD||jdtƒIJq |dkrSq ||ji|jƒd6|jƒd6|jƒd6|jdƒd6|jd    d
ƒd 6|jd d ƒd6IJq WdS(NRXtdecodet    multipartR>tmaintypetsubtypes [no filename]tfilenamesContent-Descriptions[no description]t descriptionsContent-Transfer-Encodings [no encoding]tencoding(    twalkR+R;R    R`tget_content_typeR,t get_filenametget(RRRMRd((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pyR"Ks           
    N(R\R]R^R    R$RR"(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pyR)sis%%0%ddcCs¨tjtjƒ}d    t|d}|dkr4|S|}d}xatr£tjdtj    |ƒdtj
ƒ}|j |ƒs‚Pn|dt |ƒ}|d7}qCW|S(
Nt=is==is^--s(--)?$t.is===============( trandomt    randrangetsystmaxintR`R$R    tretcompiletescapet    MULTILINEtsearchR(RXttokenROtbtcountertcre((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pyRFes     &(R^t__all__RsRqRRotwarningst    cStringIORt email.headerRR-RERtRvR?R RR_RtlentreprRrt_widthR`R$RF(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/email/generator.pyt<module>s&          
ÿ9