KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21571/root/usr/lib64/python2.4/email/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21571/root/usr/lib64/python2.4/email/Header.pyc
mò
‚=5Dc@sÿdZdkZdkZdkZdkZdklZdkl	Z	dZ
dZdZddZ
dZd	Ze	d
ƒZe	dƒZeideieiBƒZeid
ƒZeiiZd„Zeedd„Zdfd„ƒYZd„Zd„ZdS(s+Header encoding and decoding functionality.N(sHeaderParseError(sCharsets
t u iuiLsus-asciisutf-8si
  =\?                   # literal =?
  (?P<charset>[^?]*?)   # non-greedy up to the next ? is the charset
  \?                    # literal ?
  (?P<encoding>[qb])    # either a "q" or a "b", case insensitive
  \?                    # literal ?
  (?P<encoded>.*?)      # non-greedy up to the next ?= is the encoded string
  \?=                   # literal ?=
  s[\041-\176]+:$cCs?t|ƒ}ti|ƒp|d	fgSng}d}
xÿ|iƒD]ñ}	ti|	ƒp|i	|	d	fƒqFnti
|	ƒ}x¯|o§|idƒi
ƒ}|oW|o9|ddd	jo$|ddt|d	f|d<q|i	|d	fƒn|og}|dd!D]}||iƒq~\}}|d}d	}
|djotii|ƒ}
nG|djo9ytii|ƒ}
Wq¶tij
o
t‚q¶Xn|
d	jo
|}
n|o=|dd|jo(|dd|
|ddf|d<q(|i	|
|fƒn|dd5qˆWqFW|S(
sÒDecode a message header value without converting charset.

    Returns a list of (decoded_string, charset) pairs containing each of the
    decoded parts of the header.  Charset is None for non-encoded parts of the
    header, otherwise a lower-case string containing the name of the character
    set specified in the encoded string.

    An email.Errors.HeaderParseError may be raised when certain decoding error
    occurs (e.g. a base64 decoding exception).
    tiiÿÿÿÿiitqtbiN(tstrtheadertecretsearchtNonetdecodedtdect
splitlinestlinetappendtsplittpartstpoptstriptunenctSPACEt_[1]tstlowertcharsettencodingtencodedtemailt
quopriMIMEt
header_decodet
base64MIMEtdecodetbinasciitErrortHeaderParseError(RR	RRRRRRRRR
((t$/usr/lib64/python2.4/email/Header.pyt
decode_header1sJ

$4




(cCsttd|d|d|ƒ}xR|D]J\}}|dj	o!t	|t
ƒot
|ƒ}n|i||ƒq"W|S(s¼Create a Header from a sequence of pairs as returned by decode_header()

    decode_header() takes a header value string and returns a sequence of
    pairs of the format (decoded_string, charset) where charset is the string
    name of the character set.

    This function takes one of those sequence of pairs and returns a Header
    instance.  Optional maxlinelen, header_name, and continuation_ws are as in
    the Header constructor.
    t
maxlinelentheader_nametcontinuation_wsN(tHeaderR$R%R&thtdecoded_seqRRRt
isinstancetCharsetR
(R)R$R%R&R(RR((R"tmake_headerjsR'cBs}tZddddddd„Zd„Zd„Zd„Zd„Zddd„Zd	„Z	d
„Z
d„Zdd
„ZRS(NRtstrictcCsç|djo
t}nt|tƒpt|ƒ}n||_||_t	|i
dtƒƒ}g|_
|dj	o|i|||ƒn|djo
t}n|djo
||_n|t	|ƒd|_|||_dS(s Create a MIME-compliant header that can contain many character sets.

        Optional s is the initial header value.  If None, the initial header
        value is not set.  You can later append to the header with .append()
        method calls.  s may be a byte string or a Unicode string, but see the
        .append() documentation for semantics.

        Optional charset serves two purposes: it has the same meaning as the
        charset argument to the .append() method.  It also sets the default
        character set for all subsequent .append() calls that omit the charset
        argument.  If charset is not provided in the constructor, the us-ascii
        charset is used both as s's initial charset and as the default for
        subsequent .append() calls.

        The maximum line length can be specified explicit via maxlinelen.  For
        splitting the first line to a shorter value (to account for the field
        header which isn't included in s, e.g. `Subject') pass in the name of
        the field in header_name.  The default maxlinelen is 76.

        continuation_ws must be RFC 2822 compliant folding whitespace (usually
        either a space or a hard tab) which will be prepended to continuation
        lines.

        errors is passed through to the .append() call.
        s	iN(RRtUSASCIIR*R+tselft_charsetR&t_continuation_wstlentreplacetSPACE8tcws_expanded_lent_chunksRR
terrorsR$t
MAXLINELENR%t
_firstlinelent_maxlinelen(R/RRR$R%R&R7R5((R"t__init__‚s"

			




cCs
|iƒS(sA synonym for self.encode().N(R/tencode(R/((R"t__str__·scCs¹g}d}x|iD]’\}}|}|oW|djo(|djo|it	ƒd}q‚q†|djo|it	ƒq†n|}|it
|t|ƒƒƒqWti
|ƒS(s)Helper for the built-in unicode function.sus-asciiN(Nsus-ascii(Nsus-ascii(Nsus-ascii(tuchunksRtlastcsR/R6RRtnextcsR
tUSPACEtunicodeRtUEMPTYSTRINGtjoin(R/RR>RR@R?((R"t__unicode__»s 




 cCs||iƒjS(N(totherR/R<(R/RF((R"t__eq__ÒscCs||jS(N(R/RF(R/RF((R"t__ne__×scCs7|djo
|i}n!t|tƒpt|ƒ}n|djoÖt|tƒoF|ipd}t
|||ƒ}|i
pd}|i||ƒqt|t
ƒolxit|tfD]C}y'|i
pd}|i||ƒ}PWq½tj
oq½Xq½Wtp
td‚qn|ii||fƒdS(s>Append a string to the MIME header.

        Optional charset, if given, should be a Charset instance or the name
        of a character set (which will be converted to a Charset instance).  A
        value of None (the default) means that the charset given in the
        constructor is used.

        s may be a byte string or a Unicode string.  If it is a byte string
        (i.e. isinstance(s, str) is true), then charset is the encoding of
        that byte string, and a UnicodeError will be raised if the string
        cannot be decoded with that charset.  If s is a Unicode string, then
        charset is a hint specifying the character set of the characters in
        the string.  In this case, when producing an RFC 2822 compliant header
        using RFC 2047 rules, the Unicode string will be encoded using the
        following charsets in order: us-ascii, the charset hint, utf-8.  The
        first character set not to provoke a UnicodeError is used.

        Optional `errors' is passed as the third argument to any unicode() or
        ustr.encode() call.
        t8bitsus-asciisutf-8 conversion failedN(RRR/R0R*R+RRtinput_codectincodecRBR7tustrtoutput_codectoutcodecR<R.tUTF8tUnicodeErrortFalsetAssertionErrorR6R
(R/RRR7RLRNRK((R"R
Ús,


	cCsA|i|ƒ}|i|tƒ}|i|ƒ}	|	|jo||fgSn|djo||fgSn‰|djo|i||||ƒSnb|	t
|ƒjo6|}
|i||
 tƒ}
|i||
tƒ}nt|||ƒ\}
}|i|
ƒ}|i|tƒ}||fg}||i|||i|ƒS(NRIsus-ascii(Rt
to_splittableRt
splittabletfrom_splittabletTrueRtencoded_header_lentelenR$R/t_split_asciit
splitcharsR2tsplitpntRQtfirsttlastt	_binsplittfsplittabletfencodedtchunkt_splitR:(R/RRR$RZR]RTR_R`RXR[RRaR\((R"Rbs$


cCs8t|||i|i|ƒ}t||gt
|ƒƒS(N(RYRtfirstlenR/R:R1RZtchunkstzipRR2(R/RRRcRZRd((R"RY?sc	Cs¹g}x–|D]Ž\}}|pq
n|djp|idjo
|}n|i|ƒ}|o|didƒo
d}nd}t
||||ƒq
Wt|i}|i|ƒS(NiÿÿÿÿRR(Rdt	newchunksRRRtheader_encodingRt
header_encodetendswithtextrat_max_appendR$tNLR/R1tjoinerRD(	R/RfR$RjRRRRdRm((R"t_encode_chunksDs


s;, c
Cs¨g}|i}d}	x€|iD]u\}}||	d}||i	dƒjo
|}n||i
||||ƒ7}|d\}}|i	|ƒ}	qW|i||ƒS(s‡Encode a message header into an RFC-compliant format.

        There are many issues involved in converting a given string for use in
        an email header.  Only certain character sets are readable in most
        email clients, and as header strings can only contain a subset of
        7-bit ASCII, care must be taken to properly convert and encode (with
        Base64 or quoted-printable) header strings.  In addition, there is a
        75-character length limit on any given encoded header field, so
        line-wrapping must be performed, even with double-byte character sets.

        This method will do its best to convert the string to the correct
        character set used in email, and encode and line wrap it safely with
        the appropriate scheme for that character set.

        If the given charset is not known or an error occurs during
        conversion, this function will return the header untouched.

        Optional splitchars is a string containing characters to split long
        ASCII lines on, in rough support of RFC 2822's `highest level
        syntactic breaks'.  This doesn't affect RFC 2047 encoded lines.
        iiRiÿÿÿÿN(RfR/R9R$tlastlenR6RRt	targetlenRWRbRZt	lastchunktlastcharsetRn(
R/RZR$RqRrRRfRRpRo((R"R<gs	

(
t__name__t
__module__RR;R=RERGRHR
RbRYRnR<(((R"R's5				7	.		#cCsg}
|}x}|iƒD]o}|iƒ}t|ƒ|jo|
i|ƒ|}qnx6|D]}||joPq_q_W|
i|ƒ|}qti
d|ƒ}|djo
|}nd}|d}t|ƒ}t|idtƒƒ}g}d}	xi|i|ƒD]X}
|	tdt|ƒdƒ|}t|
ƒ}|
}|djoI|oBt|ƒdjo/ti|dƒo|i|
ƒ|	|7}	q|||jo |o|
i|i |ƒ|ƒn||joG|djo:t!|
|||dƒ}|
i#|d ƒ|dg}n
|
g}|t|dƒ}	|}q|i|
ƒ|	|7}	qW|o|
i|i |ƒƒqqW|
S(	Ns%s\s*s;,RRs	iiiÿÿÿÿ($tlinesRctmaxlenRRRtlstripR2R
trestlenRZtchtretcompiletcreteolRmtjoinlenR&R3R4twslentthistlinelenRtparttmaxtcurlentpartlentonfirstlinetfcretmatchRDRYtsubltextend(RRcRxR&RZRyR‰RR~RR‚RR€RuR}RvR…R|RmR†R„((R"RYsb


	



!;
	

c
Csµd}t|ƒ}xj||jo\||dd?}|i|| tƒ}|i	|ƒ}||jo
|}q|d}qW|i|| tƒ}	|i||tƒ}|	|fS(Nii(tiR2RTtjtmRRURVRaRWtchunklenR$RQR\R](
RTRR$R‹RaRRŒRŽR]R\((R"R^Õs
	

(t__doc__RzRtemail.quopriMIMERtemail.base64MIMEtemail.ErrorsR!t
email.CharsetR+RlRRAR4RCR8R.ROR{tVERBOSEt
IGNORECASERR‡RRkR#RR,R'RYR^(RCR,R+R!RARkRlROR.RRzR^RR8RRYR‡RR'R#R4((R"t?s.				



	9ÿ	F

Anon7 - 2021