Home
last modified time | relevance | path

Searched refs:maintype (Results 1 – 17 of 17) sorted by relevance

/third_party/python/Lib/email/
Dcontentmanager.py20 maintype = msg.get_content_maintype()
21 if maintype in self.get_handlers:
22 return self.get_handlers[maintype](msg, *args, **kw)
73 for maintype in 'audio image video application'.split():
74 raw_data_manager.add_get_handler(maintype, get_non_text_content)
95 def _prepare_set(msg, maintype, subtype, headers): argument
96 msg['Content-Type'] = '/'.join((maintype, subtype))
228 def set_bytes_content(msg, data, maintype, subtype, cte='base64', argument
231 _prepare_set(msg, maintype, subtype, headers)
Diterators.py45 def typed_subpart_iterator(msg, maintype='text', subtype=None): argument
53 if subpart.get_content_maintype() == maintype:
Dmessage.py980 maintype, subtype = part.get_content_type().split('/')
981 if maintype == 'text':
985 if maintype != 'multipart' or not self.is_multipart():
1041 maintype, subtype = self.get_content_type().split('/')
1042 if maintype != 'multipart' or subtype == 'alternative':
1054 if maintype == 'multipart' and subtype == 'related':
1078 maintype, subtype = part.get_content_type().split('/')
1079 if ((maintype, subtype) in self._body_types and
Dgenerator.py487 maintype = part.get_content_maintype()
488 if maintype == 'text':
490 elif maintype == 'multipart':
Dheaderregistry.py474 self._maintype = utils._sanitize(self._parse_tree.maintype)
478 def maintype(self): member in ContentTypeHeader
487 return self.maintype + '/' + self.subtype
D_header_value_parser.py824 maintype = 'text' variable in ContentType
2650 ctype.maintype = token.value.strip().lower()
2671 del ctype.maintype, ctype.subtype
/third_party/python/Doc/includes/
Demail-dir.py61 maintype, subtype = ctype.split('/', 1)
64 maintype=maintype,
Demail-mime.py24 msg.add_attachment(img_data, maintype='image',
Demail-read-alternative.py39 if richest['content-type'].maintype == 'text':
/third_party/python/Doc/library/
Demail.contentmanager.rst35 * the string representing the full MIME type (``maintype/subtype``)
36 * the string representing the ``maintype``
45 If the ``maintype`` is ``multipart``, raise a :exc:`TypeError`; otherwise
123 set_content(msg, <'bytes'>, maintype, subtype, cte="base64", \
132 Add a :mailheader:`Content-Type` header with a ``maintype/subtype``
135 * For ``str``, set the MIME ``maintype`` to ``text``, and set the
137 * For ``bytes``, use the specified *maintype* and *subtype*, or
139 * For :class:`~email.message.EmailMessage` objects, set the maintype
Demail.iterators.rst30 .. function:: typed_subpart_iterator(msg, maintype='text', subtype=None)
33 match the MIME type specified by *maintype* and *subtype*.
36 done only with the main type. *maintype* is optional too; it defaults to
Demail.headerregistry.rst280 The content type string, in the form ``maintype/subtype``.
282 .. attribute:: maintype
Demail.compat32-message.rst432 lower case of the form :mimetype:`maintype/subtype`. If there was no
447 Return the message's main content type. This is the :mimetype:`maintype`
568 header. *type* must be a string in the form :mimetype:`maintype/subtype`,
Demail.message.rst312 :mimetype:`maintype/subtype`. If there is no :mailheader:`Content-Type`
328 Return the message's main content type. This is the :mimetype:`maintype`
Demail.generator.rst256 * ``maintype`` -- Main MIME type of the non-\ :mimetype:`text` part
/third_party/python/Lib/test/test_email/
Dtest_contentmanager.py236 for maintype in 'audio image video application'.split():
237 with self.subTest(maintype=maintype):
238 m = self._str_msg(template.format(maintype+'/foo'))
782 maintype='application', subtype='octet-stream', cte='7bit')
Dtest_headerregistry.py241 maintype, argument
252 self.assertEqual(h.maintype, maintype)