PyXR

c:\python24\lib \ email \ MIMEMultipart.py



0001 # Copyright (C) 2002-2004 Python Software Foundation
0002 # Author: Barry Warsaw
0003 # Contact: email-sig@python.org
0004 
0005 """Base class for MIME multipart/* type messages."""
0006 
0007 from email import MIMEBase
0008 
0009 
0010 
0011 class MIMEMultipart(MIMEBase.MIMEBase):
0012     """Base class for MIME multipart/* type messages."""
0013 
0014     def __init__(self, _subtype='mixed', boundary=None, _subparts=None,
0015                  **_params):
0016         """Creates a multipart/* type message.
0017 
0018         By default, creates a multipart/mixed message, with proper
0019         Content-Type and MIME-Version headers.
0020 
0021         _subtype is the subtype of the multipart content type, defaulting to
0022         `mixed'.
0023 
0024         boundary is the multipart boundary string.  By default it is
0025         calculated as needed.
0026 
0027         _subparts is a sequence of initial subparts for the payload.  It
0028         must be an iterable object, such as a list.  You can always
0029         attach new subparts to the message by using the attach() method.
0030 
0031         Additional parameters for the Content-Type header are taken from the
0032         keyword arguments (or passed into the _params argument).
0033         """
0034         MIMEBase.MIMEBase.__init__(self, 'multipart', _subtype, **_params)
0035         if _subparts:
0036             for p in _subparts:
0037                 self.attach(p)
0038         if boundary:
0039             self.set_boundary(boundary)
0040 

Generated by PyXR 0.9.4
SourceForge.net Logo