python (3.11.7)

(root)/
lib/
python3.11/
email/
__pycache__/
message.cpython-311.opt-1.pyc

eOdZddgZddlZddlZddlZddlmZmZddlm	Z	ddlm
Z
ddlmZm
Z
dd	lmZdd
lmZejZdZejdZd
ZddZdZdZdZGddZGddeZGddeZdS)z8Basic message object for the email package object model.MessageEmailMessageN)BytesIOStringIO)utils)errors)Policycompat32charset)decode_bz; z[ \(\)<>@,;:\\"/\[\]\?=]ct|d\}}}|s|dfS||fS)N;)str	partitionstrip)paramasepbs    A/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/email/message.py_splitparamrsX
E

$$S))IAsAwwyy$7799aggiiTc|t|dkrt|tr4|dz
}tj|d|d|d}|d|S	|dn2#t$r%|dz
}tj|dd	}|d|cYSwxYw|st|r|d
tj	|dS|d|S|S)a~Convenience function to format and return a key=value pair.

    This will quote the value if needed or if quote is true.  If value is a
    three tuple (charset, language, value), it will be encoded according
    to RFC2231 rules.  If it contains non-ascii characters it will likewise
    be encoded according to RFC2231 rules, using the utf-8 charset and
    a null language.
    Nr*=asciizutf-8z="")
len
isinstancetuplerencode_rfc2231encodeUnicodeEncodeError	tspecialssearchquote)rvaluer*s   r_formatparamr,'s#
SZZ!^^eU##	0SLE(q58U1XFFE#eeUU++
0W%%%%%
0
0
0,UGR@@"'%%////
0	,I$$U++	, %u{5'9'9'9'9::#eeUU++s A66,B%$B%c.dt|z}g}|dddkrq|dd}|d}|dkr|dd||dd|z
dzrQ|d|dz}|dkr2|dd||dd|z
dzQ|dkrt|}|d|}d|vrf|d}|d|dz||dzdz}||||d}|dddkq|S)Nrrrr!z\"rr)rfindcountr"indexrlowerappend)splistendfis     r_parseparamr8Isc!ffAE
BQB%3,,
abbEffSkkAgg17733//!''%C2H2HHAMg&&cAg&&CAgg17733//!''%C2H2HHAMg77a&&C
dsdG!88A"1"

##%%+a!gmmoo=A
QWWYY
cddGBQB%3,,Lrct|tr)|d|dtj|dfStj|S)Nrrr)r#r$runquote)r+s r
_unquotevaluer;]sI
%$Qxq5=q#:#:::}U###rcg}t|}|D]g}|drP|dd\}}}	t|dn #t$rYcwxYwht
d|D]}|st
d|ddkrnt	tj	|}nH#tj
$r6|d	d
z
dzdzd
zdz}tj	|d|}YnwxYw||d|S)zDecode uuencoded data.sbegin  )basez`begin` line not foundzTruncated inputs 	
sendr ?Nr)
iter
splitlines
startswithremoveprefixrint
ValueErrorrbinasciia2b_uuErrorr2join)	encoded
decoded_linesencoded_lines_iterlinemode_pathdecoded_linenbytess	         r
_decode_uurXhsMg002233"
3
3??9%%	 --i88BB4HHMD!T
Dq!!!!



		1222"++	.///
ZZ
%
%
/
/E	:#?400LL~	:	:	:Q
b(A-1a7F#?4=99LLL	:	\****88M"""s%*A==
B
	B
C##AD('D(cVeZdZdZefdZdZd7dZdZd8d	Z	d
Z
dZdZd
Z
d9dZd:dZdZdZdZdZdZdZdZdZdZdZdZd:dZdZdZd:dZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d;d)Z'		d;d*Z(		d<d-Z)d=d.Z*d>d/Z+d:d0Z,d:d1Z-d2Z.d:d3Z/d:d4Z0d5Z1dd6l2m3Z3dS)?raBasic message object.

    A message object is defined as something that has a bunch of RFC 2822
    headers and a payload.  It may optionally have an envelope header
    (a.k.a. Unix-From or From_ header).  If the message is a container (i.e. a
    multipart or a message/rfc822), then the payload is a list of Message
    objects, otherwise it is a string.

    Message objects implement part of the `mapping' interface, which assumes
    there is exactly one occurrence of the header per message.  Some headers
    do in fact appear multiple times (e.g. Received) and for those headers,
    you must use the explicit API to set or get all the headers.  Not all of
    the mapping methods are implemented.
    c||_g|_d|_d|_d|_dx|_|_g|_d|_dS)N
text/plain)	policy_headers	_unixfrom_payload_charsetpreambleepiloguedefects
_default_type)selfr\s  r__init__zMessage.__init__sH


(,,

)rc*|S)z9Return the entire formatted message as a string.
        )	as_stringres r__str__zMessage.__str__s~~rFrNcddlm}||jn|}t}||d||}||||S)aReturn the entire formatted message as a string.

        Optional 'unixfrom', when true, means include the Unix From_ envelope
        header.  For backward compatibility reasons, if maxheaderlen is
        not specified it defaults to 0, so you must override it explicitly
        if you want a different maxheaderlen.  'policy' is passed to the
        Generator instance used to serialize the message; if it is not
        specified the policy associated with the message instance is used.

        If the message object contains binary data that is not encoded
        according to RFC standards, the non-compliant data will be replaced by
        unicode "unknown character" code points.
        r)	GeneratorNF)mangle_from_maxheaderlenr\unixfrom)email.generatorrlr\rflattengetvalue)rerprnr\rlfpgs       rrhzMessage.as_stringsu	.----- &F
ZZIb#(#/#
%
%
%	
		$	***{{}}rc*|S)z?Return the entire formatted message as a bytes object.
        )as_bytesris r	__bytes__zMessage.__bytes__s}}rcddlm}||jn|}t}||d|}||||S)aJReturn the entire formatted message as a bytes object.

        Optional 'unixfrom', when true, means include the Unix From_ envelope
        header.  'policy' is passed to the BytesGenerator instance used to
        serialize the message; if not specified the policy associated with
        the message instance is used.
        r)BytesGeneratorNF)rmr\ro)rqrzr\rrrrs)rerpr\rzrtrus      rrwzMessage.as_bytessh	322222 &F
YYN2E&AAA			$	***{{}}rc6t|jtS)z6Return True if the message consists of multiple parts.)r#r_listris ris_multipartzMessage.is_multiparts$-...rc||_dSNr^)rerps  rset_unixfromzMessage.set_unixfroms
!rc|jSrrris rget_unixfromzMessage.get_unixfroms
~rc|j
|g|_dS	|j|dS#t$rtdwxYw)zAdd the given payload to the current payload.

        The current payload will always be a list of objects after this method
        is called.  If you want to set the payload to a scalar object, use
        set_payload() instead.
        Nz=Attach is not valid on a message with a non-multipart payload)r_r2AttributeError	TypeError)repayloads  rattachzMessage.attachsl= $IDMMM
:
$$W-----!
:
:
:!9:::
:s	/A	cr|r|rdS||jS|j|S|>t|jts$t	dt|jz|j}t
|dd}t|trtj
|rk|dd}|sR	||
ddd}ne#t$r|dd}YnCwxYwn>|r<	|d}n%#t$r|d	}YnwxYw|s|S|d
krt!j|S|dkrYt%d|\}}|D]}|j|||S|d
vr"	t/|S#t0$r|cYSwxYwt|tr|S|S)aZReturn a reference to the payload.

        The payload will either be a list object or a string.  If you mutate
        the list object, you modify the message's payload in place.  Optional
        i returns that index into the payload.

        Optional decode is a flag indicating whether the payload should be
        decoded or not, according to the Content-Transfer-Encoding header
        (default is False).

        When True and the message is not a multipart, the payload will be
        decoded if this header's value is `quoted-printable' or `base64'.  If
        some other encoding is used, or the header is missing, or if the
        payload has bogus data (i.e. bogus base64 or uuencoded data), the
        payload is returned as-is.

        If the message is a multipart and the decode flag is True, then None
        is returned.
        NzExpected list, got %szcontent-transfer-encodingr rsurrogateescaperreplaceraw-unicode-escapezquoted-printablebase64r)z
x-uuencodeuuencodeuuezx-uue)r}r_r#r|rtypergetr1r_has_surrogatesr&decode	get_paramLookupErrorUnicodeErrorquopridecodestringr
rNrFr\
handle_defectrXrJ)	rer7rrctebpayloadr+rcdefects	         rget_payloadzMessage.get_payloadsD	(
ty}$}Q''
=DM4!@!@=3d4=6I6IIJJJ-$((6;;<<BBDDgs##	D$W--
D">>'3DEEFF"*//$..G2T2TV_"`"`&FFF"*//'9"E"EFF

DD&~~g66HH#DDD
 '~~.BCCHHHD	N$$$&x000
H__&chhx/B/B/D/D&E&EFFNE7!
8
8))$7777L
>
>
>
 !(+++
 
 
 
 gs##	Os6-*D D;:D;EE:9E:?HHHcPt|drI|	||_dSt|tst|}||j}t|dr|dd|_n||_|||dSdS)zSet the payload to the given value.

        Optional charset sets the message's default character set.  See
        set_charset() for details.
        r&Nrrr)hasattrr_r#Charsetr&output_charsetrset_charset)rerrs   rset_payloadzMessage.set_payloadJs7H%%	= '
gw//
+!'**nnW%;<<G7H%%	$#NN74EFFDMM#DMW%%%%%rcP||dd|_dSt|tst|}||_d|vr|ddd|vr+|dd|n(|d|||kr||j|_d|vr|	}	||dS#t$r|j}|rB	|d	d
}n*#t$r||j
}YnwxYw|||_|d|YdSwxYwdS)aSet the charset of the payload to a given character set.

        charset can be a Charset instance, a string naming a character set, or
        None.  If it is a string it will be converted to a Charset instance.
        If charset is None, the charset parameter will be removed from the
        Content-Type field.  Anything else will generate a TypeError.

        The message will be assumed to be of type text/* encoded with
        charset.input_charset.  It will be converted to charset.output_charset
        and encoded properly, if needed, when generating the plain text
        representation of the message.  MIME headers (MIME-Version,
        Content-Type, Content-Transfer-Encoding) will be added as needed.
        NrMIME-Version1.0Content-Typer[rzContent-Transfer-Encodingrr)	del_paramr`r#r
add_headerget_output_charset	set_parambody_encoder_get_body_encodingrr&rr)rerrrs    rrzMessage.set_charset^s?NN9%%% DMF'7++	'g&&G
%%OONE222%%OONL$+$>$>$@$@

B
B
B
B
NN9g&@&@&B&BCCCg002222#//
>>DM&d22++--C

BD					
B
B
B-II")..:K"L"L'III")..1G"H"HI ' 3 3G < <
 ;SAAAAAA
B	32s6
DF#.EF#$E,)F#+E,,3F#"F#c|jS)zKReturn the Charset instance associated with the message's payload.
        )r`ris rget_charsetzMessage.get_charsets}rc*t|jS)z9Return the total number of headers, including duplicates.)r"r]ris r__len__zMessage.__len__s4=!!!rc,||S)a-Get a header value.

        Return None if the header is missing instead of raising an exception.

        Note that if the header appeared multiple times, exactly which
        occurrence gets returned is undefined.  Use get_all() to get all
        the values matching a header field name.
        )rrenames  r__getitem__zMessage.__getitem__sxx~~rcv|j|}|ri|}d}|jD]K\}}||kr.|dz
}||kr#t	d||L|j|j||dS)zSet the value of a header.

        Note: this does not overwrite an existing header with the same field
        name.  Use __delitem__() first to delete any existing headers.
        rrz/There may be at most {} {} headers in a messageN)r\header_max_countr1r]rJformatr2header_store_parse)rerval	max_countlnamefoundkvs        r__setitem__zMessage.__setitem__sK0066		QJJLLEE

Q
Q17799%%QJE	))(*88>y$8O8OQQQ
T[;;D#FFGGGGGrc|}g}|jD]4\}}||kr|||f5||_dS)zwDelete all occurrences of a header, if present.

        Does not raise an exception if the header is missing.
        N)r1r]r2)rer
newheadersrrs     r__delitem__zMessage.__delitem__sb
zz||
M	*	*DAqwwyyD  !!1a&)))"


rcL|d|jDvS)Nc<g|]\}}|S)r1.0rrs   r
<listcomp>z(Message.__contains__.<locals>.<listcomp>s$DDDda		DDDr)r1r]rs  r__contains__zMessage.__contains__s&zz||DDdmDDDDDrc#,K|jD]	\}}|V
dSrr])refieldr+s   r__iter__zMessage.__iter__s0 M		LE5KKKK		rc$d|jDS)a.Return a list of all the message's header field names.

        These will be sorted in the order they appeared in the original
        message, or were added to the message, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        cg|]\}}|Srrrs   rrz Message.keys.<locals>.<listcomp>s,,,da,,,rrris rkeyszMessage.keyss-,dm,,,,rc*fdjDS)a)Return a list of all the message's header values.

        These will be sorted in the order they appeared in the original
        message, or were added to the message, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        cLg|] \}}j||!Srr\header_fetch_parserrrres   rrz"Message.values.<locals>.<listcomp>s?+++Aq..q!44+++rrris`rvalueszMessage.values0++++ M+++	+rc*fdjDS)a'Get all the message's header fields and values.

        These will be sorted in the order they appeared in the original
        message, or were added to the message, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        cPg|]"\}}|j||f#Srrrs   rrz!Message.items.<locals>.<listcomp>sD+++AqDK221a889+++rrris`ritemsz
Message.itemsrrc|}|jD]:\}}||kr|j||cS;|S)z~Get a header value.

        Like __getitem__() but return failobj instead of None when the field
        is missing.
        )r1r]r\r)rerfailobjrrs     rrzMessage.getsazz||M	<	<DAqwwyyD  {55a;;;;;!rc>|j||fdS)zStore name and value in the model without modification.

        This is an "internal" API, intended only for use by a parser.
        N)r]r2)rerr+s   rset_rawzMessage.set_raws$
	

dE]+++++rcNt|jS)zReturn the (name, value) header pairs without modification.

        This is an "internal" API, intended only for use by a generator.
        )rEr]copyris r	raw_itemszMessage.raw_itemss 
DM&&(()))rcg}|}|jD]K\}}||kr.||j||L|s|S|S)aQReturn a list of all the values for the named field.

        These will be sorted in the order they appeared in the original
        message, and may contain duplicates.  Any fields deleted and
        re-inserted are always appended to the header list.

        If no such fields exist, failobj is returned (defaults to None).
        )r1r]r2r\r)rerrrrrs      rget_allzMessage.get_allswzz||M	D	DDAqwwyyD  

dk<<QBBCCC	N
rc	ng}|D]h\}}|*||dd1|t|dd|i||d|t
|||<dS)uExtended header setting.

        name is the header field to add.  keyword arguments can be used to set
        additional parameters for the header field, with underscores converted
        to dashes.  Normally the parameter will be added as key="value" unless
        value is None, in which case only the key will be added.  If a
        parameter value contains non-ASCII characters it can be specified as a
        three-tuple of (charset, language, value), in which case it will be
        encoded according to RFC2231 rules.  Otherwise it will be encoded using
        the utf-8 charset and a language of ''.

        Examples:

        msg.add_header('content-disposition', 'attachment', filename='bud.gif')
        msg.add_header('content-disposition', 'attachment',
                       filename=('utf-8', '', Fußballer.ppt'))
        msg.add_header('content-disposition', 'attachment',
                       filename='Fußballer.ppt'))
        NrT-r)rr2rr,insert	SEMISPACErN)re_name_value_paramspartsrrs       rrzMessage.add_headers(MMOO	C	CDAqyQYYsC001111\!))C*=*=qAABBBBLLF###nnU++Urc>|}ttt|j|jD]F\}\}}||kr&|j|||j|<dSGt|)zReplace a header.

        Replace the first matching header found in the message, retaining
        header order and case.  If no matching header was found, a KeyError is
        raised.
        N)r1zipranger"r]r\rKeyError)rerrr7rrs      rreplace_headerzMessage.replace_header<s

U3t}#5#566
FF	"	"IAv1wwyyE!!#';#A#A!V#L#L
a "5//!rct}|d|}||ur|St|d}|ddkrdS|S)a0Return the message's content type.

        The returned string is coerced to lower case of the form
        `maintype/subtype'.  If there was no Content-Type header in the
        message, the default type as given by get_default_type() will be
        returned.  Since according to RFC 2045, messages always have a default
        type this will always return a value.

        RFC 2045 defines a message's default type to be text/plain unless it
        appears inside a multipart/digest container, in which case it would be
        message/rfc822.
        content-typer/rr[)objectrget_default_typerr1r/)remissingr+ctypes    rget_content_typezMessage.get_content_typeOs|((11G((***E""1%++--;;sq  <rc`|}|ddS)zReturn the message's main content type.

        This is the `maintype' part of the string returned by
        get_content_type().
        rrrsplitrers  rget_content_maintypezMessage.get_content_maintypeg,%%''{{3""rc`|}|ddS)zReturns the message's sub-content type.

        This is the `subtype' part of the string returned by
        get_content_type().
        rrrrs  rget_content_subtypezMessage.get_content_subtypeprrc|jS)aReturn the `default' content type.

        Most messages have a default content type of text/plain, except for
        messages that are subparts of multipart/digest containers.  Such
        subparts have a default content type of message/rfc822.
        rdris rrzMessage.get_default_typeys
!!rc||_dS)zSet the `default' content type.

        ctype should be either "text/plain" or "message/rfc822", although this
        is not enforced.  The default content type is not stored in the
        Content-Type header.
        Nrrs  rset_default_typezMessage.set_default_types#rct}|||}||ur|Sg}t|D]}	|dd\}}|}|}n&#t
$r|}d}YnwxYw|||ftj|}|S)Nrrr )	rrr8rrrJr2r
decode_params)	rerheaderrr+paramsprrs	         r_get_params_preservezMessage._get_params_preserves(())GNU##		'		'A
GGCOO	czz||iikk


wwyy

MM4+&&&&$V,,
sAB B$#B$rTcvt}|||}||ur|S|rd|DS|S)amReturn the message's Content-Type parameters, as a list.

        The elements of the returned list are 2-tuples of key/value pairs, as
        split on the `=' sign.  The left hand side of the `=' is the key,
        while the right hand side is the value.  If there is no `=' sign in
        the parameter the value is the empty string.  The value is as
        described in the get_param() method.

        Optional failobj is the object to return if there is no Content-Type
        header.  Optional header is the header to search instead of
        Content-Type.  If unquote is True, the value is unquoted.
        c6g|]\}}|t|fSr)r;rs   rrz&Message.get_params.<locals>.<listcomp>s)===daQ
a(()===r)rr)rerrr:rr	s      r
get_paramszMessage.get_paramssS((**7F;;WN	==f====Mrc||vr|S|||D]F\}}||kr|rt|cS|cSG|S)aReturn the parameter value if found in the Content-Type header.

        Optional failobj is the object to return if there is no Content-Type
        header, or the Content-Type header has no such parameter.  Optional
        header is the header to search instead of Content-Type.

        Parameter keys are always compared case insensitively.  The return
        value can either be a string, or a 3-tuple if the parameter was RFC
        2231 encoded.  When it's a 3-tuple, the elements of the value are of
        the form (CHARSET, LANGUAGE, VALUE).  Note that both CHARSET and
        LANGUAGE can be None, in which case you should consider VALUE to be
        encoded in the us-ascii charset.  You can usually ignore LANGUAGE.
        The parameter value (either the returned string, or the VALUE item in
        the 3-tuple) is always unquoted, unless unquote is set to False.

        If your application doesn't care whether the parameter was RFC 2231
        encoded, it can turn the return value into a string as follows:

            rawparam = msg.get_param('foo')
            param = email.utils.collapse_rfc2231_value(rawparam)

        )rr1r;)rerrrr:rrs       rrzMessage.get_params0N--gv>>		DAqwwyyEKKMM))(+++++HHH	*
rrr ct|ts|r|||f}||vr|dkrd}n||}|||s@|st|||}nt|t|||g}nd}|||D]u\}	}
d}|	|krt|||}nt|	|
|}|s|}Yt||g}v|||kr$|r|	||dS||=|||<dSdS)aSet a parameter in the Content-Type header.

        If the parameter already exists in the header, its value will be
        replaced with the new value.

        If header is Content-Type and has not yet been defined for this
        message, it will be set to "text/plain" and the new parameter and
        value will be appended as per RFC 2045.

        An alternate header can be specified in the header argument, and all
        parameters will be quoted as necessary unless requote is False.

        If charset is specified, the parameter will be encoded according to RFC
        2231.  Optional language specifies the RFC 2231 language, defaulting
        to the empty string.  Both charset and language should be strings.
        rr[)rr rr:N)
r#r$r1rrr,rrNrr)rerr+rrequoterlanguagerr	old_param	old_valueappend_params            rrzMessage.set_params$%''	/G	/h.E&,,..N"B"B EEHHV$$E~~eF~33	B
B$UE7;;!Lw??@BBE(,v@G)8)I)I

B

B$	9!??$$

55#/ug#F#FLL#/	9g#N#NLB(EE%NNE<+@AAEEDHHV$$$$
%##FE22222L$V%$rc	h||vrdSd}|||D]n\}}||kr?|st|||}Ct|t|||g}o|||kr
||=|||<dSdS)a>Remove the given parameter completely from the Content-Type header.

        The header will be re-written in place without the parameter or its
        value. All values will be quoted as necessary unless requote is
        False.  Optional header specifies an alternative to the Content-Type
        header.
        Nr r)rr1r,rrNr)rerrr	new_ctyper
rs       rrzMessage.del_paramsF	OO67OCC	N	NDAqwwyyEKKMM)) N ,Q7 ; ;II )	0<Q70K0K0M!N!NI((((V$DLLL)(rc*|ddkst|dkr|d=d|d<||vr|||<dS|||}||=|||<|ddD]\}}|||||dS)	aKSet the main type and subtype for the Content-Type header.

        type must be a string in the form "maintype/subtype", otherwise a
        ValueError is raised.

        This method replaces the Content-Type header, keeping all the
        parameters in place.  If requote is False, this leaves the existing
        header's quoting as is.  Otherwise, the parameters will be quoted (the
        default).

        An alternative header can be specified in the header argument.  When
        the Content-Type header is set, we'll always also add a MIME-Version
        header.
        rrrzmime-versionrrNr)r/rJr1rr)rerrrr	r
rs       rset_typezMessage.set_type!s zz#!##<<>>^++^$#(D DLF@@LV122J	2	2DAqNN1a1111	2	2rct}|d|d}||ur|d|d}||ur|Stj|S)a@Return the filename associated with the payload if present.

        The filename is extracted from the Content-Disposition header's
        `filename' parameter, and it is unquoted.  If that header is missing
        the `filename' parameter, this method falls back to looking for the
        `name' parameter.
        filenamecontent-dispositionrr)rrrcollapse_rfc2231_valuer)rerrrs    rget_filenamezMessage.get_filenameAsp((>>*g7LMMw~~fg~FFHwN+H55;;===rct}|d|}||ur|Stj|S)zReturn the boundary associated with the payload if present.

        The boundary is extracted from the Content-Type header's `boundary'
        parameter, and it is unquoted.
        boundary)rrrrrstrip)rerrr!s    rget_boundaryzMessage.get_boundaryQsM((>>*g66wN+H55<<>>>rct}||d}||urtjdg}d}|D]Q\}}|dkr|dd|zfd}:|||fR|s|dd|zfg}|jD]\}	}
|	dkrg}|D];\}}
|
dkr||!||d|
<t|}
||j	
|	|
||	|
f||_d	S)
aSet the boundary parameter in Content-Type to 'boundary'.

        This is subtly different than deleting the Content-Type header and
        adding a new one with a new boundary parameter via add_header().  The
        main difference is that using the set_boundary() method preserves the
        order of the Content-Type header in the original message.

        HeaderParseError is raised if the message has no Content-Type header.
        rzNo Content-Type header foundFr!z"%s"Tr rN)rrrHeaderParseErrorr1r2r]rrNr\r)rer!rr		newparamsfoundppkpvrhrrrrs              rset_boundaryzMessage.set_boundary^s((**7NCCW)*HIII		+	+FBxxzzZ''  *fx.?!@AAA  "b****	>
j&8*;<===
M	*	*DAqwwyyN**%77DAqBwwQ11%56666nnU++!!$+"@"@C"H"HIIII!!1a&))))"


rct}|d|}||ur|St|trV|dpd}	|dd}t||}n#ttf$r|d}YnwxYw	|dn#t$r|cYSwxYw|S)zReturn the charset parameter of the Content-Type header.

        The returned string is always coerced to lower case.  If there is no
        Content-Type header, or if that header has no charset parameter,
        failobj is returned.
        rrzus-asciirr)	rrr#r$r&rrrr1)rerrrpcharsetrws      rget_content_charsetzMessage.get_content_charsets((..G44gNgu%%
	%qz/ZH
%#1:,,-ABBh11.
%
%
%!!*
%	NN:&&&&			NNN	}}s$+A77BBB--B<;B<cDfd|DS)aReturn a list containing the charset(s) used in this message.

        The returned list of items describes the Content-Type headers'
        charset parameter for this message and all the subparts in its
        payload.

        Each item will either be a string (the value of the charset parameter
        in the Content-Type header of that part) or the value of the
        'failobj' parameter (defaults to None), if the part does not have a
        main MIME type of "text", or the charset is not defined.

        The list will contain one string for each part of the message, plus
        one for the container message (i.e. self), so that a non-multipart
        message will still return a list of length 1.
        c:g|]}|Sr)r.)rpartrs  rrz(Message.get_charsets.<locals>.<listcomp>s'JJJd((11JJJrwalk)rers `rget_charsetszMessage.get_charsetss( KJJJdiikkJJJJrc|d}|dSt|d}|S)zReturn the message's content-disposition if it exists, or None.

        The return values can be either 'inline', 'attachment' or None
        according to the rfc2183.
        rNr)rrr1)rer+c_ds   rget_content_dispositionzMessage.get_content_dispositionsC.//=4%  #))++
rr2)FrN)FN)NFr)NrT)rTNr F)rT)rT)4__name__
__module____qualname____doc__r
rfrjrhrxrwr}rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr#r+r.r4r7email.iteratorsr3rrrrrsP

'
*
*
*
*   
0




///"""::: UUUUn&&&&(-B-B-B^"""			HHH$
#
#
#EEE---	+	+	+	+	+	+



",,,***$,,,<
"
"
"&0######"""###*,5C    DFJ5:1%1%1%1%f%%%%,2222@>>>> ????,#,#,#\<KKKK$


%$$$$$$$rceZdZdfd	Zdfd	ZdZdZdZdd	Zhd
Z	dZ
dZdd
dZdd
dZ
dZddZddZddZdddZdZdZdZdZdZxZS)MIMEPartNc^|ddlm}|}t|dS)Nr)default)email.policyr@superrf)rer\r@	__class__s   rrfzMIMEPart.__init__s=>,,,,,,F
     rFcr||jn|}||j}t|||S)aReturn the entire formatted message as a string.

        Optional 'unixfrom', when true, means include the Unix From_ envelope
        header.  maxheaderlen is retained for backward compatibility with the
        base Message class, but defaults to None, meaning that the policy value
        for max_line_length controls the header maximum length.  'policy' is
        passed to the Generator instance used to serialize the message; if it
        is not specified the policy associated with the message instance is
        used.
        )r\max_line_lengthrBrh)rerprnr\rCs    rrhzMIMEPart.as_strings>!'F!1Lww  <@@@rc`||jdS)NT)utf8r\)rhr\cloneris rrjzMIMEPart.__str__s)~~T[%6%6D%6%A%A~BBBrcJ|d}|dn
|jdkS)NrF
attachment)rcontent_disposition)rer6s  r
is_attachmentzMIMEPart.is_attachments*hh,--uu)@L)PPrc#K|rdS|d\}}|dkr||vr|||fVdS|dks|sdS|dkr5|D]}|||Ed{VdSd|vr|d|fVd}|d}|r'|D]}|d|kr|}n| |}|r|dnd}||||Ed{VdSdS)Nrtext	multipartrelatedstart
content-idr)	rMrrr0r}
iter_parts
_find_bodyrr)	rer1preferencelistmaintypesubtypesubpart	candidaterRsubpartss	         rrUzMIMEPart._find_bodys	F 113399#>>'v.((%++G44d;;;;F{""$*;*;*=*="Fi??,,
D
D??7NCCCCCCCCCCF&&!''	22D9999	w''	??,,

<(E11 'IE2''))H'/9TI y.AAAAAAAAAAA! rrQhtmlplainct|}d}|||D]\}}||kr|}|}|dkrn|S)aReturn best candidate mime part for display as 'body' of message.

        Do a depth first search, starting with self, looking for the first part
        matching each of the items in preferencelist, and return the part
        corresponding to the first item that has a match, or None if no items
        have a match.  If 'related' is not included in preferencelist, consider
        the root part of any multipart/related encountered as a candidate
        match.  Ignore parts with 'Content-Disposition: attachment'.
        Nr)r"rU)rerV	best_priobodyprior1s      rget_bodyzMIMEPart.get_body	s`''	//$??		JD$i 	199Er>rOr]rOr^rPrQrPalternativec#K|d\}}|dks|dkrdS|}	|}n#t$rYdSwxYw|dkr|dkr||d}|rFd}g}|D]3}|d|krd	}||4|r
|Ed{VdS|d
|Ed{VdSg}	|D]i}|d\}}||f|j	vr.|
s||	vr|	|e|VjdS)aReturn an iterator over the non-main parts of a multipart.

        Skip the first of each occurrence of text/plain, text/html,
        multipart/related, or multipart/alternative in the multipart (unless
        they have a 'Content-Disposition: attachment' header) and include all
        remaining subparts in the returned iterator.  When applied to a
        multipart/related, return all parts except the root part.  Return an
        empty iterator when applied to a multipart/alternative or a
        non-multipart.
        rrPrhNrQrRFrSTr)rrrrrrrr2pop_body_typesrM)
rerWrXrrrRrattachmentsr1seens
          riter_attachmentszMIMEPart.iter_attachments!s!113399#>>'{""g&>&>F""$$	LLNNEE			FF	{""w)';';NN7++E

 !11Dxx--66 $#**40000********FIIaLLLF		D $ 5 5 7 7 = =c B BHg7#t'777**,,8181D1DG$$$JJJJ
		sA%%
A32A3c#jK|r|Ed{VdSdS)z~Return an iterator over all immediate subparts of a multipart.

        Return an empty iterator for a non-multipart.
        N)r}rris rrTzMIMEPart.iter_partsXsP
	*'')))))))))))	*	*r)content_managerc@||jj}|j|g|Ri|Sr)r\rpget_contentrerpargskws    rrrzMIMEPart.get_content`s5""k9O**4=$==="===rcD||jj}|j|g|Ri|dSr)r\rpset_contentrss    rrwzMIMEPart.set_contentes;""k9O##D64666266666rc^|dkrA|}||fz}||vr#td||g}g}|jD][\}}|dr|||fD|||f\|r:t||j	}	||	_|j
|	_
|	g|_
ng|_
||_d|z|d<||d|dSdS)NrPzCannot convert {} to {}content-rHz
multipart/rr!)rrrJrr]r1rGr2rr\r_r)
rerXdisallowed_subtypesr!existing_subtypekeep_headerspart_headersrr+r1s
          r_make_multipartzMIMEPart._make_multipartjsc$$&&+55#7799"5
"B#666 !:!A!A$g"/"/000=	3	3KD%zz||&&z22
3##T5M2222##T5M2222	4::T[111D(DM MDM!FDMMDM$
+g5^NN:x00000 rc4|dd|dS)NrQ)rhmixedr~rer!s  rmake_relatedzMIMEPart.make_relateds!Y(@(KKKKKrc4|dd|dS)Nrh)rrrs  rmake_alternativezMIMEPart.make_alternatives ]JAAAAArc4|dd|dS)Nrrrrs  r
make_mixedzMIMEPart.make_mixeds Wb(33333r)_dispc2|dks||krt|d|zt||j}|j|i||r	d|vr||d<||dS)NrPmake_rHrzContent-Disposition)rrgetattrrr\rwr)re_subtyperrtrur1s      r_add_multipartzMIMEPart._add_multiparts%%'';66((**h66-GD'H,--///tDzz---$%"%%%	0*$66*/D&'Drc,|jdg|Rddi|dS)NrQrinlinerrertrus   radd_relatedzMIMEPart.add_relateds0ICCCCHCCCCCCrc(|jdg|Ri|dS)Nrhrrs   radd_alternativezMIMEPart.add_alternatives+M7D777B77777rc,|jdg|Rddi|dS)NrrrKrrs   radd_attachmentzMIMEPart.add_attachments0GEdEEE,E"EEEEErc"g|_d|_dSrr]r_ris rclearzMIMEPart.clears



rc@d|jD|_d|_dS)Ncjg|]0\}}|d,||f1S)ry)r1rG)rnrs   rrz*MIMEPart.clear_content.<locals>.<listcomp>sQBBBDAq !		 4 4Z @ @B!QBBBrrris r
clear_contentzMIMEPart.clear_contents3BBDMBBB



rr)FNN)r\)r8r9r:rfrhrjrMrUrcrkrnrTrrrwr~rrrrrrrrr
__classcell__rCs@rr>r>s!!!!!!AAAAAA CCCQQQBBB:(111K555n***26>>>>>
2677777
1116LLLLBBBB444459DDD888FFFrr>ceZdZfdZxZS)rcPtj|i|d|vrd|d<dSdS)Nrr)rBrw)rertrurCs   rrwzEmailMessage.set_contentsBT(R(((%%#(D   &%r)r8r9r:rwrrs@rrrs8)))))))))r)NT)r;__all__rKreriorremailrremail._policybaser	r
rr`email._encoded_wordsr
rrcompiler(rr,r8r;rXrr>rrrr<module>rs
?>n
%				



        ........%%%%%%))))))

	
BJ233	       D($$$###>B
%B
%B
%B
%B
%B
%B
%B
%J\\\\\w\\\~)))))8)))))r