a
cæhÔ· ã @ 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 ú./opt/imh-python/lib/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… dkræ| dd … } | d¡}|dkrp| dd|¡| dd|¡ d rp| d|d ¡}q6|dk r€t| ƒ}| d |… }d|v rÊ| d¡}|d |… ¡ ¡ d ||d d … ¡ }| | ¡ ¡ | |d … } q|S )Nr
r r ú"z\"r ú=)r ÚfindÚcountr Úindexr ÚlowerÚappend)ÚsZplistÚendÚfÚir r r Ú_parseparamI s
(
,r3 c C s4 t | tƒr&| d | d t | d ¡fS t | ¡S d S )Nr r r )r r r Úunquote)r&