AlkantarClanX12

Your IP : 3.149.251.26


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

�
��fj!c@s�dZddlmZmZmZmZddlmZddlm	Z	ddddd	d
ddgZ
eGd
d�de��Ze�Ze`
ejdd�Zejdd�Zejdddd�ZdS(ucThis will be the home for the policy that hooks in the new
code that adds all the email6 features.
i(uPolicyuCompat32ucompat32u_extend_docstrings(u_has_surrogates(uHeaderRegistryuCompat32ucompat32uPolicyuEmailPolicyudefaultustrictuSMTPuHTTPcs�|EeZdZdZdZe�Z�fdd�Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
ddd�Z�S(uEmailPolicyu+
    PROVISIONAL

    The API extensions enabled by this policy are currently provisional.
    Refer to the documentation for details.

    This policy adds new header parsing and folding algorithms.  Instead of
    simple strings, headers are custom objects with custom attributes
    depending on the type of the field.  The folding algorithm fully
    implements RFCs 2047 and 5322.

    In addition to the settable attributes listed above that apply to
    all Policies, this policy adds the following additional attributes:

    refold_source       -- if the value for a header in the Message object
                           came from the parsing of some source, this attribute
                           indicates whether or not a generator should refold
                           that value when transforming the message back into
                           stream form.  The possible values are:

                           none  -- all source values use original folding
                           long  -- source values that have any line that is
                                    longer than max_line_length will be
                                    refolded
                           all  -- all values are refolded.

                           The default is 'long'.

    header_factory      -- a callable that takes two arguments, 'name' and
                           'value', where 'name' is a header field name and
                           'value' is an unfolded header field value, and
                           returns a string-like object that represents that
                           header.  A default header_factory is provided that
                           understands some of the RFC5322 header field types.
                           (Currently address fields and date fields have
                           special treatment, while all other fields are
                           treated as unstructured.  This list will be
                           completed before the extension is marked stable.)
    ulongcs9d|kr%tj|dt��nt�j|�dS(Nuheader_factory(uobjectu__setattr__uHeaderRegistryusuperu__init__(uselfukw(u	__class__(u1/opt/alt/python33/lib64/python3.3/email/policy.pyu__init__BsuEmailPolicy.__init__cCs|j|jS(u�+
        The implementation for this class returns the max_count attribute from
        the specialized header class that would be used to construct a header
        of type 'name'.
        (uheader_factoryu	max_count(uselfuname((u1/opt/alt/python33/lib64/python3.3/email/policy.pyuheader_max_countIsuEmailPolicy.header_max_countcCsU|djdd�\}}|jd�dj|dd��}||jd�fS(uc+
        The name is parsed as everything up to the ':' and returned unmodified.
        The value is determined by stripping leading whitespace off the
        remainder of the first line, joining all subsequent lines together, and
        stripping any trailing carriage return or linefeed characters.  (This
        is the same as Compat32).

        iu:iu 	uNu
(usplitulstripujoinurstrip(uselfusourcelinesunameuvalue((u1/opt/alt/python33/lib64/python3.3/email/policy.pyuheader_source_parse[s	&uEmailPolicy.header_source_parsecCs�t|d�r4|jj�|j�kr4||fSt|t�rjt|j��dkrjtd��n||j||�fS(u�+
        The name is returned unchanged.  If the input value has a 'name'
        attribute and it matches the name ignoring case, the value is returned
        unchanged.  Otherwise the name and value are passed to header_factory
        method, and the resulting custom header object is returned as the
        value.  In this case a ValueError is raised if the input value contains
        CR or LF characters.

        unameiuDHeader values may not contain linefeed or carriage return characters(	uhasattrunameuloweru
isinstanceustrulenu
splitlinesu
ValueErroruheader_factory(uselfunameuvalue((u1/opt/alt/python33/lib64/python3.3/email/policy.pyuheader_store_parsehs

*
'uEmailPolicy.header_store_parsecCs2t|d�r|S|j|dj|j���S(ui+
        If the value has a 'name' attribute, it is returned to unmodified.
        Otherwise the name and the value with any linesep characters removed
        are passed to the header_factory method, and the resulting custom
        header object is returned.  Any surrogateescaped bytes get turned
        into the unicode unknown-character glyph.

        unameu(uhasattruheader_factoryujoinu
splitlines(uselfunameuvalue((u1/opt/alt/python33/lib64/python3.3/email/policy.pyuheader_fetch_parseys	uEmailPolicy.header_fetch_parsecCs|j||dd�S(u+
        Header folding is controlled by the refold_source policy setting.  A
        value is considered to be a 'source value' if and only if it does not
        have a 'name' attribute (having a 'name' attribute means it is a header
        object of some sort).  If a source value needs to be refolded according
        to the policy, it is converted into a custom header object by passing
        the name and the value with any linesep characters removed to the
        header_factory method.  Folding of a custom header object is done by
        calling its fold method with the current policy.

        Source values are split into lines using splitlines.  If the value is
        not to be refolded, the lines are rejoined using the linesep from the
        policy and returned.  The exception is lines containing non-ascii
        binary data.  In that case the value is refolded regardless of the
        refold_source setting, which causes the binary data to be CTE encoded
        using the unknown-8bit charset.

        u
refold_binaryT(u_folduTrue(uselfunameuvalue((u1/opt/alt/python33/lib64/python3.3/email/policy.pyufold�suEmailPolicy.foldcCs1|j||d|jdk�}|jdd�S(u�+
        The same as fold if cte_type is 7bit, except that the returned value is
        bytes.

        If cte_type is 8bit, non-ASCII binary data is converted back into
        bytes.  Headers with binary data are not refolded, regardless of the
        refold_header setting, since there is no way to know whether the binary
        data consists of single byte characters or multibyte characters.

        u
refold_binaryu7bituasciiusurrogateescape(u_folducte_typeuencode(uselfunameuvalueufolded((u1/opt/alt/python33/lib64/python3.3/email/policy.pyufold_binary�s!uEmailPolicy.fold_binaryc
st|d�r|jd|�S|jr1|jn	td��|j�}|jdkp�|jdko�|r�t|d�t|�d�kp�t�fdd	�|d
d�D��}|s�|r�t|�r�|j	|dj
|��jd|�S|d|jj
|�|jS(
Nunameupolicyuinfuallulongiic3s!|]}t|��kVqdS(N(ulen(u.0ux(umaxlen(u1/opt/alt/python33/lib64/python3.3/email/policy.pyu	<genexpr>�su$EmailPolicy._fold.<locals>.<genexpr>iuu: (uhasattrufoldumax_line_lengthufloatu
splitlinesu
refold_sourceulenuanyu_has_surrogatesuheader_factoryujoinulinesep(uselfunameuvalueu
refold_binaryulinesurefold((umaxlenu1/opt/alt/python33/lib64/python3.3/email/policy.pyu_fold�s*)%uEmailPolicy._foldF(u__name__u
__module__u__qualname__u__doc__u
refold_sourceuHeaderRegistryuheader_factoryu__init__uheader_max_countuheader_source_parseuheader_store_parseuheader_fetch_parseufoldufold_binaryuFalseu_fold(u
__locals__((u	__class__u1/opt/alt/python33/lib64/python3.3/email/policy.pyuEmailPolicys)	

uraise_on_defectulinesepu
umax_line_lengthNT(u__doc__uemail._policybaseuPolicyuCompat32ucompat32u_extend_docstringsuemail.utilsu_has_surrogatesuemail.headerregistryuHeaderRegistryu__all__uEmailPolicyudefaultuheader_factoryucloneuTrueustrictuSMTPuNoneuHTTP(((u1/opt/alt/python33/lib64/python3.3/email/policy.pyu<module>s$"	�