PHP 7.4.33
Preview: multipart.py Size: 1.58 KB
/lib64/python3.6/email/mime/multipart.py

# Copyright (C) 2002-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: [email protected]

"""Base class for MIME multipart/* type messages."""

__all__ = ['MIMEMultipart']

from email.mime.base import MIMEBase



class MIMEMultipart(MIMEBase):
    """Base class for MIME multipart/* type messages."""

    def __init__(self, _subtype='mixed', boundary=None, _subparts=None,
                 *, policy=None,
                 **_params):
        """Creates a multipart/* type message.

        By default, creates a multipart/mixed message, with proper
        Content-Type and MIME-Version headers.

        _subtype is the subtype of the multipart content type, defaulting to
        `mixed'.

        boundary is the multipart boundary string.  By default it is
        calculated as needed.

        _subparts is a sequence of initial subparts for the payload.  It
        must be an iterable object, such as a list.  You can always
        attach new subparts to the message by using the attach() method.

        Additional parameters for the Content-Type header are taken from the
        keyword arguments (or passed into the _params argument).
        """
        MIMEBase.__init__(self, 'multipart', _subtype, policy=policy, **_params)

        # Initialise _payload to an empty list as the Message superclass's
        # implementation of is_multipart assumes that _payload is a list for
        # multipart messages.
        self._payload = []

        if _subparts:
            for p in _subparts:
                self.attach(p)
        if boundary:
            self.set_boundary(boundary)

Directory Contents

Dirs: 1 × Files: 9

Name Size Perms Modified Actions
- drwxr-xr-x 2025-07-03 05:10:07
Edit Download
1.29 KB lrw-r--r-- 2018-12-23 21:37:14
Edit Download
2.67 KB lrw-r--r-- 2018-12-23 21:37:14
Edit Download
916 B lrw-r--r-- 2018-12-23 21:37:14
Edit Download
1.79 KB lrw-r--r-- 2018-12-23 21:37:14
Edit Download
1.29 KB lrw-r--r-- 2018-12-23 21:37:14
Edit Download
1.58 KB lrw-r--r-- 2018-12-23 21:37:14
Edit Download
691 B lrw-r--r-- 2018-12-23 21:37:14
Edit Download
1.40 KB lrw-r--r-- 2018-12-23 21:37:14
Edit Download
0 B lrw-r--r-- 2025-07-01 22:14:41
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).