Your IP : 3.137.186.26


Current Path : /opt/alt/python33/lib64/python3.3/email/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/email/__pycache__/message.cpython-33.pyc

�
��fR�c@sdZdgZddlZddlZddlZddlZddlmZmZddl	m
Z
ddl	mZddlm
Z
ddl	mZdd	lmZejZd
Zejd�Zdd
�Zdddd�Zdd�Zdd�ZGdd�d�ZdS(u8Basic message object for the email package object model.uMessageiN(uBytesIOuStringIO(uutils(uerrors(ucompat32(ucharset(udecode_bu; u[ \(\)<>@,;:\\"/\[\]\?=]cCsJt|�jd�\}}}|s4|j�dfS|j�|j�fS(Nu;(ustru	partitionustripuNone(uparamuausepub((u2/opt/alt/python33/lib64/python3.3/email/message.pyu_splitparamsu_splitparamcCs�|d
k	r�t|�dkr�t|t�rf|d7}tj|d|d|d�}d||fSy|jd�Wn?tk
r�|d7}tj|dd�}d||fSYnX|s�tj	|�r�d	|tj
|�fSd||fSn|Sd
S(u~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.
    iu*iiu%s=%suasciiuutf-8uu%s="%s"N(uNoneulenu
isinstanceutupleuutilsuencode_rfc2231uencodeuUnicodeEncodeErroru	tspecialsusearchuquote(uparamuvalueuquote((u2/opt/alt/python33/lib64/python3.3/email/message.pyu_formatparam(s	
!

u_formatparamcCsOdt|�}g}x2|dd�dkrJ|dd�}|jd�}xR|dkr�|jdd|�|jdd|�dr�|jd|d�}qQW|dkr�t|�}n|d|�}d|kr$|jd�}|d|�j�j�d||dd�j�}n|j|j��||d�}qW|S(Nu;iiu"u\"iu=(ustrufinducountulenuindexustripuloweruappend(usuplistuendufui((u2/opt/alt/python33/lib64/python3.3/email/message.pyu_parseparamJs ;;u_parseparamcCsBt|t�r1|d|dtj|d�fStj|�SdS(Niii(u
isinstanceutupleuutilsuunquote(uvalue((u2/opt/alt/python33/lib64/python3.3/email/message.pyu
_unquotevalue^s"u
_unquotevaluecBsp|EeZdZdZedd�Zdd�Zd\ddd�Zd	d
�Z	dd�Z
d
d�Zdd�Zd[d\dd�Zd[dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd[d+d,�Zd-d.�Zd/d0�Zd[d1d2�Zd3d4�Zd5d6�Z d7d8�Z!d9d:�Z"d;d<�Z#d=d>�Z$d?d@�Z%dAdB�Z&d[dCd]dDdE�Z(d[dCd]dFdG�Z)dHd]d[dIdJdK�Z*dCd]dLdM�Z+dHd]dNdO�Z,d[dPdQ�Z-d[dRdS�Z.dTdU�Z/d[dVdW�Z0d[dXdY�Z1ddZl2m3Z3d[S(^uMessageu�Basic 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.
    cCsS||_g|_d|_d|_d|_d|_|_g|_d|_	dS(Nu
text/plain(
upolicyu_headersuNoneu	_unixfromu_payloadu_charsetupreambleuepilogueudefectsu
_default_type(uselfupolicy((u2/opt/alt/python33/lib64/python3.3/email/message.pyu__init__ys						uMessage.__init__cCs
|j�S(uwReturn the entire formatted message as a string.
        This includes the headers, body, and envelope header.
        (u	as_string(uself((u2/opt/alt/python33/lib64/python3.3/email/message.pyu__str__�suMessage.__str__icCsNddlm}t�}||ddd|�}|j|d|�|j�S(uMReturn the entire formatted message as a string.
        Optional `unixfrom' when True, means include the Unix From_ envelope
        header.

        This is a convenience method and may not generate the message exactly
        as you intend.  For more flexibility, use the flatten() method of a
        Generator instance.
        i(u	Generatorumangle_from_umaxheaderlenuunixfromF(uemail.generatoru	GeneratoruStringIOuFalseuflattenugetvalue(uselfuunixfromumaxheaderlenu	Generatorufpug((u2/opt/alt/python33/lib64/python3.3/email/message.pyu	as_string�s
		uMessage.as_stringcCst|jt�S(u6Return True if the message consists of multiple parts.(u
isinstanceu_payloadulist(uself((u2/opt/alt/python33/lib64/python3.3/email/message.pyuis_multipart�suMessage.is_multipartcCs
||_dS(N(u	_unixfrom(uselfuunixfrom((u2/opt/alt/python33/lib64/python3.3/email/message.pyuset_unixfrom�suMessage.set_unixfromcCs|jS(N(u	_unixfrom(uself((u2/opt/alt/python33/lib64/python3.3/email/message.pyuget_unixfrom�suMessage.get_unixfromcCs2|jdkr|g|_n|jj|�dS(u�Add 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.
        N(u_payloaduNoneuappend(uselfupayload((u2/opt/alt/python33/lib64/python3.3/email/message.pyuattach�suMessage.attachcCsT|j�r7|rdS|dkr)|jS|j|Sn|dk	rrt|jt�rrtdt|j���n|j}t|jdd��j	�}t|t�rat
j|�r|jdd�}|s^y"|j
|jdd�d�}Wqtk
r|j
dd�}YqXq^qa|ray|jd�}Wq^tk
rZ|jd�}Yq^Xqan|sk|S|d	kr�t
j|�S|d
kr�tdj|j���\}}x!|D]}|jj||�q�W|S|dkr=t|�}	t�}
y$tj
|	|
dd�|
j�SWq=tjk
r9|SYq=Xnt|t�rP|S|S(uZReturn 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.
        uExpected list, got %sucontent-transfer-encodinguuasciiusurrogateescapeucharsetureplaceuraw-unicode-escapeuquoted-printableubase64su
x-uuencodeuuuencodeuuueux-uueuquietN(u
x-uuencodeuuuencodeuuueux-uueT(uis_multipartuNoneu_payloadu
isinstanceulistu	TypeErrorutypeustrugetuloweruutilsu_has_surrogatesuencodeudecodeu	get_paramuLookupErroruUnicodeErroru_qdecodeudecode_bujoinu
splitlinesupolicyu
handle_defectuBytesIOuuuuTrueugetvalueuError(uselfuiudecodeupayloaducteubpayloaduvalueudefectsudefectuin_fileuout_file((u2/opt/alt/python33/lib64/python3.3/email/message.pyuget_payload�sV"	"


!
	uMessage.get_payloadcCs�t|d�r[|dkr(||_dSt|t�sFt|�}n|j|j�}nt|d�r�|jdd�|_n	||_|dk	r�|j|�ndS(u�Set the payload to the given value.

        Optional charset sets the message's default character set.  See
        set_charset() for details.
        uencodeNudecodeuasciiusurrogateescape(	uhasattruNoneu_payloadu
isinstanceuCharsetuencodeuoutput_charsetudecodeuset_charset(uselfupayloaducharset((u2/opt/alt/python33/lib64/python3.3/email/message.pyuset_payloads		uMessage.set_payloadcCs�|dkr&|jd�d|_dSt|t�sDt|�}n||_d|krl|jdd�nd|kr�|jddd|j��n|jd|j��||j�kr�|j|j	�|_	nd|kr�|j
�}y||�Wq�tk
r�|j	}|r\y|jdd	�}Wq\t
k
rX|j|j�}Yq\Xn|j|�|_	|jd|�Yq�XndS(
u�Set 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.
        ucharsetNuMIME-Versionu1.0uContent-Typeu
text/plainuContent-Transfer-Encodinguasciiusurrogateescape(uNoneu	del_paramu_charsetu
isinstanceuCharsetu
add_headeruget_output_charsetu	set_paramubody_encodeu_payloaduget_body_encodingu	TypeErroruencodeuUnicodeErroruoutput_charset(uselfucharsetucteupayload((u2/opt/alt/python33/lib64/python3.3/email/message.pyuset_charset$s8
		
	
uMessage.set_charsetcCs|jS(uKReturn the Charset instance associated with the message's payload.
        (u_charset(uself((u2/opt/alt/python33/lib64/python3.3/email/message.pyuget_charsetSsuMessage.get_charsetcCs
t|j�S(u9Return the total number of headers, including duplicates.(ulenu_headers(uself((u2/opt/alt/python33/lib64/python3.3/email/message.pyu__len__[suMessage.__len__cCs
|j|�S(u-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.
        (uget(uselfuname((u2/opt/alt/python33/lib64/python3.3/email/message.pyu__getitem___s	uMessage.__getitem__cCs�|jj|�}|r�|j�}d}x`|jD]R\}}|j�|kr4|d7}||kr�tdj||���q�q4q4Wn|jj|jj||��dS(u�Set 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.
        iiu/There may be at most {} {} headers in a messageN(upolicyuheader_max_countuloweru_headersu
ValueErroruformatuappenduheader_store_parse(uselfunameuvalu	max_countulnameufoundukuv((u2/opt/alt/python33/lib64/python3.3/email/message.pyu__setitem__js
	uMessage.__setitem__cCsa|j�}g}x?|jD]4\}}|j�|kr|j||f�qqW||_dS(uwDelete all occurrences of a header, if present.

        Does not raise an exception if the header is missing.
        N(uloweru_headersuappend(uselfunameu
newheadersukuv((u2/opt/alt/python33/lib64/python3.3/email/message.pyu__delitem__|suMessage.__delitem__cCs |j�dd�|jD�kS(NcSs"g|]\}}|j��qS((ulower(u.0ukuv((u2/opt/alt/python33/lib64/python3.3/email/message.pyu
<listcomp>�s	u(Message.__contains__.<locals>.<listcomp>(uloweru_headers(uselfuname((u2/opt/alt/python33/lib64/python3.3/email/message.pyu__contains__�suMessage.__contains__ccs#x|jD]\}}|Vq
WdS(N(u_headers(uselfufielduvalue((u2/opt/alt/python33/lib64/python3.3/email/message.pyu__iter__�suMessage.__iter__cCsdd�|jD�S(u.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.
        cSsg|]\}}|�qS(((u.0ukuv((u2/opt/alt/python33/lib64/python3.3/email/message.pyu
<listcomp>�s	u Message.keys.<locals>.<listcomp>(u_headers(uself((u2/opt/alt/python33/lib64/python3.3/email/message.pyukeys�suMessage.keyscs�fdd��jD�S(u)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.
        cs+g|]!\}}�jj||��qS((upolicyuheader_fetch_parse(u.0ukuv(uself(u2/opt/alt/python33/lib64/python3.3/email/message.pyu
<listcomp>�s	u"Message.values.<locals>.<listcomp>(u_headers(uself((uselfu2/opt/alt/python33/lib64/python3.3/email/message.pyuvalues�suMessage.valuescs�fdd��jD�S(u'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.
        cs1g|]'\}}|�jj||�f�qS((upolicyuheader_fetch_parse(u.0ukuv(uself(u2/opt/alt/python33/lib64/python3.3/email/message.pyu
<listcomp>�s	u!Message.items.<locals>.<listcomp>(u_headers(uself((uselfu2/opt/alt/python33/lib64/python3.3/email/message.pyuitems�su
Message.itemscCsO|j�}x<|jD]1\}}|j�|kr|jj||�SqW|S(u~Get a header value.

        Like __getitem__() but return failobj instead of None when the field
        is missing.
        (uloweru_headersupolicyuheader_fetch_parse(uselfunameufailobjukuv((u2/opt/alt/python33/lib64/python3.3/email/message.pyuget�s
uMessage.getcCs|jj||f�dS(u�Store name and value in the model without modification.

        This is an "internal" API, intended only for use by a parser.
        N(u_headersuappend(uselfunameuvalue((u2/opt/alt/python33/lib64/python3.3/email/message.pyuset_raw�suMessage.set_rawcCst|jj��S(u�Return the (name, value) header pairs without modification.

        This is an "internal" API, intended only for use by a generator.
        (uiteru_headersucopy(uself((u2/opt/alt/python33/lib64/python3.3/email/message.pyu	raw_items�suMessage.raw_itemscCskg}|j�}xH|jD]=\}}|j�|kr|j|jj||��qqW|sg|S|S(uQReturn 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).
        (uloweru_headersuappendupolicyuheader_fetch_parse(uselfunameufailobjuvaluesukuv((u2/opt/alt/python33/lib64/python3.3/email/message.pyuget_all�s	#uMessage.get_allcKs�g}xd|j�D]V\}}|dkrG|j|jdd��q|jt|jdd�|��qW|dk	r�|jd|�ntj|�||<dS(u�Extended 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'))
        u_u-iN(uitemsuNoneuappendureplaceu_formatparamuinsertu	SEMISPACEujoin(uselfu_nameu_valueu_paramsupartsukuv((u2/opt/alt/python33/lib64/python3.3/email/message.pyu
add_header�s&uMessage.add_headercCs�|j�}xsttt|j��|j�D]D\}\}}|j�|kr.|jj||�|j|<Pq.q.Wt|��dS(u�Replace 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(uloweruzipurangeulenu_headersupolicyuheader_store_parseuKeyError(uselfu_nameu_valueuiukuv((u2/opt/alt/python33/lib64/python3.3/email/message.pyureplace_headers4uMessage.replace_headercCsdt�}|jd|�}||kr1|j�St|�dj�}|jd�dkr`dS|S(u0Return 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.
        ucontent-typeiu/iu
text/plain(uobjectugetuget_default_typeu_splitparamulowerucount(uselfumissinguvalueuctype((u2/opt/alt/python33/lib64/python3.3/email/message.pyuget_content_types
	
uMessage.get_content_typecCs|j�}|jd�dS(u�Return the message's main content type.

        This is the `maintype' part of the string returned by
        get_content_type().
        u/i(uget_content_typeusplit(uselfuctype((u2/opt/alt/python33/lib64/python3.3/email/message.pyuget_content_maintype-suMessage.get_content_maintypecCs|j�}|jd�dS(u�Returns the message's sub-content type.

        This is the `subtype' part of the string returned by
        get_content_type().
        u/i(uget_content_typeusplit(uselfuctype((u2/opt/alt/python33/lib64/python3.3/email/message.pyuget_content_subtype6suMessage.get_content_subtypecCs|jS(uReturn 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.
        (u
_default_type(uself((u2/opt/alt/python33/lib64/python3.3/email/message.pyuget_default_type?suMessage.get_default_typecCs
||_dS(u�Set 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.
        N(u
_default_type(uselfuctype((u2/opt/alt/python33/lib64/python3.3/email/message.pyuset_default_typeHsuMessage.set_default_typec	Cs�t�}|j||�}||kr+|Sg}x�t|�D]t}y4|jdd�\}}|j�}|j�}Wn$tk
r�|j�}d}YnX|j||f�q>Wtj|�}|S(Nu=iu(	uobjectugetu_parseparamusplitustripu
ValueErroruappenduutilsu
decode_params(	uselfufailobjuheaderumissinguvalueuparamsupunameuval((u2/opt/alt/python33/lib64/python3.3/email/message.pyu_get_params_preserveQs 	
uMessage._get_params_preserveucontent-typecCsJt�}|j||�}||kr+|S|rBdd�|D�S|SdS(umReturn 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.
        cSs(g|]\}}|t|�f�qS((u
_unquotevalue(u.0ukuv((u2/opt/alt/python33/lib64/python3.3/email/message.pyu
<listcomp>xs	u&Message.get_params.<locals>.<listcomp>N(uobjectu_get_params_preserve(uselfufailobjuheaderuunquoteumissinguparams((u2/opt/alt/python33/lib64/python3.3/email/message.pyu
get_paramsfs
	uMessage.get_paramscCsf||kr|SxO|j||�D];\}}|j�|j�kr#|rWt|�S|Sq#q#W|S(u�Return 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)

        (u_get_params_preserveuloweru
_unquotevalue(uselfuparamufailobjuheaderuunquoteukuv((u2/opt/alt/python33/lib64/python3.3/email/message.pyu	get_param|s
uMessage.get_paramuContent-TypeucCswt|t�r(|r(|||f}n||krO|j�dkrOd}n|j|�}|j|d|�s�|s�t|||�}qJtj|t|||�g�}n�d}x�|jd|d|�D]u\}}	d}
|j�|j�krt|||�}
nt||	|�}
|s1|
}q�tj||
g�}q�W||j|�krs||=|||<ndS(u�Set 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 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.
        ucontent-typeu
text/plainuheaderuuunquoteN(	u
isinstanceutupleulowerugetu	get_paramu_formatparamu	SEMISPACEujoinu
get_params(uselfuparamuvalueuheaderurequoteucharsetulanguageuctypeu	old_paramu	old_valueuappend_param((u2/opt/alt/python33/lib64/python3.3/email/message.pyu	set_param�s.		uMessage.set_paramcCs�||krdSd}x}|jd|d|�D]c\}}|j�|j�kr/|snt|||�}q�tj|t|||�g�}q/q/W||j|�kr�||=|||<ndS(u>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.
        Nuuheaderuunquote(u
get_paramsuloweru_formatparamu	SEMISPACEujoinuget(uselfuparamuheaderurequoteu	new_ctypeupuv((u2/opt/alt/python33/lib64/python3.3/email/message.pyu	del_param�s%	uMessage.del_paramcCs�|jd�dkst�n|j�dkrD|d=d|d<n||kr^|||<dS|jd|d	|�}||=|||<x4|dd�D]"\}}|j||||�q�WdS(
uKSet 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.
        u/iucontent-typeumime-versionu1.0uMIME-VersionNuheaderuunquote(ucountu
ValueErroruloweru
get_paramsu	set_param(uselfutypeuheaderurequoteuparamsupuv((u2/opt/alt/python33/lib64/python3.3/email/message.pyuset_type�s	


uMessage.set_typecCset�}|jd|d�}||krB|jd|d�}n||krR|Stj|�j�S(u@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.
        ufilenameucontent-dispositionunameucontent-type(uobjectu	get_paramuutilsucollapse_rfc2231_valueustrip(uselfufailobjumissingufilename((u2/opt/alt/python33/lib64/python3.3/email/message.pyuget_filenames	uMessage.get_filenamecCs>t�}|jd|�}||kr+|Stj|�j�S(u�Return the boundary associated with the payload if present.

        The boundary is extracted from the Content-Type header's `boundary'
        parameter, and it is unquoted.
        uboundary(uobjectu	get_paramuutilsucollapse_rfc2231_valueurstrip(uselfufailobjumissinguboundary((u2/opt/alt/python33/lib64/python3.3/email/message.pyuget_boundarys
	uMessage.get_boundarycCs�t�}|j|d�}||kr9tjd��ng}d}xY|D]Q\}}|j�dkr�|jdd|f�d	}qL|j||f�qLW|s�|jdd|f�ng}x�|jD]�\}	}
|	j�dkrmg}xG|D]?\}}
|
dkr$|j|�q�|jd||
f�q�Wt	j
|�}
|j|jj|	|
��q�|j|	|
f�q�W||_dS(
u�Set 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.
        ucontent-typeuNo Content-Type header founduboundaryu"%s"uu%s=%sNFT(
uobjectu_get_params_preserveuerrorsuHeaderParseErroruFalseuloweruappenduTrueu_headersu	SEMISPACEujoinupolicyuheader_store_parse(uselfuboundaryumissinguparamsu	newparamsufoundpupkupvu
newheadersuhuvupartsukuval((u2/opt/alt/python33/lib64/python3.3/email/message.pyuset_boundary!s2
		uMessage.set_boundarycCs�t�}|jd|�}||kr+|St|t�r�|dpGd}y&|djd�}t||�}Wq�ttfk
r�|d}Yq�Xny|jd�Wntk
r�|SYnX|j�S(u�Return 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.
        ucharsetiuus-asciiiuraw-unicode-escape(	uobjectu	get_paramu
isinstanceutupleuencodeustruLookupErroruUnicodeErrorulower(uselfufailobjumissingucharsetupcharsetuas_bytes((u2/opt/alt/python33/lib64/python3.3/email/message.pyuget_content_charsetOs 	
	uMessage.get_content_charsetcs�fdd�|j�D�S(u�Return 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.
        csg|]}|j���qS((uget_content_charset(u.0upart(ufailobj(u2/opt/alt/python33/lib64/python3.3/email/message.pyu
<listcomp>}s	u(Message.get_charsets.<locals>.<listcomp>(uwalk(uselfufailobj((ufailobju2/opt/alt/python33/lib64/python3.3/email/message.pyuget_charsetsmsuMessage.get_charsets(uwalkNFT(4u__name__u
__module__u__qualname__u__doc__ucompat32u__init__u__str__uFalseu	as_stringuis_multipartuset_unixfromuget_unixfromuattachuNoneuget_payloaduset_payloaduset_charsetuget_charsetu__len__u__getitem__u__setitem__u__delitem__u__contains__u__iter__ukeysuvaluesuitemsugetuset_rawu	raw_itemsuget_allu
add_headerureplace_headeruget_content_typeuget_content_maintypeuget_content_subtypeuget_default_typeuset_default_typeu_get_params_preserveuTrueu
get_paramsu	get_paramu	set_paramu	del_paramuset_typeuget_filenameuget_boundaryuset_boundaryuget_content_charsetuget_charsetsuemail.iteratorsuwalk(u
__locals__((u2/opt/alt/python33/lib64/python3.3/email/message.pyuMessagejs\Z/
				!/ 
.T(u__doc__u__all__ureuuuubase64ubinasciiuiouBytesIOuStringIOuemailuutilsuerrorsuemail._policybaseucompat32ucharsetu_charsetuemail._encoded_wordsudecode_buCharsetu	SEMISPACEucompileu	tspecialsu_splitparamuNoneuTrueu_formatparamu_parseparamu
_unquotevalueuMessage(((u2/opt/alt/python33/lib64/python3.3/email/message.pyu<module>s&		
"

?>