Lines Matching refs:cte
142 def _encode_text(string, charset, cte, policy): argument
147 if cte==None:
162 cte = 'base64'
164 cte = 'quoted-printable'
166 return cte, sniff_qp
167 if cte == '7bit':
169 elif cte == '8bit':
171 elif cte == 'quoted-printable':
174 elif cte == 'base64':
177 raise ValueError("Unknown content transfer encoding {}".format(cte))
178 return cte, data
181 def set_text_content(msg, string, subtype="plain", charset='utf-8', cte=None, argument
185 cte, payload = _encode_text(string, charset, cte, msg.policy)
190 msg['Content-Transfer-Encoding'] = cte
195 def set_message_content(msg, message, subtype="rfc822", cte=None, argument
201 if cte not in (None, '7bit', '8bit', 'binary'):
204 "message/rfc822 parts do not support cte={}".format(cte))
210 cte = '8bit' if cte is None else cte
212 if cte not in (None, '7bit'):
215 "message/external-body parts do not support cte={}".format(cte))
216 cte = '7bit'
217 elif cte is None:
220 cte = '7bit'
223 msg['Content-Transfer-Encoding'] = cte
228 def set_bytes_content(msg, data, maintype, subtype, cte='base64', argument
232 if cte == 'base64':
234 elif cte == 'quoted-printable':
240 elif cte == '7bit':
244 elif cte in ('8bit', 'binary'):
247 msg['Content-Transfer-Encoding'] = cte