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

Method _add_multipart

Lib/email/message.py:1183–1191  ·  view source on GitHub ↗
(self, _subtype, *args, _disp=None, **kw)

Source from the content-addressed store, hash-verified

1181 self._make_multipart('mixed', (), boundary)
1182
1183 def _add_multipart(self, _subtype, *args, _disp=None, **kw):
1184 if (self.get_content_maintype() != 'multipart' or
1185 self.get_content_subtype() != _subtype):
1186 getattr(self, 'make_' + _subtype)()
1187 part = type(self)(policy=self.policy)
1188 part.set_content(*args, **kw)
1189 if _disp and 'content-disposition' not in part:
1190 part['Content-Disposition'] = _disp
1191 self.attach(part)
1192
1193 def add_related(self, *args, **kw):
1194 self._add_multipart('related', *args, _disp='inline', **kw)

Callers 3

add_relatedMethod · 0.95
add_alternativeMethod · 0.95
add_attachmentMethod · 0.95

Calls 4

get_content_maintypeMethod · 0.80
get_content_subtypeMethod · 0.80
set_contentMethod · 0.45
attachMethod · 0.45

Tested by

no test coverage detected