AlkantarClanX12

Your IP : 18.191.178.16


Current Path : /proc/self/root/opt/alt/python33/lib64/python3.3/email/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python33/lib64/python3.3/email/__pycache__/charset.cpython-33.pyo

�
��fCCc@s�ddddgZddlmZddlZddlZddlmZddlmZd	Z	d
Z
dZdZd
Z
dZdZie	e	dfd6e	e	dfd6e	e	dfd6e	e	dfd6e	e	dfd6e	e	dfd6e	e	dfd6e	e	dfd6e	e	dfd6e	e	dfd6e	e	dfd6e	e	dfd6dEd
6e
e
dfd6e
e
dfd6e
ddfd6e
ddfd 6e
ddfd6e
e
dfd!6ee
d"fd"6Zidd#6dd$6dd%6dd&6dd'6dd(6dd)6dd*6dd+6dd,6dd-6dd.6dd/6dd06dd16dd26dd36dd46dd56dd66d7d86dd96d:d;6d
d<6Zid=d6d>d6dd
6Zdddd?d�Zd@d�ZdAd�ZdBdC�ZGdDd�d�ZdS(FuCharsetu	add_aliasuadd_charsetu	add_codeci(upartialN(uerrors(uencode_7or8bitiiiiuus-asciiuunknown-8bituu
iso-8859-1u
iso-8859-2u
iso-8859-3u
iso-8859-4u
iso-8859-9uiso-8859-10uiso-8859-13uiso-8859-14uiso-8859-15uiso-8859-16uwindows-1252uvisciiubig5ugb2312uiso-2022-jpueuc-jpu	shift_jisukoi8-ruutf-8ulatin_1ulatin-1ulatin_2ulatin-2ulatin_3ulatin-3ulatin_4ulatin-4ulatin_5ulatin-5ulatin_6ulatin-6ulatin_7ulatin-7ulatin_8ulatin-8ulatin_9ulatin-9ulatin_10ulatin-10uks_c_5601-1987ucp949ueuc_jpueuc-krueuc_kruasciiueucgb2312_cnubig5_twcCs2|tkrtd��n|||ft|<dS(u>Add character set properties to the global registry.

    charset is the input character set, and must be the canonical name of a
    character set.

    Optional header_enc and body_enc is either Charset.QP for
    quoted-printable, Charset.BASE64 for base64 encoding, Charset.SHORTEST for
    the shortest of qp or base64 encoding, or None for no encoding.  SHORTEST
    is only valid for header_enc.  It describes how message headers and
    message bodies in the input charset are to be encoded.  Default is no
    encoding.

    Optional output_charset is the character set that the output should be
    in.  Conversions will proceed from input charset, to Unicode, to the
    output charset when the method Charset.convert() is called.  The default
    is to output in the same character set as the input.

    Both input_charset and output_charset must have Unicode codec entries in
    the module's charset-to-codec mapping; use add_codec(charset, codecname)
    to add codecs the module does not know about.  See the codecs module's
    documentation for more information.
    u!SHORTEST not allowed for body_encN(uSHORTESTu
ValueErroruCHARSETS(ucharsetu
header_encubody_encuoutput_charset((u2/opt/alt/python33/lib64/python3.3/email/charset.pyuadd_charsetmscCs|t|<dS(u�Add a character set alias.

    alias is the alias name, e.g. latin-1
    canonical is the character set's canonical name, e.g. iso-8859-1
    N(uALIASES(ualiasu	canonical((u2/opt/alt/python33/lib64/python3.3/email/charset.pyu	add_alias�scCs|t|<dS(u$Add a codec that map characters in the given charset to/from Unicode.

    charset is the canonical name of a character set.  codecname is the name
    of a Python codec, as appropriate for the second argument to the unicode()
    built-in, or to the encode() method of a Unicode string.
    N(u	CODEC_MAP(ucharsetu	codecname((u2/opt/alt/python33/lib64/python3.3/email/charset.pyu	add_codec�scCs-|tkr|jdd�S|j|�SdS(Nuasciiusurrogateescape(uUNKNOWN8BITuencode(ustringucodec((u2/opt/alt/python33/lib64/python3.3/email/charset.pyu_encode�su_encodecBs�|EeZdZdZedd�Zdd�ZeZdd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zdd�ZdS(uCharsetu@	Map character sets to their email properties.

    This class provides information about the requirements imposed on email
    for a specific character set.  It also provides convenience routines for
    converting between character sets, given the availability of the
    applicable codecs.  Given a character set, it will do its best to provide
    information on how to use that character set in an email in an
    RFC-compliant way.

    Certain character sets must be encoded with quoted-printable or base64
    when used in email headers or bodies.  Certain character sets must be
    converted outright, and are not allowed in email.  Instances of this
    module expose the following information about a character set:

    input_charset: The initial character set specified.  Common aliases
                   are converted to their `official' email names (e.g. latin_1
                   is converted to iso-8859-1).  Defaults to 7-bit us-ascii.

    header_encoding: If the character set must be encoded before it can be
                     used in an email header, this attribute will be set to
                     Charset.QP (for quoted-printable), Charset.BASE64 (for
                     base64 encoding), or Charset.SHORTEST for the shortest of
                     QP or BASE64 encoding.  Otherwise, it will be None.

    body_encoding: Same as header_encoding, but describes the encoding for the
                   mail message's body, which indeed may be different than the
                   header encoding.  Charset.SHORTEST is not allowed for
                   body_encoding.

    output_charset: Some character sets must be converted before they can be
                    used in email headers or bodies.  If the input_charset is
                    one of them, this attribute will contain the name of the
                    charset output will be converted to.  Otherwise, it will
                    be None.

    input_codec: The name of the Python codec used to convert the
                 input_charset to Unicode.  If no conversion codec is
                 necessary, this attribute will be None.

    output_codec: The name of the Python codec used to convert Unicode
                  to the output_charset.  If no conversion codec is necessary,
                  this attribute will have the same value as the input_codec.
    c
Csy2t|t�r"|jd�nt|d�}Wn!tk
rUtj|��YnX|j�}tj||�|_	t
j|j	ttdf�\}}}|s�|j	}n||_||_tj||�|_tj|j	|j	�|_tj|j|j�|_dS(Nuascii(u
isinstanceustruencodeuUnicodeErroruerrorsuCharsetErroruloweruALIASESugetu
input_charsetuCHARSETSuSHORTESTuBASE64uNoneuheader_encodingu
body_encodinguoutput_charsetu	CODEC_MAPuinput_codecuoutput_codec(uselfu
input_charsetuhencubencuconv((u2/opt/alt/python33/lib64/python3.3/email/charset.pyu__init__�s&
		uCharset.__init__cCs
|jj�S(N(u
input_charsetulower(uself((u2/opt/alt/python33/lib64/python3.3/email/charset.pyu__str__�suCharset.__str__cCst|�t|�j�kS(N(ustrulower(uselfuother((u2/opt/alt/python33/lib64/python3.3/email/charset.pyu__eq__�suCharset.__eq__cCs|j|�S(N(u__eq__(uselfuother((u2/opt/alt/python33/lib64/python3.3/email/charset.pyu__ne__�suCharset.__ne__cCs.|jtkrdS|jtkr&dStSdS(uPReturn the content-transfer-encoding used for body encoding.

        This is either the string `quoted-printable' or `base64' depending on
        the encoding used, or it is a function in which case you should call
        the function with a single argument, the Message object being
        encoded.  The function should then set the Content-Transfer-Encoding
        header itself to whatever is appropriate.

        Returns "quoted-printable" if self.body_encoding is QP.
        Returns "base64" if self.body_encoding is BASE64.
        Returns conversion function otherwise.
        uquoted-printableubase64N(u
body_encodinguQPuBASE64uencode_7or8bit(uself((u2/opt/alt/python33/lib64/python3.3/email/charset.pyuget_body_encoding�s
uCharset.get_body_encodingcCs|jp|jS(u�Return the output character set.

        This is self.output_charset if that is not None, otherwise it is
        self.input_charset.
        (uoutput_charsetu
input_charset(uself((u2/opt/alt/python33/lib64/python3.3/email/charset.pyuget_output_charsetsuCharset.get_output_charsetcCsM|jpd}t||�}|j|�}|dkr=|S|j||�S(u�Header-encode a string by converting it first to bytes.

        The type of encoding (base64 or quoted-printable) will be based on
        this charset's `header_encoding`.

        :param string: A unicode string for the header.  It must be possible
            to encode this string to bytes using the character set's
            output codec.
        :return: The encoded string, with RFC 2047 chrome.
        uus-asciiN(uoutput_codecu_encodeu_get_encoderuNoneu
header_encode(uselfustringucodecuheader_bytesuencoder_module((u2/opt/alt/python33/lib64/python3.3/email/charset.pyu
header_encodesuCharset.header_encodecCs�|jpd}t||�}|j|�}t|jd|�}|j�}t|�t}g}	g}
t|�|}x�|D]�}|
j	|�t
j|
�}
|jt|
|��}||kr�|
j
�|	r�|
r�|	j	d�nC|	r�dnd}t
j|
�}t||�}|	j	||��|g}
t|�|}q�q�Wt
j|
�}t||�}|	j	||��|	S(ufHeader-encode a string by converting it first to bytes.

        This is similar to `header_encode()` except that the string is fit
        into maximum line lengths as given by the argument.

        :param string: A unicode string for the header.  It must be possible
            to encode this string to bytes using the character set's
            output codec.
        :param maxlengths: Maximum line length iterator.  Each element
            returned from this iterator will provide the next maximum line
            length.  This parameter is used as an argument to built-in next()
            and should never be exhausted.  The maximum line lengths should
            not count the RFC 2047 chrome.  These line lengths are only a
            hint; the splitter does the best it can.
        :return: Lines of encoded strings, each with RFC 2047 chrome.
        uus-asciiucharsetu uN(uoutput_codecu_encodeu_get_encoderupartialu
header_encodeuget_output_charsetulenuRFC2047_CHROME_LENunextuappenduEMPTYSTRINGujoinu
header_lengthupopuNone(uselfustringu
maxlengthsucodecuheader_bytesuencoder_moduleuencoderucharsetuextraulinesucurrent_lineumaxlenu	characteru	this_lineulengthu	separatorujoined_line((u2/opt/alt/python33/lib64/python3.3/email/charset.pyuheader_encode_lines/s6


	uCharset.header_encode_linescCs�|jtkrtjS|jtkr,tjS|jtkr|tjj|�}tjj|�}||krrtjStjSndSdS(N(	uheader_encodinguBASE64uemailu
base64mimeuQPu
quoprimimeuSHORTESTu
header_lengthuNone(uselfuheader_bytesulen64ulenqp((u2/opt/alt/python33/lib64/python3.3/email/charset.pyu_get_encoderms
uCharset._get_encodercCs�|s
|S|jtkrMt|t�r=|j|j�}ntjj|�S|jt	kr�t|t�r�|j|j�}n|j
d�}tjj|�St|t�r�|j|j�j
d�}n|SdS(uvBody-encode a string by converting it first to bytes.

        The type of encoding (base64 or quoted-printable) will be based on
        self.body_encoding.  If body_encoding is None, we assume the
        output charset is a 7bit encoding, so re-encoding the decoded
        string using the ascii codec produces the correct string version
        of the content.
        ulatin1uasciiN(u
body_encodinguBASE64u
isinstanceustruencodeuoutput_charsetuemailu
base64mimeubody_encodeuQPudecodeu
quoprimime(uselfustring((u2/opt/alt/python33/lib64/python3.3/email/charset.pyubody_encode|s	uCharset.body_encodeN(u__name__u
__module__u__qualname__u__doc__uDEFAULT_CHARSETu__init__u__str__u__repr__u__eq__u__ne__uget_body_encodinguget_output_charsetu
header_encodeuheader_encode_linesu_get_encoderubody_encode(u
__locals__((u2/opt/alt/python33/lib64/python3.3/email/charset.pyuCharset�s+!>(NNN(u__all__u	functoolsupartialuemail.base64mimeuemailuemail.quoprimimeuerrorsuemail.encodersuencode_7or8bituQPuBASE64uSHORTESTuRFC2047_CHROME_LENuDEFAULT_CHARSETuUNKNOWN8BITuEMPTYSTRINGuNoneuCHARSETSuALIASESu	CODEC_MAPuadd_charsetu	add_aliasu	add_codecu_encodeuCharset(((u2/opt/alt/python33/lib64/python3.3/email/charset.pyu<module>s�