a
´i‰¸ ã @ sÜ d Z ddgZddlZddlZddlZddlmZmZ ddlm Z ddlm
Z
ddlmZm
Z
dd lmZ dd
lmZ ejZdZe d¡Zd
d„ Zddd„Zdd„ Zdd„ ZG dd„ dƒZG dd„ deƒZG dd„ deƒZdS )z8Basic message object for the email package object model.ÚMessageÚEmailMessageé N)ÚBytesIOÚStringIO)Úutils)Úerrors)ÚPolicyÚcompat32©Úcharset)Údecode_bz; z[ \(\)<>@,;:\\"/\[\]\?=]c C s4 t | ƒ d¡\}}}|s$| ¡ d fS | ¡ | ¡ fS )Nú;)ÚstrÚ partitionÚstrip)ÚparamÚaÚsepÚb© r ú%/usr/lib64/python3.9/email/message.pyÚ_splitparam s r Tc C sÆ |dur¾t |ƒdkr¾t|tƒrL| d7 } t |d |d |d ¡}d| |f S z| d¡ W n4 tyŽ | d7 } t |dd ¡}d| |f Y S 0 |sžt |¡r°d
| t |¡f S d| |f S n| S dS )a~ 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.
Nr Ú*é é ú%s=%sÚasciizutf-8Ú z%s="%s")
ÚlenÚ
isinstanceÚtupler Zencode_rfc2231ÚencodeÚUnicodeEncodeErrorÚ tspecialsÚsearchÚquote)r Úvaluer% r r r Ú_formatparam' s
r' c C s
dt | ƒ } g }d}| d|¡|k�r|d7 }| d|¡}|d }}|dkr’|| d||¡| d||¡ 7 }|d dkrzq’|| d|d ¡ }}qD|dk r¢t| ƒ}| d||¡}|dkrÆ| ||… }n,| ||… ¡ ¡ d | |d |… ¡ }| | ¡ ¡ |}q|S ) Nr
r r ú"z\"r ú=éÿÿÿÿ) r ÚfindÚcountr ÚrstripÚlowerÚlstripÚappendr )ÚsZplistÚstartÚendZindÚdiffÚiÚfr r r Ú_parseparamI s*
,r7 c C s4 t | tƒr&| d | d t | d ¡fS t | ¡S d S )Nr r r )r r r Úunquote)r&