MCPcopy Index your code
hub / github.com/python/cpython / set_text_content

Function set_text_content

Lib/email/contentmanager.py:172–182  ·  view source on GitHub ↗
(msg, string, subtype="plain", charset='utf-8', cte=None,
                     disposition=None, filename=None, cid=None,
                     params=None, headers=None)

Source from the content-addressed store, hash-verified

170
171
172def set_text_content(msg, string, subtype="plain", charset='utf-8', cte=None,
173 disposition=None, filename=None, cid=None,
174 params=None, headers=None):
175 _prepare_set(msg, 'text', subtype, headers)
176 cte, payload = _encode_text(string, charset, cte, msg.policy)
177 msg.set_payload(payload)
178 msg.set_param('charset',
179 email.charset.ALIASES.get(charset, charset),
180 replace=True)
181 msg['Content-Transfer-Encoding'] = cte
182 _finalize_set(msg, disposition, filename, cid, params)
183raw_data_manager.add_set_handler(str, set_text_content)
184
185

Callers

nothing calls this directly

Calls 6

_prepare_setFunction · 0.85
_encode_textFunction · 0.85
_finalize_setFunction · 0.85
set_payloadMethod · 0.80
set_paramMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…