當前位置: 首頁>>代碼示例>>Python>>正文


Python MIMEBase.__init__方法代碼示例

本文整理匯總了Python中future.backports.email.mime.base.MIMEBase.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python MIMEBase.__init__方法的具體用法?Python MIMEBase.__init__怎麽用?Python MIMEBase.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在future.backports.email.mime.base.MIMEBase的用法示例。


在下文中一共展示了MIMEBase.__init__方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from future.backports.email.mime.base import MIMEBase [as 別名]
# 或者: from future.backports.email.mime.base.MIMEBase import __init__ [as 別名]
def __init__(self, _subtype='mixed', boundary=None, _subparts=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, **_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) 
開發者ID:Soft8Soft,項目名稱:verge3d-blender-addon,代碼行數:34,代碼來源:multipart.py


注:本文中的future.backports.email.mime.base.MIMEBase.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。