zfc@sdZddlZddlZddlZddlmZmZe-ejrfeddenddl Z WdQXddlm Z e ddd d d d d ddgZ d e j fdYZ yddl Z Wnek rddlZ nXe jZ[ dadZdadZdZdZdZied6ed6ed6ed6dd6dd6Zidd6dd6dd6dd6d d6d!d6Zd"Zd#Zd$Zd%ZdS(&s<Various tools used by MIME-reading or MIME-writing programs.iN(tfilterwarningstcatch_warningstignores.*rfc822 has been removed(twarnpy3ks@in 3.x, mimetools has been removed in favor of the email packaget stacklevelitMessagetchoose_boundarytencodetdecodet copyliteralt copybinarycBskeZdZddZdZdZdZdZdZdZ d Z d Z d Z RS( sA derived class of rfc822.Message that knows about MIME headers and contains some hooks for decoding encoded and multipart messages.icCsRtjj||||jd|_|jd|_|j|jdS(Nscontent-transfer-encodings content-type(trfc822Rt__init__t getheadertencodingheadert typeheadert parsetypet parseplist(tselftfptseekable((s!/usr/lib64/python2.7/mimetools.pyR s  cCs|j}|dkrd}nd|krS|jd}|||_|| }n d|_|jd}x4tt|D] }||jj||sZ       W