config root man

Current Path : /compat/linux/proc/self/root/usr/local/lib/python2.5/email/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //compat/linux/proc/self/root/usr/local/lib/python2.5/email/message.pyc

hRc@sdZdgZddkZddkZddkZddkZddklZddkZ	ddk	l
Z
ddk	lZdZei
dZei
d	Zded
ZdZdZddd
YZdS(s8Basic message object for the email package object model.tMessageiN(tStringIO(tutils(terrorss; s\s*;\s*s[ \(\)<>@,;:\\"/\[\]\?=]cCs|dj	ot|djot|to/|d7}ti|d|d|d}n|pti|od|ti|fSqd||fSn|SdS(s~Convenience function to format and return a key=value pair.

    This will quote the value if needed or if quote is true.
    it*iis%s="%s"s%s=%sN(	tNonetlent
isinstancettupleRtencode_rfc2231t	tspecialstsearchtquote(tparamtvalueR((s)/usr/local/lib/python2.5/email/message.pyt_formatparam"s 
%cCsg}x|d djo|d}|id}xB|djo4|idd|do|id|d}q6W|djot|}n|| }d|jo?|id}|| iid||di}n|i|i||}q	W|S(Nit;it"it=(tfindtcountRtindextstriptlowertappend(tstplisttendtfti((s)/usr/local/lib/python2.5/email/message.pyt_parseparam8s"
'


0cCsGt|to&|d|dti|dfSnti|SdS(Niii(RRRtunquote(R((s)/usr/local/lib/python2.5/email/message.pyt
_unquotevalueJs&cBseZdZdZdZedZdZdZdZ	dZ
d.edZd.d	Z
d
ZdZdZd
ZdZdZdZdZdZdZdZd.dZd.dZdZdZdZdZdZdZ dZ!dZ"d.de#d Z$d.de#d!Z%d"e#d.d#d$Z&de#d%Z'd"e#d&Z(d.d'Z)d.d(Z*d)Z+d.d*Z,d.d+Z-d,d-k.l/Z/RS(/sBasic 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 occurrance 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.
    cCsJg|_d|_d|_d|_d|_|_g|_d|_dS(Ns
text/plain(	t_headersRt	_unixfromt_payloadt_charsettpreambletepiloguetdefectst
_default_type(tself((s)/usr/local/lib/python2.5/email/message.pyt__init__es					cCs|idtS(swReturn the entire formatted message as a string.
        This includes the headers, body, and envelope header.
        tunixfrom(t	as_stringtTrue(R)((s)/usr/local/lib/python2.5/email/message.pyt__str__pscCsBddkl}t}||}|i|d||iS(sReturn 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 because by default it mangles lines that begin with
        "From ".  For more flexibility, use the flatten() method of a
        Generator instance.
        i(t	GeneratorR+(temail.GeneratorR/Rtflattentgetvalue(R)R+R/tfptg((s)/usr/local/lib/python2.5/email/message.pyR,vs

	cCst|itS(s6Return True if the message consists of multiple parts.(RR#tlist(R)((s)/usr/local/lib/python2.5/email/message.pytis_multipartscCs
||_dS(N(R"(R)R+((s)/usr/local/lib/python2.5/email/message.pytset_unixfromscCs|iS(N(R"(R)((s)/usr/local/lib/python2.5/email/message.pytget_unixfromscCs4|idjo|g|_n|ii|dS(sAdd 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(R#RR(R)tpayload((s)/usr/local/lib/python2.5/email/message.pytattachscCsW|djo
|i}n>t|itptdt|in|i|}|o|iodSn|iddi}|djot	i
|SqS|djo2yt	i|SWqOti
j
o|SqOXqS|d
joZt}y0tit|d
|dt|i}WqOti
j
o|SqOXqSn|S(sZReturn 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.
        sExpected list, got %sscontent-transfer-encodingtsquoted-printabletbase64s
x-uuencodetuuencodetuuesx-uues
tquietN(s
x-uuencodeR=R>sx-uue(RR#RR5t	TypeErrorttypeR6tgetRRt_qdecodet_bdecodetbinasciitErrorRtuutdecodeR-R2(R)RRHR9tctetsfp((s)/usr/local/lib/python2.5/email/message.pytget_payloads0







	 cCs+||_|dj	o|i|ndS(sSet the payload to the given value.

        Optional charset sets the message's default character set.  See
        set_charset() for details.
        N(R#Rtset_charset(R)R9tcharset((s)/usr/local/lib/python2.5/email/message.pytset_payloads	
cCs|djo|idd|_dSnt|totii|}nt|tiipt|n||_|i	dp|i
ddn|i	dp |i
ddd|in|id|it
||ijo|i|i|_n|i	dpY|i}y||Wqtj
o,|i|i|_|i
d|qXndS(sSet 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.

        RMNsMIME-Versions1.0sContent-Types
text/plainsContent-Transfer-Encoding(Rt	del_paramR$Rt
basestringtemailRMtCharsetR@thas_keyt
add_headertget_output_charsett	set_paramtstrtbody_encodeR#tget_body_encoding(R)RMRI((s)/usr/local/lib/python2.5/email/message.pyRLs0

		cCs|iS(sKReturn the Charset instance associated with the message's payload.
        (R$(R)((s)/usr/local/lib/python2.5/email/message.pytget_charset	scCs
t|iS(s9Return the total number of headers, including duplicates.(RR!(R)((s)/usr/local/lib/python2.5/email/message.pyt__len__scCs
|i|S(s-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
        occurrance gets returned is undefined.  Use get_all() to get all
        the values matching a header field name.
        (RB(R)tname((s)/usr/local/lib/python2.5/email/message.pyt__getitem__s	cCs|ii||fdS(sSet 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.
        N(R!R(R)R\tval((s)/usr/local/lib/python2.5/email/message.pyt__setitem__ scCsc|i}g}xA|iD]6\}}|i|jo|i||fqqW||_dS(swDelete all occurrences of a header, if present.

        Does not raise an exception if the header is missing.
        N(RR!R(R)R\t
newheaderstktv((s)/usr/local/lib/python2.5/email/message.pyt__delitem__(s
cCs:|ig}|iD]\}}||iq~jS(N(RR!(R)R\t_[1]RaRb((s)/usr/local/lib/python2.5/email/message.pyt__contains__4scCst}|i|||j	S(s/Return true if the message contains the header.(tobjectRB(R)R\tmissing((s)/usr/local/lib/python2.5/email/message.pyRS7s	cCs(g}|iD]\}}||q~S(s.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.
        (R!(R)RdRaRb((s)/usr/local/lib/python2.5/email/message.pytkeys<scCs(g}|iD]\}}||q~S(s)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.
        (R!(R)RdRaRb((s)/usr/local/lib/python2.5/email/message.pytvaluesFscCs|iS(s'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.
        (R!(R)((s)/usr/local/lib/python2.5/email/message.pytitemsPscCsE|i}x2|iD]'\}}|i|jo|SqqW|S(s~Get a header value.

        Like __getitem__() but return failobj instead of None when the field
        is missing.
        (RR!(R)R\tfailobjRaRb((s)/usr/local/lib/python2.5/email/message.pyRBZs
cCscg}|i}x;|iD]0\}}|i|jo|i|qqW|p|Sn|S(sQReturn 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).
        (RR!R(R)R\RkRiRaRb((s)/usr/local/lib/python2.5/email/message.pytget_alljs	
cKsg}xf|iD]X\}}|djo|i|iddq|it|idd|qW|dj	o|id|n|ii|ti|fdS(sExtended 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.

        Example:

        msg.add_header('content-disposition', 'attachment', filename='bud.gif')
        t_t-iN(	RjRRtreplaceRtinsertR!t	SEMISPACEtjoin(R)t_namet_valuet_paramstpartsRaRb((s)/usr/local/lib/python2.5/email/message.pyRT|s

&
cCs|i}xlttt|i|iD]=\}\}}|i|jo||f|i|<Pq.q.Wt|dS(sReplace 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(RtziptrangeRR!tKeyError(R)RsRtRRaRb((s)/usr/local/lib/python2.5/email/message.pytreplace_headers"	cCswt}|id|}||jo|iSnti|dii}|iddjodSn|S(s0Return 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.
        scontent-typeit/is
text/plain(RfRBtget_default_typetparamretsplitRRR(R)RgRtctype((s)/usr/local/lib/python2.5/email/message.pytget_content_types
	
cCs|i}|iddS(sReturn the message's main content type.

        This is the `maintype' part of the string returned by
        get_content_type().
        R{i(RR~(R)R((s)/usr/local/lib/python2.5/email/message.pytget_content_maintypescCs|i}|iddS(sReturns the message's sub-content type.

        This is the `subtype' part of the string returned by
        get_content_type().
        R{i(RR~(R)R((s)/usr/local/lib/python2.5/email/message.pytget_content_subtypescCs|iS(sReturn 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.
        (R((R)((s)/usr/local/lib/python2.5/email/message.pyR|scCs
||_dS(sSet 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(R((R)R((s)/usr/local/lib/python2.5/email/message.pytset_default_typesc	Cst}|i||}||jo|Sng}xtd|D]u}y4|idd\}}|i}|i}Wn%tj
o|i}d}nX|i||fqGWti|}|S(NRRiR;(	RfRBRR~Rt
ValueErrorRRt
decode_params(	R)RktheaderRgRtparamstpR\R^((s)/usr/local/lib/python2.5/email/message.pyt_get_params_preserves"	
scontent-typec	Cstt}|i||}||jo|Sn|o5g}|D]\}}||t|fqB~Sn|SdS(smReturn 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.
        N(RfRR (	R)RkRRRgRRdRaRb((s)/usr/local/lib/python2.5/email/message.pyt
get_paramss
	
5cCsu|i|p|SnxV|i||D]B\}}|i|ijo|ot|Sqm|Sq+q+W|S(sReturn 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.

        Your application should be prepared to deal with 3-tuple return
        values, and can convert the parameter to a Unicode string like so:

            param = msg.get_param('foo')
            if isinstance(param, tuple):
                param = unicode(param[2], param[0] or 'us-ascii')

        In any case, the parameter value (either the returned string, or the
        VALUE item in the 3-tuple) is always unquoted, unless unquote is set
        to False.
        (RSRRR (R)R
RkRRRaRb((s)/usr/local/lib/python2.5/email/message.pyt	get_paramssContent-TypeR;cCst|to|o|||f}n|i|o|idjo
d}n|i|}|i|d|pB|pt|||}q\ti|t|||g}nd}x|i	d|d|D]y\}}	d}
|i|ijot|||}
nt||	|}
|p
|
}qti||
g}qW||i|jo||=|||<ndS(sSet 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.
        scontent-types
text/plainRR;RN(
RRRSRRBRRRqRrR(R)R
RRtrequoteRMtlanguageRt	old_paramt	old_valuetappend_param((s)/usr/local/lib/python2.5/email/message.pyRV0s0$

cCs|i|pdSnd}x|id|d|D]g\}}|i|ijoB|pt|||}qti|t|||g}q7q7W||i|jo||=|||<ndS(s>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;RR(RSRRRRqRrRB(R)R
RRt	new_ctypeRRb((s)/usr/local/lib/python2.5/email/message.pyRO`s	 cCs|iddjp
tn|idjo|d=d|d<n|i|p|||<dSn|id|d	|}||=|||<x.|dD]"\}}|i||||qWdS(
sKSet 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.
        R{iscontent-typesmime-versions1.0sMIME-VersionNRR(RRRRSRRV(R)RARRRRRb((s)/usr/local/lib/python2.5/email/message.pytset_typevs


cCslt}|id|d}||jo|id|d}n||jo|Snti|iS(s@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.
        tfilenamescontent-dispositionR\(RfRRtcollapse_rfc2231_valueR(R)RkRgR((s)/usr/local/lib/python2.5/email/message.pytget_filenames	

cCsCt}|id|}||jo|Snti|iS(sReturn the boundary associated with the payload if present.

        The boundary is extracted from the Content-Type header's `boundary'
        parameter, and it is unquoted.
        tboundary(RfRRRtrstrip(R)RkRgR((s)/usr/local/lib/python2.5/email/message.pytget_boundarys
	
c
	Cst}|i|d}||jotidng}t}x[|D]S\}}|idjo!|idd|ft}qN|i||fqNW|p|idd|fng}x|iD]\}	}
|	idjorg}xI|D]A\}}
|
djo|i|q|id||
fqW|i|	t	i
|fq|i|	|
fqW||_dS(sSet 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.
        scontent-typesNo Content-Type header foundRs"%s"R;s%s=%sN(RfRRtHeaderParseErrortFalseRRR-R!RqRr(
R)RRgRt	newparamstfoundptpktpvR`thRbRvRa((s)/usr/local/lib/python2.5/email/message.pytset_boundarys6
	



 c	Cst}|id|}||jo|Snt|to[|dpd}y t|d|id}Wqttfj
o|d}qXny6t|tot|d}n|id}Wntj
o|SnX|i	S(sReturn 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.
        RMisus-asciii(
RfRRRtunicodetencodetLookupErrortUnicodeErrorRWR(R)RkRgRMtpcharset((s)/usr/local/lib/python2.5/email/message.pytget_content_charsets"	
 	cCs.g}|iD]}||i|q~S(sReturn 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.
        (twalkR(R)RkRdtpart((s)/usr/local/lib/python2.5/email/message.pytget_charsetssi(RN(0t__name__t
__module__t__doc__R*R.RR,R6R7R8R:RRKRNRLRZR[R]R_RcReRSRhRiRjRBRlRTRzRRRR|RRR-RRRVRORRRRRRtemail.IteratorsR(((s)/usr/local/lib/python2.5/email/message.pyRVsX						2
	+								
	
	
												#/ 
	-((Rt__all__treRGREtwarningst	cStringIORt
email.charsetRQRRRqtcompileR}R
RR-RRR R(((s)/usr/local/lib/python2.5/email/message.pys<module>s 			

Man Man