MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __init__

Method __init__

tools/python-3.11.9-amd64/Lib/email/mime/base.py:17–29  ·  view source on GitHub ↗

This constructor adds a Content-Type: and a MIME-Version: header. The Content-Type: header is taken from the _maintype and _subtype arguments. Additional parameters for this header are taken from the keyword arguments.

(self, _maintype, _subtype, *, policy=None, **_params)

Source from the content-addressed store, hash-verified

15 """Base class for MIME specializations."""
16
17 def __init__(self, _maintype, _subtype, *, policy=None, **_params):
18 """This constructor adds a Content-Type: and a MIME-Version: header.
19
20 The Content-Type: header is taken from the _maintype and _subtype
21 arguments. Additional parameters for this header are taken from the
22 keyword arguments.
23 """
24 if policy is None:
25 policy = email.policy.compat32
26 message.Message.__init__(self, policy=policy)
27 ctype = '%s/%s' % (_maintype, _subtype)
28 self.add_header('Content-Type', ctype, **_params)
29 self['MIME-Version'] = '1.0'

Callers

nothing calls this directly

Calls 1

add_headerMethod · 0.45

Tested by

no test coverage detected