MINI MINI MANI MO
3
  \                 @   s   d Z ddgZddlZddlZddlZddlmZmZ ddlm	Z	 ddlm
Z
 ddlmZm
Z
 dd	lmZ dd
lmZ ejZdZejdZd
d ZdddZdd Zdd ZG dd dZG dd deZG dd deZdS )z8Basic message object for the email package object model.MessageEmailMessage    N)BytesIOStringIO)utils)errors)Policycompat32)charset)decode_bz; z[ \(\)<>@,;:\\"/\[\]\?=]c             C   s4   t | jd\}}}|s$|j d fS |j |j fS )N;)str	partitionstrip)paramasepb r   %/usr/lib64/python3.6/email/message.py_splitparam   s    r   Tc             C   s   |dk	rt |dkrt|trL| d7 } tj|d |d |d }d| |f S y|jd W n2 tk
r   | d7 } tj|dd	}d| |f S X |stj|rd
| tj	|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   *      z%s=%sasciizutf-8 z%s="%s")
len
isinstancetupler   Zencode_rfc2231encodeUnicodeEncodeError	tspecialssearchquote)r   valuer#   r   r   r   _formatparam'   s    	
r%   c             C   s   dt |  } g }x| d d dkr| dd  } | jd}x<|dkrt| jdd|| jdd| d rt| jd|d }q:W |dk rt| }| d | }d|kr|jd}|d | j j d ||d d  j  }|j|j  | |d  } qW |S )Nr   r   r   "z\"r   =)r
   findcountr   indexr   lowerappend)sZplistendfir   r   r   _parseparamI   s     
*
,r1   c             C   s4   t | tr&| d | d tj| d fS tj| S d S )Nr   r   r   )r   r   r   unquote)r$   r   r   r   
_unquotevalue]   s    
r3   c               @   s  e Zd ZdZefddZdd Zddd	d
Zdd Zded
dZ	dd Z
dd Zdd Zdd Z
dfddZdgddZdd Zdd Zdd  Zd!d"