当前位置: 首页>>代码示例>>Python>>正文


Python MIMENonMultipart.__init__方法代码示例

本文整理汇总了Python中email.mime.nonmultipart.MIMENonMultipart.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python MIMENonMultipart.__init__方法的具体用法?Python MIMENonMultipart.__init__怎么用?Python MIMENonMultipart.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在email.mime.nonmultipart.MIMENonMultipart的用法示例。


在下文中一共展示了MIMENonMultipart.__init__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from email.mime.nonmultipart import MIMENonMultipart [as 别名]
# 或者: from email.mime.nonmultipart.MIMENonMultipart import __init__ [as 别名]
def __init__(self, _msg, _subtype='rfc822'):
        """Create a message/* type MIME document.

        _msg is a message object and must be an instance of Message, or a
        derived class of Message, otherwise a TypeError is raised.

        Optional _subtype defines the subtype of the contained message.  The
        default is "rfc822" (this is defined by the MIME standard, even though
        the term "rfc822" is technically outdated by RFC 2822).
        """
        MIMENonMultipart.__init__(self, 'message', _subtype)
        if not isinstance(_msg, message.Message):
            raise TypeError('Argument is not an instance of Message')
        # It's convenient to use this base class method.  We need to do it
        # this way or we'll get an exception
        message.Message.attach(self, _msg)
        # And be sure our default type is set correctly
        self.set_default_type('message/rfc822') 
开发者ID:glmcdona,项目名称:meddle,代码行数:20,代码来源:message.py

示例2: __init__

# 需要导入模块: from email.mime.nonmultipart import MIMENonMultipart [as 别名]
# 或者: from email.mime.nonmultipart.MIMENonMultipart import __init__ [as 别名]
def __init__(self, _data, _subtype='octet-stream',
                 _encoder=encoders.encode_base64, **_params):
        """Create an application/* type MIME document.

        _data is a string containing the raw application data.

        _subtype is the MIME content type subtype, defaulting to
        'octet-stream'.

        _encoder is a function which will perform the actual encoding for
        transport of the application data, defaulting to base64 encoding.

        Any additional keyword arguments are passed to the base class
        constructor, which turns them into parameters on the Content-Type
        header.
        """
        if _subtype is None:
            raise TypeError('Invalid application MIME subtype')
        MIMENonMultipart.__init__(self, 'application', _subtype, **_params)
        self.set_payload(_data)
        _encoder(self) 
开发者ID:glmcdona,项目名称:meddle,代码行数:23,代码来源:application.py

示例3: __init__

# 需要导入模块: from email.mime.nonmultipart import MIMENonMultipart [as 别名]
# 或者: from email.mime.nonmultipart.MIMENonMultipart import __init__ [as 别名]
def __init__(self, _data, _subtype='octet-stream',
                 _encoder=encoders.encode_base64, **_params):
        """Create an application/* type MIME document.

        _data is a string containing the raw applicatoin data.

        _subtype is the MIME content type subtype, defaulting to
        'octet-stream'.

        _encoder is a function which will perform the actual encoding for
        transport of the application data, defaulting to base64 encoding.

        Any additional keyword arguments are passed to the base class
        constructor, which turns them into parameters on the Content-Type
        header.
        """
        if _subtype is None:
            raise TypeError('Invalid application MIME subtype')
        MIMENonMultipart.__init__(self, 'application', _subtype, **_params)
        self.set_payload(_data)
        _encoder(self) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:23,代码来源:application.py

示例4: __init__

# 需要导入模块: from email.mime.nonmultipart import MIMENonMultipart [as 别名]
# 或者: from email.mime.nonmultipart.MIMENonMultipart import __init__ [as 别名]
def __init__(self, _msg, _subtype='rfc822', *, policy=None):
        """Create a message/* type MIME document.

        _msg is a message object and must be an instance of Message, or a
        derived class of Message, otherwise a TypeError is raised.

        Optional _subtype defines the subtype of the contained message.  The
        default is "rfc822" (this is defined by the MIME standard, even though
        the term "rfc822" is technically outdated by RFC 2822).
        """
        MIMENonMultipart.__init__(self, 'message', _subtype, policy=policy)
        if not isinstance(_msg, message.Message):
            raise TypeError('Argument is not an instance of Message')
        # It's convenient to use this base class method.  We need to do it
        # this way or we'll get an exception
        message.Message.attach(self, _msg)
        # And be sure our default type is set correctly
        self.set_default_type('message/rfc822') 
开发者ID:CedricGuillemet,项目名称:Imogen,代码行数:20,代码来源:message.py

示例5: __init__

# 需要导入模块: from email.mime.nonmultipart import MIMENonMultipart [as 别名]
# 或者: from email.mime.nonmultipart.MIMENonMultipart import __init__ [as 别名]
def __init__(self, _data, _subtype='octet-stream',
                 _encoder=encoders.encode_base64, *, policy=None, **_params):
        """Create an application/* type MIME document.

        _data is a string containing the raw application data.

        _subtype is the MIME content type subtype, defaulting to
        'octet-stream'.

        _encoder is a function which will perform the actual encoding for
        transport of the application data, defaulting to base64 encoding.

        Any additional keyword arguments are passed to the base class
        constructor, which turns them into parameters on the Content-Type
        header.
        """
        if _subtype is None:
            raise TypeError('Invalid application MIME subtype')
        MIMENonMultipart.__init__(self, 'application', _subtype, policy=policy,
                                  **_params)
        self.set_payload(_data)
        _encoder(self) 
开发者ID:CedricGuillemet,项目名称:Imogen,代码行数:24,代码来源:application.py


注:本文中的email.mime.nonmultipart.MIMENonMultipart.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。